mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-20 13:54:36 +01:00
doc: Merge request and schema jsons in a single file
Merge information from `*.request.json` & `*.schema.json`. Also consolidate remaining details from `*.md` files and create a single file in schemas folder.
This commit is contained in:
parent
b0da807700
commit
04884ca664
126 changed files with 64212 additions and 0 deletions
File diff suppressed because one or more lines are too long
520
doc/rpc-schema-draft.json
Normal file
520
doc/rpc-schema-draft.json
Normal file
|
@ -0,0 +1,520 @@
|
|||
{
|
||||
"$schema": "https://json-schema.org/draft-07/schema#",
|
||||
"title": "Core lightning rpc meta-schema",
|
||||
"definitions": {
|
||||
"nonNegativeInteger": {
|
||||
"type": "integer",
|
||||
"minimum": 0
|
||||
},
|
||||
"nonNegativeIntegerDefault0": {
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/definitions/nonNegativeInteger"
|
||||
},
|
||||
{
|
||||
"default": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
"simpleTypes": {
|
||||
"enum": [
|
||||
"array",
|
||||
"boolean",
|
||||
"integer",
|
||||
"null",
|
||||
"number",
|
||||
"object",
|
||||
"string",
|
||||
"hex",
|
||||
"hash",
|
||||
"secret",
|
||||
"u64",
|
||||
"u32",
|
||||
"u16",
|
||||
"u8",
|
||||
"pubkey",
|
||||
"sat",
|
||||
"msat",
|
||||
"msat_or_all",
|
||||
"msat_or_any",
|
||||
"currency",
|
||||
"txid",
|
||||
"signature",
|
||||
"bip340sig",
|
||||
"short_channel_id",
|
||||
"short_channel_id_dir",
|
||||
"outpoint",
|
||||
"feerate",
|
||||
"outputdesc"
|
||||
]
|
||||
},
|
||||
"schemaArray": {
|
||||
"type": "array",
|
||||
"minItems": 1,
|
||||
"items": {
|
||||
"properties": {
|
||||
"type": {
|
||||
"$ref": "#/definitions/simpleTypes"
|
||||
},
|
||||
"description": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"schemaIfThenElse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"properties": {
|
||||
"patternProperties": {
|
||||
"^[a-zA-Z_][a-zA-Z0-9_]*$": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
"$ref": "#/definitions/simpleTypes"
|
||||
},
|
||||
"description": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"schemaItems": {
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"type": {
|
||||
"$ref": "#/definitions/simpleTypes"
|
||||
},
|
||||
"additionalProperties": {
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"description": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"items": {
|
||||
"$ref": "#/definitions/schemaItems"
|
||||
},
|
||||
"properties": {
|
||||
"$ref": "#/definitions/schemaObject"
|
||||
},
|
||||
"enum": {
|
||||
"type": "array",
|
||||
"items": true,
|
||||
"minItems": 1,
|
||||
"uniqueItems": true
|
||||
},
|
||||
"if": {
|
||||
"$ref": "#/definitions/schemaIfThenElse"
|
||||
},
|
||||
"then": {
|
||||
"$ref": "#/definitions/schemaIfThenElse"
|
||||
},
|
||||
"else": {
|
||||
"$ref": "#/definitions/schemaIfThenElse"
|
||||
},
|
||||
"allOf": {
|
||||
"$ref": "#/definitions/schemaArray"
|
||||
},
|
||||
"anyOf": {
|
||||
"$ref": "#/definitions/schemaArray"
|
||||
},
|
||||
"oneOf": {
|
||||
"$ref": "#/definitions/schemaArray"
|
||||
}
|
||||
}
|
||||
},
|
||||
"schemaObject": {
|
||||
"type": "object",
|
||||
"patternProperties": {
|
||||
"^[a-zA-Z_][a-zA-Z0-9_]*$": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"type": {
|
||||
"$ref": "#/definitions/simpleTypes"
|
||||
},
|
||||
"additionalProperties": {
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"hidden": {
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"untyped": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"comment": {
|
||||
"type": "string"
|
||||
},
|
||||
"description": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"$ref": "#/definitions/schemaObject"
|
||||
},
|
||||
"items": {
|
||||
"$ref": "#/definitions/schemaItems"
|
||||
},
|
||||
"default": {
|
||||
"type": [
|
||||
"string",
|
||||
"number",
|
||||
"boolean",
|
||||
"array",
|
||||
"object",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"added": {
|
||||
"type": "string"
|
||||
},
|
||||
"deprecated": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"maximum": {
|
||||
"type": "number"
|
||||
},
|
||||
"minimum": {
|
||||
"type": "number"
|
||||
},
|
||||
"maxLength": {
|
||||
"$ref": "#/definitions/nonNegativeInteger"
|
||||
},
|
||||
"minLength": {
|
||||
"$ref": "#/definitions/nonNegativeIntegerDefault0"
|
||||
},
|
||||
"pattern": {
|
||||
"type": "string",
|
||||
"format": "regex"
|
||||
},
|
||||
"enum": {
|
||||
"type": "array",
|
||||
"items": true,
|
||||
"minItems": 1,
|
||||
"uniqueItems": true
|
||||
},
|
||||
"format": {
|
||||
"type": "string"
|
||||
},
|
||||
"if": {
|
||||
"$ref": "#/definitions/schemaIfThenElse"
|
||||
},
|
||||
"then": {
|
||||
"$ref": "#/definitions/schemaIfThenElse"
|
||||
},
|
||||
"else": {
|
||||
"$ref": "#/definitions/schemaIfThenElse"
|
||||
},
|
||||
"allOf": {
|
||||
"$ref": "#/definitions/schemaArray"
|
||||
},
|
||||
"anyOf": {
|
||||
"$ref": "#/definitions/schemaArray"
|
||||
},
|
||||
"oneOf": {
|
||||
"$ref": "#/definitions/schemaArray"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"schemaRequest": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"required": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"$ref": "#/definitions/schemaObject"
|
||||
},
|
||||
"oneOfMany": {
|
||||
"$ref": "#/definitions/schemaArray"
|
||||
},
|
||||
"pairedWith": {
|
||||
"$ref": "#/definitions/schemaArray"
|
||||
},
|
||||
"dependentUpon": {
|
||||
"type": "object",
|
||||
"patternProperties": {
|
||||
"^[a-zA-Z_][a-zA-Z0-9_]*$": {
|
||||
"$ref": "#/definitions/schemaArray"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"schemaResponse": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"required": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"pre_return_value_notes": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"post_return_value_notes": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"$ref": "#/definitions/schemaObject"
|
||||
},
|
||||
"allOf": {
|
||||
"$ref": "#/definitions/schemaArray"
|
||||
},
|
||||
"anyOf": {
|
||||
"$ref": "#/definitions/schemaArray"
|
||||
},
|
||||
"oneOf": {
|
||||
"$ref": "#/definitions/schemaArray"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"$schema": {
|
||||
"type": "string",
|
||||
"format": "uri"
|
||||
},
|
||||
"additionalProperties": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"object"
|
||||
]
|
||||
},
|
||||
"added": {
|
||||
"type": "string"
|
||||
},
|
||||
"deprecated": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"warning": {
|
||||
"type": "string"
|
||||
},
|
||||
"rpc": {
|
||||
"type": "string"
|
||||
},
|
||||
"title": {
|
||||
"type": "string"
|
||||
},
|
||||
"description": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"request": {
|
||||
"$ref": "#/definitions/schemaRequest"
|
||||
},
|
||||
"reliability": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"usage": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"restriction_format": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"example_usage": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"example_json_request": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"id": {
|
||||
"type": "integer"
|
||||
},
|
||||
"method": {
|
||||
"type": "string"
|
||||
},
|
||||
"params": {}
|
||||
}
|
||||
},
|
||||
"notes": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"notifications": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"sharing_runes": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"riskfactor_effect_on_routing": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"recommended_riskfactor_values": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"optimality": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"randomization": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"$ref": "#/definitions/schemaResponse"
|
||||
},
|
||||
"treatment_of_types": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"permitted_sqlite3_functions": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"tables": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"example_json_response": {
|
||||
"type": "array",
|
||||
"items": {}
|
||||
},
|
||||
"example_json_notifications": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"method": {
|
||||
"type": "string"
|
||||
},
|
||||
"params": {}
|
||||
}
|
||||
},
|
||||
"trivia": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"errors": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"author": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"see_also": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"resources": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"$schema",
|
||||
"type",
|
||||
"rpc",
|
||||
"title",
|
||||
"description",
|
||||
"request",
|
||||
"response"
|
||||
]
|
||||
}
|
59
doc/schemas/lightning-addgossip.json
Normal file
59
doc/schemas/lightning-addgossip.json
Normal file
|
@ -0,0 +1,59 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"rpc": "addgossip",
|
||||
"title": "Command for injecting a gossip message (low-level)",
|
||||
"description": [
|
||||
"The **addgossip** RPC command injects a hex-encoded gossip message into the gossip daemon. It may return an error if it is malformed, or may update its internal state using the gossip message.",
|
||||
"",
|
||||
"Note that currently some paths will still silently reject the gossip: it is best effort.",
|
||||
"",
|
||||
"This is particularly used by plugins which may receive channel_update messages within error replies."
|
||||
],
|
||||
"request": {
|
||||
"required": [
|
||||
"message"
|
||||
],
|
||||
"properties": {
|
||||
"message": {
|
||||
"type": "hex",
|
||||
"description": [
|
||||
"The raw, hex-encoded, gossip message to add to the local gossip view."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"properties": {}
|
||||
},
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:addgossip#1",
|
||||
"method": "addgossip",
|
||||
"params": {
|
||||
"message": "010078c3314666731e339c0b8434f7824797a084ed7ca3655991a672da068e2c44cb53b57b53a296c133bc879109a8931dc31e6913a4bda3d58559b99b95663e6d52775579447ef5526300e1bb89bc6af8557aa1c3810a91814eafad6d103f43182e17b16644cb38c1d58a8edd094303959a9f1f9d42ff6c32a21f9c118531f512c8679cabaccc6e39dbd95a4dac90e75a258893c3aa3f733d1b8890174d5ddea8003cadffe557773c54d2c07ca1d535c4bf85885f879ae466c16a516e8ffcfec1740e3f5c98ca9ce13f452e867befef5517f306ed6aa5119b79059bcc6f68f329986b665d16de7bc7df64e3537504c91eeabe0e59d3a2b68e4216ead2b0f6e3ef7c000006226e46111a0b59caaf126043eb5bbf28c34f3a5e332a1fc7b2b73cf188910f0000670000010000022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d590266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c0351802e3bd38009866c9da8ec4aa99cc4ea9c6c0dd46df15c61ef0ce1f271291714e5702324266de8403b3ab157a09f1f784d587af61831c998c151bcc21bb74c2b2314b"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "example:addgossip#2",
|
||||
"method": "addgossip",
|
||||
"params": {
|
||||
"message": "0102420526c8eb62ec6999bbee5f1de4841cab734374ec642b7deeb0259e76220bf82e97a241c907d5ff52019655f7f9a614c285bb35690f3a1a2b928d7b2349a79e06226e46111a0b59caaf126043eb5bbf28c34f3a5e332a1fc7b2b73cf188910f000067000001000065b32a0e010100060000000000000000000000010000000a000000003b023380"
|
||||
}
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{},
|
||||
{}
|
||||
],
|
||||
"author": [
|
||||
"Rusty Russell <<rusty@rustcorp.com.au>> is mainly responsible."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-pay(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
137
doc/schemas/lightning-addpsbtoutput.json
Normal file
137
doc/schemas/lightning-addpsbtoutput.json
Normal file
|
@ -0,0 +1,137 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"added": "v23.11",
|
||||
"rpc": "addpsbtoutput",
|
||||
"title": "Command to populate PSBT outputs from the wallet",
|
||||
"description": [
|
||||
"`addpsbtoutput` is a low-level RPC command which creates or modifies a PSBT by adding a single output of amount *satoshi*.",
|
||||
"",
|
||||
"This is used to receive funds into the on-chain wallet interactively using PSBTs."
|
||||
],
|
||||
"request": {
|
||||
"required": [
|
||||
"satoshi"
|
||||
],
|
||||
"properties": {
|
||||
"satoshi": {
|
||||
"type": "sat",
|
||||
"description": [
|
||||
"The satoshi value of the output. It can be a whole number, a whole number ending in *sat*, or a number with 1 to 8 decimal places ending in *btc*."
|
||||
]
|
||||
},
|
||||
"initialpsbt": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Base 64 encoded PSBT to add the output to. If not specified, one will be generated automatically."
|
||||
]
|
||||
},
|
||||
"locktime": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"If not set, it is set to a recent block height (if no initial psbt is specified)."
|
||||
]
|
||||
},
|
||||
"destination": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"If it is not set, an internal address is generated."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"psbt",
|
||||
"estimated_added_weight",
|
||||
"outnum"
|
||||
],
|
||||
"properties": {
|
||||
"psbt": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Unsigned PSBT which fulfills the parameters given."
|
||||
]
|
||||
},
|
||||
"estimated_added_weight": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"The estimated weight of the added output."
|
||||
]
|
||||
},
|
||||
"outnum": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"The 0-based number where the output was placed."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"example_usage": [
|
||||
"Here is a command to make a PSBT with a 100,000 sat output that leads to the on-chain wallet.",
|
||||
"",
|
||||
"```shell",
|
||||
"lightning-cli addpsbtoutput 100000sat",
|
||||
"```"
|
||||
],
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:addpsbtoutput#1",
|
||||
"method": "addpsbtoutput",
|
||||
"params": {
|
||||
"satoshi": 100000,
|
||||
"initialpsbt": null,
|
||||
"locktime": null,
|
||||
"destination": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "example:addpsbtoutput#2",
|
||||
"method": "addpsbtoutput",
|
||||
"params": {
|
||||
"satoshi": 1000000,
|
||||
"initialpsbt": null,
|
||||
"locktime": 111,
|
||||
"destination": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "example:addpsbtoutput#3",
|
||||
"method": "addpsbtoutput",
|
||||
"params": {
|
||||
"satoshi": 974343,
|
||||
"initialpsbt": "cHNidP8BAF4CAAAAAfwbEpvpi6D14YV4VLnuVB47Y0uF41kXEyJRL4IusySSAQAAAAD9////ASICAAAAAAAAIlEgeDY1X9yKgtxMsAp3LFVUFR0GOEpN1l6NP2isCFZrhL5nAAAAAAEA9gIAAAAAAQFEkxvLatohY6mw5gr5qG1aiArSrziFPR2YoqD21Hv+RAAAAAAA/f///wJAQg8AAAAAACIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNrz8PAAAAAAAiUSBj/+5Op9UebK35CG4oaiUnkiqqJbjFOuvzL6MqCmJ/WgJHMEQCIEu1nfVRt9i+rFM219mwhMqdwJsqygWSWTFUS+cemdh6AiBG3Qo8g9J/aAMO2RHDsIBScscj6pTTIwZp7Gw8G3EOKAEhA9dFRFyTYmZfIuDZbp52byc/MmDeo5yKdr+gXdJoTdzPZgAAAAEBK68/DwAAAAAAIlEgY//uTqfVHmyt+QhuKGolJ5IqqiW4xTrr8y+jKgpif1oAAA==",
|
||||
"locktime": null,
|
||||
"destination": "bcrt1q9tc6q49l6wrrtp8ul45rj92hsleehwwxty32zu"
|
||||
}
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"psbt": "cHNidP8BAgQCAAAAAQMEbAAAAAEEAQABBQEBAQYBAwH7BAIAAAAAAQMIoIYBAAAAAAABBCJRIHg2NV/cioLcTLAKdyxVVBUdBjhKTdZejT9orAhWa4S+AA==",
|
||||
"estimated_added_weight": 172,
|
||||
"outnum": 0
|
||||
},
|
||||
{
|
||||
"psbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQABBQEBAQYBAwH7BAIAAAAAAQMIQEIPAAAAAAABBCJRIJd6ICNAQALFOMhoUHuSVSuzcaUdkDKlk4K+A+DR9+4uAA==",
|
||||
"estimated_added_weight": 172,
|
||||
"outnum": 0
|
||||
},
|
||||
{
|
||||
"psbt": "cHNidP8BAH0CAAAAAfwbEpvpi6D14YV4VLnuVB47Y0uF41kXEyJRL4IusySSAQAAAAD9////AiICAAAAAAAAIlEgeDY1X9yKgtxMsAp3LFVUFR0GOEpN1l6NP2isCFZrhL4H3g4AAAAAABYAFCrxoFS/04Y1hPz9aDkVV4fzm7nGZwAAAAABAPYCAAAAAAEBRJMby2raIWOpsOYK+ahtWogK0q84hT0dmKKg9tR7/kQAAAAAAP3///8CQEIPAAAAAAAiACBbjNO5FM9nzdj6YnPJMDU902R2c0+9liECwt9TuQiAza8/DwAAAAAAIlEgY//uTqfVHmyt+QhuKGolJ5IqqiW4xTrr8y+jKgpif1oCRzBEAiBLtZ31UbfYvqxTNtfZsITKncCbKsoFklkxVEvnHpnYegIgRt0KPIPSf2gDDtkRw7CAUnLHI+qU0yMGaexsPBtxDigBIQPXRURck2JmXyLg2W6edm8nPzJg3qOcina/oF3SaE3cz2YAAAABASuvPw8AAAAAACJRIGP/7k6n1R5srfkIbihqJSeSKqoluMU66/MvoyoKYn9aAAAA",
|
||||
"estimated_added_weight": 172,
|
||||
"outnum": 1
|
||||
}
|
||||
],
|
||||
"author": [
|
||||
"Dusty <<@dusty_daemon>> is mainly responsible."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-fundpsbt(7)",
|
||||
"lightning-utxopsbt(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
235
doc/schemas/lightning-autoclean-once.json
Normal file
235
doc/schemas/lightning-autoclean-once.json
Normal file
|
@ -0,0 +1,235 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"rpc": "autoclean-once",
|
||||
"title": "A single deletion of old invoices/payments/forwards",
|
||||
"description": [
|
||||
"The **autoclean-once** RPC command tell the `autoclean` plugin to do a single sweep to delete old entries. This is a manual alternative (or addition) to the various `autoclean-...-age` parameters which cause autoclean to run once per hour: see lightningd-config(5)."
|
||||
],
|
||||
"request": {
|
||||
"required": [
|
||||
"subsystem",
|
||||
"age"
|
||||
],
|
||||
"properties": {
|
||||
"subsystem": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"succeededforwards",
|
||||
"failedforwards",
|
||||
"succeededpays",
|
||||
"failedpays",
|
||||
"paidinvoices",
|
||||
"expiredinvoices"
|
||||
],
|
||||
"description": [
|
||||
"What subsystem to clean. Currently supported subsystems are:",
|
||||
" * `failedforwards`: routed payments which did not succeed (`failed` or `local_failed` in listforwards `status`).",
|
||||
" * `succeededforwards`: routed payments which succeeded (`settled` in listforwards `status`).",
|
||||
" * `failedpays`: payment attempts which did not succeed (`failed` in listpays `status`).",
|
||||
" * `succeededpays`: payment attempts which succeeded (`complete` in listpays `status`).",
|
||||
" * `expiredinvoices`: invoices which were not paid (and cannot be) (`expired` in listinvoices `status`).",
|
||||
" * `paidinvoices`: invoices which were paid (`paid` in listinvoices `status)."
|
||||
]
|
||||
},
|
||||
"age": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"Non-zero number in seconds. How many seconds old an entry must be to delete it."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"autoclean"
|
||||
],
|
||||
"properties": {
|
||||
"autoclean": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"succeededforwards": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"cleaned",
|
||||
"uncleaned"
|
||||
],
|
||||
"properties": {
|
||||
"cleaned": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"Total number of deletions done this run."
|
||||
]
|
||||
},
|
||||
"uncleaned": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"The total number of entries *not* deleted this run."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"failedforwards": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"cleaned",
|
||||
"uncleaned"
|
||||
],
|
||||
"properties": {
|
||||
"cleaned": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"Total number of deletions done this run."
|
||||
]
|
||||
},
|
||||
"uncleaned": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"The total number of entries *not* deleted this run."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"succeededpays": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"cleaned",
|
||||
"uncleaned"
|
||||
],
|
||||
"properties": {
|
||||
"cleaned": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"Total number of deletions done this run."
|
||||
]
|
||||
},
|
||||
"uncleaned": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"The total number of entries *not* deleted this run."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"failedpays": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"cleaned",
|
||||
"uncleaned"
|
||||
],
|
||||
"properties": {
|
||||
"cleaned": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"Total number of deletions done this run."
|
||||
]
|
||||
},
|
||||
"uncleaned": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"The total number of entries *not* deleted this run."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"paidinvoices": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"cleaned",
|
||||
"uncleaned"
|
||||
],
|
||||
"properties": {
|
||||
"cleaned": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"Total number of deletions done this run."
|
||||
]
|
||||
},
|
||||
"uncleaned": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"The total number of entries *not* deleted this run."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"expiredinvoices": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"cleaned",
|
||||
"uncleaned"
|
||||
],
|
||||
"properties": {
|
||||
"cleaned": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"Total number of deletions done this run."
|
||||
]
|
||||
},
|
||||
"uncleaned": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"The total number of entries *not* deleted this run."
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:autoclean-once#1",
|
||||
"method": "autoclean-once",
|
||||
"params": [
|
||||
"failedpays",
|
||||
1
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "example:autoclean-once#2",
|
||||
"method": "autoclean-once",
|
||||
"params": [
|
||||
"succeededpays",
|
||||
1
|
||||
]
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"autoclean": {
|
||||
"failedpays": {
|
||||
"cleaned": 1,
|
||||
"uncleaned": 1
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"autoclean": {
|
||||
"succeededpays": {
|
||||
"cleaned": 1,
|
||||
"uncleaned": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"author": [
|
||||
"Rusty Russell <<rusty@rustcorp.com.au>> is mainly responsible."
|
||||
],
|
||||
"see_also": [
|
||||
"lightningd-config(5)",
|
||||
"lightning-autoclean-status(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
484
doc/schemas/lightning-autoclean-status.json
Normal file
484
doc/schemas/lightning-autoclean-status.json
Normal file
|
@ -0,0 +1,484 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"rpc": "autoclean-status",
|
||||
"title": "Examine auto-delete of old invoices/payments/forwards",
|
||||
"description": [
|
||||
"The **autoclean-status** RPC command tells you about the status of the autclean plugin, optionally for only one subsystem."
|
||||
],
|
||||
"request": {
|
||||
"required": [],
|
||||
"properties": {
|
||||
"subsystem": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"succeededforwards",
|
||||
"failedforwards",
|
||||
"succeededpays",
|
||||
"failedpays",
|
||||
"paidinvoices",
|
||||
"expiredinvoices"
|
||||
],
|
||||
"description": [
|
||||
"What subsystem to ask about. Currently supported subsystems are:",
|
||||
" * `failedforwards`: routed payments which did not succeed (`failed` or `local_failed` in listforwards `status`).",
|
||||
" * `succeededforwards`: routed payments which succeeded (`settled` in listforwards `status`).",
|
||||
" * `failedpays`: payment attempts which did not succeed (`failed` in listpays `status`).",
|
||||
" * `succeededpays`: payment attempts which succeeded (`complete` in listpays `status`).",
|
||||
" * `expiredinvoices`: invoices which were not paid (and cannot be) (`expired` in listinvoices `status`).",
|
||||
" * `paidinvoices`: invoices which were paid (`paid` in listinvoices `status)."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"autoclean"
|
||||
],
|
||||
"properties": {
|
||||
"autoclean": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"succeededforwards": {
|
||||
"type": "object",
|
||||
"additionalProperties": true,
|
||||
"required": [
|
||||
"enabled",
|
||||
"cleaned"
|
||||
],
|
||||
"properties": {
|
||||
"enabled": {
|
||||
"type": "boolean",
|
||||
"description": [
|
||||
"Whether autocleaning is enabled for successful listforwards."
|
||||
]
|
||||
},
|
||||
"cleaned": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"Total number of deletions done (ever)."
|
||||
]
|
||||
}
|
||||
},
|
||||
"if": {
|
||||
"properties": {
|
||||
"enabled": {
|
||||
"type": "boolean",
|
||||
"enum": [
|
||||
true
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"then": {
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"enabled",
|
||||
"age",
|
||||
"cleaned"
|
||||
],
|
||||
"properties": {
|
||||
"enabled": {},
|
||||
"cleaned": {},
|
||||
"age": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"Age (in seconds) to delete successful listforwards."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"else": {
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"enabled",
|
||||
"cleaned"
|
||||
],
|
||||
"properties": {
|
||||
"enabled": {},
|
||||
"cleaned": {}
|
||||
}
|
||||
}
|
||||
},
|
||||
"failedforwards": {
|
||||
"type": "object",
|
||||
"additionalProperties": true,
|
||||
"required": [
|
||||
"enabled",
|
||||
"cleaned"
|
||||
],
|
||||
"properties": {
|
||||
"enabled": {
|
||||
"type": "boolean",
|
||||
"description": [
|
||||
"Whether autocleaning is enabled for failed listforwards."
|
||||
]
|
||||
},
|
||||
"cleaned": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"Total number of deletions done (ever)."
|
||||
]
|
||||
}
|
||||
},
|
||||
"if": {
|
||||
"properties": {
|
||||
"enabled": {
|
||||
"type": "boolean",
|
||||
"enum": [
|
||||
true
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"then": {
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"enabled",
|
||||
"age",
|
||||
"cleaned"
|
||||
],
|
||||
"properties": {
|
||||
"enabled": {},
|
||||
"cleaned": {},
|
||||
"age": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"Age (in seconds) to delete failed listforwards."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"else": {
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"enabled",
|
||||
"cleaned"
|
||||
],
|
||||
"properties": {
|
||||
"enabled": {},
|
||||
"cleaned": {}
|
||||
}
|
||||
}
|
||||
},
|
||||
"succeededpays": {
|
||||
"type": "object",
|
||||
"additionalProperties": true,
|
||||
"required": [
|
||||
"enabled",
|
||||
"cleaned"
|
||||
],
|
||||
"properties": {
|
||||
"enabled": {
|
||||
"type": "boolean",
|
||||
"description": [
|
||||
"Whether autocleaning is enabled for successful listpays/listsendpays."
|
||||
]
|
||||
},
|
||||
"cleaned": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"Total number of deletions done (ever)."
|
||||
]
|
||||
}
|
||||
},
|
||||
"if": {
|
||||
"properties": {
|
||||
"enabled": {
|
||||
"type": "boolean",
|
||||
"enum": [
|
||||
true
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"then": {
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"enabled",
|
||||
"age",
|
||||
"cleaned"
|
||||
],
|
||||
"properties": {
|
||||
"enabled": {},
|
||||
"cleaned": {},
|
||||
"age": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"Age (in seconds) to delete successful listpays/listsendpays."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"else": {
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"enabled",
|
||||
"cleaned"
|
||||
],
|
||||
"properties": {
|
||||
"enabled": {},
|
||||
"cleaned": {}
|
||||
}
|
||||
}
|
||||
},
|
||||
"failedpays": {
|
||||
"type": "object",
|
||||
"additionalProperties": true,
|
||||
"required": [
|
||||
"enabled",
|
||||
"cleaned"
|
||||
],
|
||||
"properties": {
|
||||
"enabled": {
|
||||
"type": "boolean",
|
||||
"description": [
|
||||
"Whether autocleaning is enabled for failed listpays/listsendpays."
|
||||
]
|
||||
},
|
||||
"cleaned": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"Total number of deletions done (ever)."
|
||||
]
|
||||
}
|
||||
},
|
||||
"if": {
|
||||
"properties": {
|
||||
"enabled": {
|
||||
"type": "boolean",
|
||||
"enum": [
|
||||
true
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"then": {
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"enabled",
|
||||
"age",
|
||||
"cleaned"
|
||||
],
|
||||
"properties": {
|
||||
"enabled": {},
|
||||
"cleaned": {},
|
||||
"age": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"Age (in seconds) to delete failed listpays/listsendpays."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"else": {
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"enabled",
|
||||
"cleaned"
|
||||
],
|
||||
"properties": {
|
||||
"enabled": {},
|
||||
"cleaned": {}
|
||||
}
|
||||
}
|
||||
},
|
||||
"paidinvoices": {
|
||||
"type": "object",
|
||||
"additionalProperties": true,
|
||||
"required": [
|
||||
"enabled",
|
||||
"cleaned"
|
||||
],
|
||||
"properties": {
|
||||
"enabled": {
|
||||
"type": "boolean",
|
||||
"description": [
|
||||
"Whether autocleaning is enabled for paid listinvoices."
|
||||
]
|
||||
},
|
||||
"cleaned": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"Total number of deletions done (ever)."
|
||||
]
|
||||
}
|
||||
},
|
||||
"if": {
|
||||
"properties": {
|
||||
"enabled": {
|
||||
"type": "boolean",
|
||||
"enum": [
|
||||
true
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"then": {
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"enabled",
|
||||
"age",
|
||||
"cleaned"
|
||||
],
|
||||
"properties": {
|
||||
"enabled": {},
|
||||
"cleaned": {},
|
||||
"age": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"Age (in seconds) to paid listinvoices."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"else": {
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"enabled",
|
||||
"cleaned"
|
||||
],
|
||||
"properties": {
|
||||
"enabled": {},
|
||||
"cleaned": {}
|
||||
}
|
||||
}
|
||||
},
|
||||
"expiredinvoices": {
|
||||
"type": "object",
|
||||
"additionalProperties": true,
|
||||
"required": [
|
||||
"enabled",
|
||||
"cleaned"
|
||||
],
|
||||
"properties": {
|
||||
"enabled": {
|
||||
"type": "boolean",
|
||||
"description": [
|
||||
"Whether autocleaning is enabled for expired (unpaid) listinvoices."
|
||||
]
|
||||
},
|
||||
"cleaned": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"Total number of deletions done (ever)."
|
||||
]
|
||||
}
|
||||
},
|
||||
"if": {
|
||||
"properties": {
|
||||
"enabled": {
|
||||
"type": "boolean",
|
||||
"enum": [
|
||||
true
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"then": {
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"enabled",
|
||||
"age",
|
||||
"cleaned"
|
||||
],
|
||||
"properties": {
|
||||
"enabled": {},
|
||||
"cleaned": {},
|
||||
"age": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"Age (in seconds) to expired listinvoices."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"else": {
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"enabled",
|
||||
"cleaned"
|
||||
],
|
||||
"properties": {
|
||||
"enabled": {},
|
||||
"cleaned": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"pre_return_value_notes": [
|
||||
"Note that the ages parameters are set by various `autoclean-...-age` parameters in your configuration: see lightningd-config(5)."
|
||||
]
|
||||
},
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:autoclean-status#1",
|
||||
"method": "autoclean-status",
|
||||
"params": {
|
||||
"subsystem": "expiredinvoices"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "example:autoclean-status#2",
|
||||
"method": "autoclean-status",
|
||||
"params": {
|
||||
"subsystem": null
|
||||
}
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"autoclean": {
|
||||
"expiredinvoices": {
|
||||
"enabled": false,
|
||||
"cleaned": 0
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"autoclean": {
|
||||
"succeededforwards": {
|
||||
"enabled": false,
|
||||
"cleaned": 0
|
||||
},
|
||||
"failedforwards": {
|
||||
"enabled": false,
|
||||
"cleaned": 0
|
||||
},
|
||||
"succeededpays": {
|
||||
"enabled": false,
|
||||
"cleaned": 0
|
||||
},
|
||||
"failedpays": {
|
||||
"enabled": false,
|
||||
"cleaned": 0
|
||||
},
|
||||
"paidinvoices": {
|
||||
"enabled": false,
|
||||
"cleaned": 0
|
||||
},
|
||||
"expiredinvoices": {
|
||||
"enabled": true,
|
||||
"age": 2,
|
||||
"cleaned": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"author": [
|
||||
"Rusty Russell <<rusty@rustcorp.com.au>> is mainly responsible."
|
||||
],
|
||||
"see_also": [
|
||||
"lightningd-config(5)",
|
||||
"lightning-listinvoices(7)",
|
||||
"lightning-listpays(7)",
|
||||
"lightning-listforwards(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
120
doc/schemas/lightning-autocleaninvoice.json
Normal file
120
doc/schemas/lightning-autocleaninvoice.json
Normal file
|
@ -0,0 +1,120 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"rpc": "setchannel",
|
||||
"title": "Command for configuring fees / htlc range advertized for a channel",
|
||||
"description": [],
|
||||
"request": {
|
||||
"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."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"enabled"
|
||||
],
|
||||
"properties": {
|
||||
"enabled": {
|
||||
"type": "boolean",
|
||||
"description": [
|
||||
"Whether invoice autocleaning is active."
|
||||
]
|
||||
}
|
||||
},
|
||||
"allOf": [
|
||||
{
|
||||
"if": {
|
||||
"properties": {
|
||||
"enabled": {
|
||||
"type": "boolean",
|
||||
"enum": [
|
||||
true
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"then": {
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"expired_by",
|
||||
"cycle_seconds"
|
||||
],
|
||||
"properties": {
|
||||
"enabled": {},
|
||||
"expired_by": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"How long an invoice must be expired (seconds) before we delete it."
|
||||
]
|
||||
},
|
||||
"cycle_seconds": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"How long an invoice must be expired (seconds) before we delete it."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"else": {
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"enabled": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:autocleaninvoice#1",
|
||||
"method": "autocleaninvoice",
|
||||
"params": {
|
||||
"cycle_seconds": 8,
|
||||
"expired_by": 2
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "example:autocleaninvoice#2",
|
||||
"method": "autocleaninvoice",
|
||||
"params": {
|
||||
"cycle_seconds": 1,
|
||||
"expired_by": 1
|
||||
}
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"enabled": true,
|
||||
"cycle_seconds": 8,
|
||||
"expired_by": 2
|
||||
},
|
||||
{
|
||||
"enabled": true,
|
||||
"cycle_seconds": 1,
|
||||
"expired_by": 1
|
||||
}
|
||||
],
|
||||
"author": [
|
||||
"Rusty Russell <<rusty@rustcorp.com.au>> is mainly responsible."
|
||||
],
|
||||
"see_also": [
|
||||
"lightningd-config(5)",
|
||||
"lightning-listinvoices(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
50
doc/schemas/lightning-batching.json
Normal file
50
doc/schemas/lightning-batching.json
Normal file
|
@ -0,0 +1,50 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"rpc": "batching",
|
||||
"title": "Command to allow database batching.",
|
||||
"description": [
|
||||
"The **batching** RPC command allows (but does not guarantee!) database commitments to be deferred when multiple commands are issued on this RPC connection. This is only useful if many commands are being given at once, in which case it can offer a performance improvement (the cost being that if there is a crash, it's unclear how many of the commands will have been persisted)."
|
||||
],
|
||||
"request": {
|
||||
"required": [
|
||||
"enable"
|
||||
],
|
||||
"properties": {
|
||||
"enable": {
|
||||
"type": "boolean",
|
||||
"description": [
|
||||
"Whether to enable or disable transaction batching."
|
||||
],
|
||||
"default": "False"
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"properties": {}
|
||||
},
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:batching#1",
|
||||
"method": "batching",
|
||||
"params": {
|
||||
"enable": true
|
||||
}
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{}
|
||||
],
|
||||
"errors": [
|
||||
"On failure, one of the following error codes may be returned:",
|
||||
"",
|
||||
"- -32602: Error in given parameters."
|
||||
],
|
||||
"author": [
|
||||
"Rusty Russell <<rusty@blockstream.com>> wrote the initial version of this man page."
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
262
doc/schemas/lightning-bkpr-channelsapy.json
Normal file
262
doc/schemas/lightning-bkpr-channelsapy.json
Normal file
|
@ -0,0 +1,262 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"rpc": "bkpr-channelsapy",
|
||||
"title": "Command to list stats on channel earnings",
|
||||
"description": [
|
||||
"The **bkpr-channelsapy** RPC command lists stats on routing income, leasing income, and various calculated APYs for channel routed funds."
|
||||
],
|
||||
"request": {
|
||||
"required": [],
|
||||
"properties": {
|
||||
"start_time": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"UNIX timestamp (in seconds) to filter events after the provided timestamp."
|
||||
],
|
||||
"default": "zero"
|
||||
},
|
||||
"end_time": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"UNIX timestamp (in seconds) to filter events up to and at the provided timestamp."
|
||||
],
|
||||
"default": "max-int"
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"channels_apy"
|
||||
],
|
||||
"properties": {
|
||||
"channels_apy": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"account",
|
||||
"routed_out_msat",
|
||||
"routed_in_msat",
|
||||
"lease_fee_paid_msat",
|
||||
"lease_fee_earned_msat",
|
||||
"pushed_out_msat",
|
||||
"pushed_in_msat",
|
||||
"our_start_balance_msat",
|
||||
"channel_start_balance_msat",
|
||||
"fees_out_msat",
|
||||
"utilization_out",
|
||||
"utilization_in",
|
||||
"apy_out",
|
||||
"apy_in",
|
||||
"apy_total"
|
||||
],
|
||||
"properties": {
|
||||
"account": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The account name. If the account is a channel, the channel_id. The 'net' entry is the rollup of all channel accounts."
|
||||
]
|
||||
},
|
||||
"routed_out_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"Sats routed (outbound)."
|
||||
]
|
||||
},
|
||||
"routed_in_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"Sats routed (inbound)."
|
||||
]
|
||||
},
|
||||
"lease_fee_paid_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"Sats paid for leasing inbound (liquidity ads)."
|
||||
]
|
||||
},
|
||||
"lease_fee_earned_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"Sats earned for leasing outbound (liquidity ads)."
|
||||
]
|
||||
},
|
||||
"pushed_out_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"Sats pushed to peer at open."
|
||||
]
|
||||
},
|
||||
"pushed_in_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"Sats pushed in from peer at open."
|
||||
]
|
||||
},
|
||||
"our_start_balance_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"Starting balance in channel at funding. Note that if our start balance is zero, any _initial field will be omitted (can't divide by zero)."
|
||||
]
|
||||
},
|
||||
"channel_start_balance_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"Total starting balance at funding."
|
||||
]
|
||||
},
|
||||
"fees_out_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"Fees earned on routed outbound."
|
||||
]
|
||||
},
|
||||
"fees_in_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"Fees earned on routed inbound."
|
||||
]
|
||||
},
|
||||
"utilization_out": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Sats routed outbound / total start balance."
|
||||
]
|
||||
},
|
||||
"utilization_out_initial": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Sats routed outbound / our start balance."
|
||||
]
|
||||
},
|
||||
"utilization_in": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Sats routed inbound / total start balance."
|
||||
]
|
||||
},
|
||||
"utilization_in_initial": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Sats routed inbound / our start balance."
|
||||
]
|
||||
},
|
||||
"apy_out": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Fees earned on outbound routed payments / total start balance for the length of time this channel has been open amortized to a year (APY)."
|
||||
]
|
||||
},
|
||||
"apy_out_initial": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Fees earned on outbound routed payments / our start balance for the length of time this channel has been open amortized to a year (APY)."
|
||||
]
|
||||
},
|
||||
"apy_in": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Fees earned on inbound routed payments / total start balance for the length of time this channel has been open amortized to a year (APY)."
|
||||
]
|
||||
},
|
||||
"apy_in_initial": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Fees earned on inbound routed payments / our start balance for the length of time this channel has been open amortized to a year (APY)."
|
||||
]
|
||||
},
|
||||
"apy_total": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Total fees earned on routed payments / total start balance for the length of time this channel has been open amortized to a year (APY)."
|
||||
]
|
||||
},
|
||||
"apy_total_initial": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Total fees earned on routed payments / our start balance for the length of time this channel has been open amortized to a year (APY)."
|
||||
]
|
||||
},
|
||||
"apy_lease": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Lease fees earned over total amount leased for the lease term, amortized to a year (APY). Only appears if channel was leased out by us."
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:bkpr-channelsapy#1",
|
||||
"method": "bkpr-channelsapy",
|
||||
"params": "{}"
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"channels_apy": [
|
||||
{
|
||||
"account": "e41b2ec83e9139a9fd8f1d89b01e5d7df73099494e6b91504c39445e37485b0d",
|
||||
"routed_out_msat": 1431440,
|
||||
"routed_in_msat": 0,
|
||||
"lease_fee_paid_msat": 0,
|
||||
"lease_fee_earned_msat": 0,
|
||||
"pushed_out_msat": 0,
|
||||
"pushed_in_msat": 0,
|
||||
"our_start_balance_msat": 1000000000,
|
||||
"channel_start_balance_msat": 1000000000,
|
||||
"fees_out_msat": 0,
|
||||
"fees_in_msat": 0,
|
||||
"utilization_out": "0.1431%",
|
||||
"utilization_out_initial": "0.1431%",
|
||||
"utilization_in": "0.0000%",
|
||||
"apy_out": "0.0000%",
|
||||
"apy_out_initial": "0.0000%",
|
||||
"apy_in": "0.0000%",
|
||||
"apy_total": "0.0000%",
|
||||
"apy_total_initial": "0.0000%"
|
||||
},
|
||||
{
|
||||
"account": "net",
|
||||
"routed_out_msat": 1431440,
|
||||
"routed_in_msat": 0,
|
||||
"lease_fee_paid_msat": 0,
|
||||
"lease_fee_earned_msat": 0,
|
||||
"pushed_out_msat": 0,
|
||||
"pushed_in_msat": 0,
|
||||
"our_start_balance_msat": 1000000000,
|
||||
"channel_start_balance_msat": 1000000000,
|
||||
"fees_out_msat": 0,
|
||||
"fees_in_msat": 0,
|
||||
"utilization_out": "0.1431%",
|
||||
"utilization_out_initial": "0.1431%",
|
||||
"utilization_in": "0.0000%",
|
||||
"apy_out": "0.0000%",
|
||||
"apy_out_initial": "0.0000%",
|
||||
"apy_in": "0.0000%",
|
||||
"apy_total": "0.0000%",
|
||||
"apy_total_initial": "0.0000%"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"author": [
|
||||
"Lisa Neigut <<niftynei@gmail.com>> is mainly responsible."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-bkpr-listincome(7)",
|
||||
"lightning-bkpr-listfunds(7)",
|
||||
"lightning-bkpr-listaccountevents(7)",
|
||||
"lightning-bkpr-dumpincomecsv(7)",
|
||||
"lightning-listpeers(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
105
doc/schemas/lightning-bkpr-dumpincomecsv.json
Normal file
105
doc/schemas/lightning-bkpr-dumpincomecsv.json
Normal file
|
@ -0,0 +1,105 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"rpc": "bkpr-dumpincomecsv",
|
||||
"title": "Command to emit a CSV of income events",
|
||||
"description": [
|
||||
"The **bkpr-dumpincomcsv** RPC command writes a CSV file to disk at *csv_file* location. This is a formatted output of the **listincome** RPC command."
|
||||
],
|
||||
"request": {
|
||||
"required": [
|
||||
"csv_format"
|
||||
],
|
||||
"properties": {
|
||||
"csv_format": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"CSV format to use. See RETURN VALUE for options."
|
||||
]
|
||||
},
|
||||
"csv_file": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"On-disk destination of the generated CSV file."
|
||||
]
|
||||
},
|
||||
"consolidate_fees": {
|
||||
"type": "boolean",
|
||||
"description": [
|
||||
"If true, we emit a single, consolidated event for any onchain-fees for a txid and account. Otherwise, events for every update to the onchain fee calculation for this account and txid will be printed. Note that this means that the events emitted are non-stable, i.e. calling **dumpincomecsv** twice may result in different onchain fee events being emitted, depending on how much information we've logged for that transaction."
|
||||
],
|
||||
"default": "True"
|
||||
},
|
||||
"start_time": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"UNIX timestamp (in seconds) that filters events after the provided timestamp."
|
||||
],
|
||||
"default": "zero"
|
||||
},
|
||||
"end_time": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"UNIX timestamp (in seconds) that filters events up to and at the provided timestamp."
|
||||
],
|
||||
"default": "max-int"
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"csv_file",
|
||||
"csv_format"
|
||||
],
|
||||
"properties": {
|
||||
"csv_file": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"File that the csv was generated to."
|
||||
]
|
||||
},
|
||||
"csv_format": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"cointracker",
|
||||
"koinly",
|
||||
"harmony",
|
||||
"quickbooks"
|
||||
],
|
||||
"description": [
|
||||
"Format to print csv as."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:bkpr-dumpincomecsv#1",
|
||||
"method": "bkpr-dumpincomecsv",
|
||||
"params": [
|
||||
"koinly",
|
||||
"koinly.csv"
|
||||
]
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"csv_file": "koinly.csv",
|
||||
"csv_format": "koinly"
|
||||
}
|
||||
],
|
||||
"author": [
|
||||
"Lisa Neigut <<niftynei@gmail.com>> is mainly responsible."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-bkpr-listincome(7)",
|
||||
"lightning-bkpr-listfunds(7)",
|
||||
"lightning-bkpr-listaccountevents(7)",
|
||||
"lightning-bkpr-channelsapy(7)",
|
||||
"lightning-listpeers(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
238
doc/schemas/lightning-bkpr-inspect.json
Normal file
238
doc/schemas/lightning-bkpr-inspect.json
Normal file
|
@ -0,0 +1,238 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"rpc": "bkpr-inspect",
|
||||
"title": "Command to show onchain footprint of a channel",
|
||||
"description": [
|
||||
"The **bkpr-inspect** RPC command lists all known on-chain transactions and associated events for the provided account. Useful for inspecting unilateral closes for a given channel account. Only valid for channel accounts."
|
||||
],
|
||||
"request": {
|
||||
"required": [
|
||||
"account"
|
||||
],
|
||||
"properties": {
|
||||
"account": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Channel account to inspect."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"txs"
|
||||
],
|
||||
"properties": {
|
||||
"txs": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"txid",
|
||||
"fees_paid_msat",
|
||||
"outputs"
|
||||
],
|
||||
"properties": {
|
||||
"txid": {
|
||||
"type": "txid",
|
||||
"description": [
|
||||
"Transaction id."
|
||||
]
|
||||
},
|
||||
"blockheight": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"Blockheight of transaction."
|
||||
]
|
||||
},
|
||||
"fees_paid_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"Amount paid in sats for this tx."
|
||||
]
|
||||
},
|
||||
"outputs": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"account",
|
||||
"outnum",
|
||||
"output_value_msat",
|
||||
"currency"
|
||||
],
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"account": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Account this output affected."
|
||||
]
|
||||
},
|
||||
"outnum": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"Index of output."
|
||||
]
|
||||
},
|
||||
"output_value_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"Value of the output."
|
||||
]
|
||||
},
|
||||
"currency": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Human-readable bech32 part for this coin type."
|
||||
]
|
||||
},
|
||||
"credit_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"Amount credited to account."
|
||||
]
|
||||
},
|
||||
"debit_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"Amount debited from account."
|
||||
]
|
||||
},
|
||||
"originating_account": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Account this output originated from."
|
||||
]
|
||||
},
|
||||
"output_tag": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Description of output creation event."
|
||||
]
|
||||
},
|
||||
"spend_tag": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Description of output spend event."
|
||||
]
|
||||
},
|
||||
"spending_txid": {
|
||||
"type": "txid",
|
||||
"description": [
|
||||
"Transaction this output was spent in."
|
||||
]
|
||||
},
|
||||
"payment_id": {
|
||||
"type": "hex",
|
||||
"description": [
|
||||
"Lightning payment identifier. For an htlc, this will be the preimage."
|
||||
]
|
||||
}
|
||||
},
|
||||
"allOf": [
|
||||
{
|
||||
"if": {
|
||||
"required": [
|
||||
"credit_msat"
|
||||
]
|
||||
},
|
||||
"then": {
|
||||
"required": [
|
||||
"output_tag"
|
||||
],
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"account": {},
|
||||
"outnum": {},
|
||||
"output_value_msat": {},
|
||||
"currency": {},
|
||||
"credit_msat": {},
|
||||
"originating_account": {},
|
||||
"debit_msat": {},
|
||||
"output_tag": {},
|
||||
"spend_tag": {},
|
||||
"spending_txid": {},
|
||||
"payment_id": {}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"if": {
|
||||
"required": [
|
||||
"spending_txid"
|
||||
]
|
||||
},
|
||||
"then": {
|
||||
"required": [
|
||||
"spend_tag",
|
||||
"debit_msat"
|
||||
],
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"account": {},
|
||||
"outnum": {},
|
||||
"output_value_msat": {},
|
||||
"currency": {},
|
||||
"credit_msat": {},
|
||||
"originating_account": {},
|
||||
"debit_msat": {},
|
||||
"output_tag": {},
|
||||
"spend_tag": {},
|
||||
"spending_txid": {},
|
||||
"payment_id": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:bkpr-inspect#1",
|
||||
"method": "bkpr-inspect",
|
||||
"params": [
|
||||
"f30a7bab1ec077622d8fe877634bc6dd38bb08122ad49606199c565e0383b2ab"
|
||||
]
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"txs": [
|
||||
{
|
||||
"txid": "abb283035e569c190696d42a1208bb38ddc64b6377e88f2d6277c01eab7b0af3",
|
||||
"fees_paid_msat": 0,
|
||||
"outputs": [
|
||||
{
|
||||
"account": "f30a7bab1ec077622d8fe877634bc6dd38bb08122ad49606199c565e0383b2ab",
|
||||
"outnum": 0,
|
||||
"output_tag": "channel_proposed",
|
||||
"output_value_msat": 996363000,
|
||||
"credit_msat": 996363000,
|
||||
"currency": "bcrt"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"author": [
|
||||
"Lisa Neigut <<niftynei@gmail.com>> is mainly responsible."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-listbalances(7)",
|
||||
"lightning-listfunds(7)",
|
||||
"lightning-listpeers(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
481
doc/schemas/lightning-bkpr-listaccountevents.json
Normal file
481
doc/schemas/lightning-bkpr-listaccountevents.json
Normal file
|
@ -0,0 +1,481 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"rpc": "bkpr-listaccountevents",
|
||||
"title": "Command for listing recorded bookkeeping events",
|
||||
"description": [
|
||||
"The **bkpr-listaccountevents** RPC command is a list of all bookkeeping events that have been recorded for this node.",
|
||||
"",
|
||||
"If the optional parameter **account** is set, we only emit events for the specified account, if exists.",
|
||||
"",
|
||||
"Note that the type **onchain_fees** that are emitted are of opposite credit/debit than as they appear in **listincome**, as **listincome** shows all events from the perspective of the node, whereas **listaccountevents** just dumps the event data as we've got it. Onchain fees are updated/recorded as we get more information about input and output spends -- the total onchain fees that were recorded for a transaction for an account can be found by summing all onchain fee events and taking the difference between the **credit_msat** and **debit_msat** for these events. We do this so that successive calls to **listaccountevents** always produce the same list of events -- no previously emitted event will be subsequently updated, rather we add a new event to the list."
|
||||
],
|
||||
"request": {
|
||||
"required": [],
|
||||
"properties": {
|
||||
"account": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Receive events for the specified account."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"events"
|
||||
],
|
||||
"properties": {
|
||||
"events": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": true,
|
||||
"required": [
|
||||
"account",
|
||||
"type",
|
||||
"tag",
|
||||
"credit_msat",
|
||||
"debit_msat",
|
||||
"currency",
|
||||
"timestamp"
|
||||
],
|
||||
"properties": {
|
||||
"account": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The account name. If the account is a channel, the channel_id."
|
||||
]
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"onchain_fee",
|
||||
"chain",
|
||||
"channel"
|
||||
],
|
||||
"description": [
|
||||
"Coin movement type."
|
||||
]
|
||||
},
|
||||
"tag": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Description of movement."
|
||||
]
|
||||
},
|
||||
"credit_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"Amount credited."
|
||||
]
|
||||
},
|
||||
"debit_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"Amount debited."
|
||||
]
|
||||
},
|
||||
"currency": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Human-readable bech32 part for this coin type."
|
||||
]
|
||||
},
|
||||
"timestamp": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"Timestamp this event was recorded by the node. For consolidated events such as onchain_fees, the most recent timestamp."
|
||||
]
|
||||
}
|
||||
},
|
||||
"allOf": [
|
||||
{
|
||||
"if": {
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"chain"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"then": {
|
||||
"properties": {
|
||||
"account": {},
|
||||
"type": {},
|
||||
"tag": {},
|
||||
"credit_msat": {},
|
||||
"debit_msat": {},
|
||||
"currency": {},
|
||||
"timestamp": {},
|
||||
"outpoint": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The txid:outnum for this event."
|
||||
]
|
||||
},
|
||||
"blockheight": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"For chain events, blockheight this occured at."
|
||||
]
|
||||
},
|
||||
"origin": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The account this movement originated from."
|
||||
]
|
||||
},
|
||||
"payment_id": {
|
||||
"type": "hex",
|
||||
"description": [
|
||||
"Lightning payment identifier. For an htlc, this will be the preimage."
|
||||
]
|
||||
},
|
||||
"txid": {
|
||||
"type": "txid",
|
||||
"description": [
|
||||
"The txid of the transaction that created this event."
|
||||
]
|
||||
},
|
||||
"description": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The description of this event."
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"outpoint",
|
||||
"blockheight"
|
||||
],
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"if": {
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"onchain_fee"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"then": {
|
||||
"properties": {
|
||||
"account": {},
|
||||
"type": {},
|
||||
"tag": {},
|
||||
"credit_msat": {},
|
||||
"debit_msat": {},
|
||||
"currency": {},
|
||||
"timestamp": {},
|
||||
"description": {},
|
||||
"txid": {
|
||||
"type": "txid",
|
||||
"description": [
|
||||
"The txid of the transaction that created this event."
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"txid"
|
||||
],
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"if": {
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"channel"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"then": {
|
||||
"properties": {
|
||||
"account": {},
|
||||
"type": {},
|
||||
"tag": {},
|
||||
"credit_msat": {},
|
||||
"debit_msat": {},
|
||||
"currency": {},
|
||||
"timestamp": {},
|
||||
"description": {},
|
||||
"fees_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"Amount paid in fees."
|
||||
]
|
||||
},
|
||||
"is_rebalance": {
|
||||
"type": "boolean",
|
||||
"description": [
|
||||
"Is this payment part of a rebalance."
|
||||
]
|
||||
},
|
||||
"payment_id": {
|
||||
"type": "hex",
|
||||
"description": [
|
||||
"Lightning payment identifier. For an htlc, this will be the preimage."
|
||||
]
|
||||
},
|
||||
"part_id": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"Counter for multi-part payments."
|
||||
]
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:bkpr-listaccountevents#1",
|
||||
"method": "bkpr-listaccountevents",
|
||||
"params": "{}"
|
||||
},
|
||||
{
|
||||
"id": "example:bkpr-listaccountevents#2",
|
||||
"method": "bkpr-listaccountevents",
|
||||
"params": [
|
||||
"f30a7bab1ec077622d8fe877634bc6dd38bb08122ad49606199c565e0383b2ab"
|
||||
]
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"events": [
|
||||
{
|
||||
"account": "wallet",
|
||||
"type": "channel",
|
||||
"tag": "journal_entry",
|
||||
"credit_msat": 0,
|
||||
"debit_msat": 0,
|
||||
"currency": "bcrt",
|
||||
"timestamp": 1706152911,
|
||||
"is_rebalance": false
|
||||
},
|
||||
{
|
||||
"account": "wallet",
|
||||
"type": "chain",
|
||||
"tag": "deposit",
|
||||
"credit_msat": 2000000000,
|
||||
"debit_msat": 0,
|
||||
"currency": "bcrt",
|
||||
"outpoint": "7e202b3b1016e8eb6f4e936215ed6b5bdc63c17e6ebb5e6bce2f98e6757ba44c:0",
|
||||
"timestamp": 1706152914,
|
||||
"blockheight": 102
|
||||
},
|
||||
{
|
||||
"account": "wallet",
|
||||
"type": "chain",
|
||||
"tag": "withdrawal",
|
||||
"credit_msat": 0,
|
||||
"debit_msat": 2000000000,
|
||||
"currency": "bcrt",
|
||||
"outpoint": "7e202b3b1016e8eb6f4e936215ed6b5bdc63c17e6ebb5e6bce2f98e6757ba44c:0",
|
||||
"txid": "6c0a3d8f32f556f3bd8b8c85413c4636a9513c6195abb925ea73c47183d40b7b",
|
||||
"timestamp": 1706152921,
|
||||
"blockheight": 103
|
||||
},
|
||||
{
|
||||
"account": "wallet",
|
||||
"type": "chain",
|
||||
"tag": "deposit",
|
||||
"credit_msat": 995073000,
|
||||
"debit_msat": 0,
|
||||
"currency": "bcrt",
|
||||
"outpoint": "6c0a3d8f32f556f3bd8b8c85413c4636a9513c6195abb925ea73c47183d40b7b:1",
|
||||
"timestamp": 1706152921,
|
||||
"blockheight": 103
|
||||
},
|
||||
{
|
||||
"account": "wallet",
|
||||
"type": "onchain_fee",
|
||||
"tag": "onchain_fee",
|
||||
"credit_msat": 1004927000,
|
||||
"debit_msat": 0,
|
||||
"currency": "bcrt",
|
||||
"timestamp": 1706152921,
|
||||
"txid": "6c0a3d8f32f556f3bd8b8c85413c4636a9513c6195abb925ea73c47183d40b7b"
|
||||
},
|
||||
{
|
||||
"account": "wallet",
|
||||
"type": "onchain_fee",
|
||||
"tag": "onchain_fee",
|
||||
"credit_msat": 0,
|
||||
"debit_msat": 1004927000,
|
||||
"currency": "bcrt",
|
||||
"timestamp": 1706152921,
|
||||
"txid": "6c0a3d8f32f556f3bd8b8c85413c4636a9513c6195abb925ea73c47183d40b7b"
|
||||
},
|
||||
{
|
||||
"account": "7b0bd48371c473ea25b9ab95613c51a936463c41858c8bbdf356f5328f3d0a6c",
|
||||
"type": "chain",
|
||||
"tag": "channel_open",
|
||||
"credit_msat": 1000000000,
|
||||
"debit_msat": 0,
|
||||
"currency": "bcrt",
|
||||
"outpoint": "6c0a3d8f32f556f3bd8b8c85413c4636a9513c6195abb925ea73c47183d40b7b:0",
|
||||
"timestamp": 1706152922,
|
||||
"blockheight": 103
|
||||
},
|
||||
{
|
||||
"account": "7b0bd48371c473ea25b9ab95613c51a936463c41858c8bbdf356f5328f3d0a6c",
|
||||
"type": "onchain_fee",
|
||||
"tag": "onchain_fee",
|
||||
"credit_msat": 4927000,
|
||||
"debit_msat": 0,
|
||||
"currency": "bcrt",
|
||||
"timestamp": 1706152922,
|
||||
"txid": "6c0a3d8f32f556f3bd8b8c85413c4636a9513c6195abb925ea73c47183d40b7b"
|
||||
},
|
||||
{
|
||||
"account": "7b0bd48371c473ea25b9ab95613c51a936463c41858c8bbdf356f5328f3d0a6c",
|
||||
"type": "channel",
|
||||
"tag": "invoice",
|
||||
"credit_msat": 0,
|
||||
"debit_msat": 11000000,
|
||||
"currency": "bcrt",
|
||||
"payment_id": "072b1d20f4a7c757a56d5fb10eaed40b58b68849da41fe396cdbd2d81692875a",
|
||||
"part_id": 0,
|
||||
"timestamp": 1706152934,
|
||||
"description": [
|
||||
"XEoCR94SIz6UIRUEkxum."
|
||||
],
|
||||
"is_rebalance": false
|
||||
},
|
||||
{
|
||||
"account": "7b0bd48371c473ea25b9ab95613c51a936463c41858c8bbdf356f5328f3d0a6c",
|
||||
"type": "chain",
|
||||
"tag": "channel_close",
|
||||
"credit_msat": 0,
|
||||
"debit_msat": 989000000,
|
||||
"currency": "bcrt",
|
||||
"outpoint": "6c0a3d8f32f556f3bd8b8c85413c4636a9513c6195abb925ea73c47183d40b7b:0",
|
||||
"txid": "7178638c13a0573f440d9516a23901874b6138338d378b3291cb306c90b3f998",
|
||||
"timestamp": 1706152938,
|
||||
"blockheight": 104
|
||||
},
|
||||
{
|
||||
"account": "external",
|
||||
"origin": "7b0bd48371c473ea25b9ab95613c51a936463c41858c8bbdf356f5328f3d0a6c",
|
||||
"type": "chain",
|
||||
"tag": "to_them",
|
||||
"credit_msat": 10899000,
|
||||
"debit_msat": 0,
|
||||
"currency": "bcrt",
|
||||
"outpoint": "7178638c13a0573f440d9516a23901874b6138338d378b3291cb306c90b3f998:0",
|
||||
"timestamp": 1706152938,
|
||||
"blockheight": 104
|
||||
},
|
||||
{
|
||||
"account": "7b0bd48371c473ea25b9ab95613c51a936463c41858c8bbdf356f5328f3d0a6c",
|
||||
"type": "onchain_fee",
|
||||
"tag": "onchain_fee",
|
||||
"credit_msat": 7967000,
|
||||
"debit_msat": 0,
|
||||
"currency": "bcrt",
|
||||
"timestamp": 1706152938,
|
||||
"txid": "7178638c13a0573f440d9516a23901874b6138338d378b3291cb306c90b3f998"
|
||||
},
|
||||
{
|
||||
"account": "wallet",
|
||||
"type": "chain",
|
||||
"tag": "deposit",
|
||||
"credit_msat": 980912000,
|
||||
"debit_msat": 0,
|
||||
"currency": "bcrt",
|
||||
"outpoint": "85477738281c1afd652c350025f1d28658fe541c83adc9a7d5276c30cf715a11:0",
|
||||
"timestamp": 1706152941,
|
||||
"blockheight": 109
|
||||
},
|
||||
{
|
||||
"account": "7b0bd48371c473ea25b9ab95613c51a936463c41858c8bbdf356f5328f3d0a6c",
|
||||
"type": "chain",
|
||||
"tag": "delayed_to_us",
|
||||
"credit_msat": 981033000,
|
||||
"debit_msat": 0,
|
||||
"currency": "bcrt",
|
||||
"outpoint": "7178638c13a0573f440d9516a23901874b6138338d378b3291cb306c90b3f998:1",
|
||||
"timestamp": 1706152941,
|
||||
"blockheight": 104
|
||||
},
|
||||
{
|
||||
"account": "7b0bd48371c473ea25b9ab95613c51a936463c41858c8bbdf356f5328f3d0a6c",
|
||||
"type": "chain",
|
||||
"tag": "to_wallet",
|
||||
"credit_msat": 0,
|
||||
"debit_msat": 981033000,
|
||||
"currency": "bcrt",
|
||||
"outpoint": "7178638c13a0573f440d9516a23901874b6138338d378b3291cb306c90b3f998:1",
|
||||
"txid": "85477738281c1afd652c350025f1d28658fe541c83adc9a7d5276c30cf715a11",
|
||||
"timestamp": 1706152941,
|
||||
"blockheight": 109
|
||||
},
|
||||
{
|
||||
"account": "7b0bd48371c473ea25b9ab95613c51a936463c41858c8bbdf356f5328f3d0a6c",
|
||||
"type": "onchain_fee",
|
||||
"tag": "onchain_fee",
|
||||
"credit_msat": 121000,
|
||||
"debit_msat": 0,
|
||||
"currency": "bcrt",
|
||||
"timestamp": 1706152941,
|
||||
"txid": "85477738281c1afd652c350025f1d28658fe541c83adc9a7d5276c30cf715a11"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"events": [
|
||||
{
|
||||
"account": "f30a7bab1ec077622d8fe877634bc6dd38bb08122ad49606199c565e0383b2ab",
|
||||
"type": "chain",
|
||||
"tag": "channel_proposed",
|
||||
"credit_msat": 996363000,
|
||||
"debit_msat": 0,
|
||||
"currency": "bcrt",
|
||||
"outpoint": "abb283035e569c190696d42a1208bb38ddc64b6377e88f2d6277c01eab7b0af3:0",
|
||||
"timestamp": 1706246949,
|
||||
"blockheight": 0
|
||||
},
|
||||
{
|
||||
"account": "f30a7bab1ec077622d8fe877634bc6dd38bb08122ad49606199c565e0383b2ab",
|
||||
"type": "channel",
|
||||
"tag": "pushed",
|
||||
"credit_msat": 0,
|
||||
"debit_msat": 20000000,
|
||||
"currency": "bcrt",
|
||||
"timestamp": 1706246949,
|
||||
"is_rebalance": false
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"author": [
|
||||
"Lisa Neigut <<niftynei@gmail.com>> is mainly responsible."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-bkpr-listincome(7)",
|
||||
"lightning-listfunds(7)",
|
||||
"lightning-bkpr-listbalances(7)",
|
||||
"lightning-bkpr-channelsapy(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
160
doc/schemas/lightning-bkpr-listbalances.json
Normal file
160
doc/schemas/lightning-bkpr-listbalances.json
Normal file
|
@ -0,0 +1,160 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"rpc": "bkpr-listbalances",
|
||||
"title": "Command for listing current channel + wallet balances",
|
||||
"description": [
|
||||
"The **bkpr-listbalances** RPC command is a list of all current and historical account balances. An account is either the on-chain *wallet* or a channel balance. Any funds sent to an *external* account will not be accounted for here.",
|
||||
"",
|
||||
"Note that any channel that was recorded will be listed. Closed channel balances will be 0msat."
|
||||
],
|
||||
"request": {
|
||||
"required": [],
|
||||
"properties": {}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"accounts"
|
||||
],
|
||||
"properties": {
|
||||
"accounts": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": true,
|
||||
"required": [
|
||||
"account",
|
||||
"balances"
|
||||
],
|
||||
"properties": {
|
||||
"account": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The account name. If the account is a channel, the channel_id."
|
||||
]
|
||||
},
|
||||
"balances": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"balance_msat",
|
||||
"coin_type"
|
||||
],
|
||||
"properties": {
|
||||
"balance_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"Current account balance."
|
||||
]
|
||||
},
|
||||
"coin_type": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Coin type, same as HRP for bech32."
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"if": {
|
||||
"required": [
|
||||
"peer_id"
|
||||
]
|
||||
},
|
||||
"then": {
|
||||
"required": [
|
||||
"account",
|
||||
"balances",
|
||||
"peer_id",
|
||||
"we_opened",
|
||||
"account_closed",
|
||||
"account_resolved"
|
||||
],
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"account": {},
|
||||
"balances": {},
|
||||
"peer_id": {
|
||||
"type": "pubkey",
|
||||
"description": [
|
||||
"Node id for the peer this account is with."
|
||||
]
|
||||
},
|
||||
"we_opened": {
|
||||
"type": "boolean",
|
||||
"description": [
|
||||
"Did we initiate this account open (open the channel)."
|
||||
]
|
||||
},
|
||||
"account_closed": {
|
||||
"type": "boolean",
|
||||
"description": [
|
||||
"",
|
||||
""
|
||||
]
|
||||
},
|
||||
"account_resolved": {
|
||||
"type": "boolean",
|
||||
"description": [
|
||||
"Has this channel been closed and all outputs resolved?"
|
||||
]
|
||||
},
|
||||
"resolved_at_block": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"Blockheight account resolved on chain."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"else": {
|
||||
"properties": {
|
||||
"account": {},
|
||||
"balances": {}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:bkpr-listbalances#1",
|
||||
"method": "bkpr-listbalances",
|
||||
"params": "{}"
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"accounts": [
|
||||
{
|
||||
"account": "wallet",
|
||||
"balances": [
|
||||
{
|
||||
"balance_msat": 2222222000,
|
||||
"coin_type": "bcrt"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"author": [
|
||||
"Lisa Neigut <<niftynei@gmail.com>> is mainly responsible."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-bkpr-listincome(7)",
|
||||
"lightning-listfunds(7)",
|
||||
"lightning-bkpr-listaccountevents(7)",
|
||||
"lightning-bkpr-channelsapy(7)",
|
||||
"lightning-listpeers(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
210
doc/schemas/lightning-bkpr-listincome.json
Normal file
210
doc/schemas/lightning-bkpr-listincome.json
Normal file
|
@ -0,0 +1,210 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"added": "pre-v0.10.1",
|
||||
"rpc": "bkpr-listincome",
|
||||
"title": "Command for listing all income impacting events",
|
||||
"description": [
|
||||
"The **bkpr-listincome** RPC command is a list of all income impacting events that the bookkeeper plugin has recorded for this node."
|
||||
],
|
||||
"request": {
|
||||
"required": [],
|
||||
"properties": {
|
||||
"consolidate_fees": {
|
||||
"type": "boolean",
|
||||
"description": [
|
||||
"If true, we emit a single, consolidated event for any onchain-fees for a txid and account. Otherwise, events for every update to the onchain fee calculation for this account and txid will be printed. Note that this means that the events emitted are non-stable, i.e. calling **listincome** twice may result in different onchain fee events being emitted, depending on how much information we've logged for that transaction."
|
||||
],
|
||||
"default": "True"
|
||||
},
|
||||
"start_time": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"UNIX timestamp (in seconds) that filters events after the provided timestamp."
|
||||
],
|
||||
"default": "zero"
|
||||
},
|
||||
"end_time": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"UNIX timestamp (in seconds) that filters events up to and at the provided timestamp."
|
||||
],
|
||||
"default": "max-int"
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"income_events"
|
||||
],
|
||||
"properties": {
|
||||
"income_events": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"account",
|
||||
"tag",
|
||||
"credit_msat",
|
||||
"debit_msat",
|
||||
"currency",
|
||||
"timestamp"
|
||||
],
|
||||
"properties": {
|
||||
"account": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The account name. If the account is a channel, the channel_id."
|
||||
]
|
||||
},
|
||||
"tag": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Type of income event."
|
||||
]
|
||||
},
|
||||
"credit_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"Amount earned (income)."
|
||||
]
|
||||
},
|
||||
"debit_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"Amount spent (expenses)."
|
||||
]
|
||||
},
|
||||
"currency": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Human-readable bech32 part for this coin type."
|
||||
]
|
||||
},
|
||||
"timestamp": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"Timestamp this event was recorded by the node. For consolidated events such as onchain_fees, the most recent timestamp."
|
||||
]
|
||||
},
|
||||
"description": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"More information about this event. If a `invoice` type, typically the bolt11/bolt12 description."
|
||||
]
|
||||
},
|
||||
"outpoint": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The txid:outnum for this event, if applicable."
|
||||
]
|
||||
},
|
||||
"txid": {
|
||||
"type": "txid",
|
||||
"description": [
|
||||
"The txid of the transaction that created this event, if applicable."
|
||||
]
|
||||
},
|
||||
"payment_id": {
|
||||
"type": "hex",
|
||||
"description": [
|
||||
"Lightning payment identifier. For an htlc, this will be the preimage."
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:bkpr-listincome#1",
|
||||
"method": "bkpr-listincome",
|
||||
"params": "{}"
|
||||
},
|
||||
{
|
||||
"id": "example:bkpr-listincome#2",
|
||||
"method": "bkpr-listincome",
|
||||
"params": {
|
||||
"consolidate_fees": false
|
||||
}
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"income_events": [
|
||||
{
|
||||
"account": "wallet",
|
||||
"tag": "deposit",
|
||||
"credit_msat": 1111111000,
|
||||
"debit_msat": 0,
|
||||
"currency": "bcrt",
|
||||
"timestamp": 1706153060,
|
||||
"outpoint": "6d813d2e99ae7181b61e59ff224c43de698bd08b8ca5b8034ccc13aa7b6428ef:0"
|
||||
},
|
||||
{
|
||||
"account": "wallet",
|
||||
"tag": "deposit",
|
||||
"credit_msat": 1111111000,
|
||||
"debit_msat": 0,
|
||||
"currency": "bcrt",
|
||||
"timestamp": 1706153060,
|
||||
"outpoint": "0bbbe965f76525af3876ae6f1520d91047d4be04cb4e46b7229120a60c5dc9c5:0"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"income_events": [
|
||||
{
|
||||
"account": "wallet",
|
||||
"tag": "deposit",
|
||||
"credit_msat": 1111111000,
|
||||
"debit_msat": 0,
|
||||
"currency": "bcrt",
|
||||
"timestamp": 1708624181,
|
||||
"outpoint": "895b5eaad4544d24c99628883b4d84b2c6024d6a2da4c1de54098d985f280943:1"
|
||||
},
|
||||
{
|
||||
"account": "wallet",
|
||||
"tag": "withdrawal",
|
||||
"credit_msat": 0,
|
||||
"debit_msat": 555555000,
|
||||
"currency": "bcrt",
|
||||
"timestamp": 1708624182,
|
||||
"outpoint": "d28a2cba55da10700ddd7f1f23618160dafb3134650055654551d9b0382dcd71:0"
|
||||
},
|
||||
{
|
||||
"account": "wallet",
|
||||
"tag": "onchain_fee",
|
||||
"credit_msat": 0,
|
||||
"debit_msat": 555556000,
|
||||
"currency": "bcrt",
|
||||
"timestamp": 1708624183,
|
||||
"txid": "d28a2cba55da10700ddd7f1f23618160dafb3134650055654551d9b0382dcd71"
|
||||
},
|
||||
{
|
||||
"account": "wallet",
|
||||
"tag": "onchain_fee",
|
||||
"credit_msat": 554947000,
|
||||
"debit_msat": 0,
|
||||
"currency": "bcrt",
|
||||
"timestamp": 1708624183,
|
||||
"txid": "d28a2cba55da10700ddd7f1f23618160dafb3134650055654551d9b0382dcd71"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"author": [
|
||||
"Lisa Neigut <<niftynei@gmail.com>> is mainly responsible."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-bkpr-listaccountevents(7)",
|
||||
"lightning-listfunds(7)",
|
||||
"lightning-bkpr-listbalances(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
137
doc/schemas/lightning-blacklistrune.json
Normal file
137
doc/schemas/lightning-blacklistrune.json
Normal file
|
@ -0,0 +1,137 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"added": "v23.08",
|
||||
"rpc": "blacklistrune",
|
||||
"title": "Command to prevent a rune from working",
|
||||
"description": [
|
||||
"The **blacklistrune** RPC command allows you to effectively revoke the rune you have created (and any runes derived from that rune with additional restictions). Attempting to use these runes will be resulted in a `Blacklisted rune` error message.",
|
||||
"",
|
||||
"Destroy a rune like in olden times with the **destroyrune** command.",
|
||||
"",
|
||||
"All runes created by lightning have a unique sequential id within them and can be blacklisted in ranges for efficiency. The command always returns the blacklisted ranges on success. If no parameters are specified, no changes have been made. If start specified without end, that single rune is blacklisted. If end is also specified, every rune from start till end inclusive is blacklisted."
|
||||
],
|
||||
"request": {
|
||||
"required": [],
|
||||
"properties": {
|
||||
"start": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"First rune unique id to blacklist."
|
||||
]
|
||||
},
|
||||
"end": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"Final rune unique id to blacklist (defaults to start)."
|
||||
]
|
||||
}
|
||||
},
|
||||
"dependentUpon": {
|
||||
"start": [
|
||||
"end"
|
||||
]
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"blacklist"
|
||||
],
|
||||
"properties": {
|
||||
"blacklist": {
|
||||
"type": "array",
|
||||
"description": [
|
||||
"The resulting blacklist ranges after the command."
|
||||
],
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"start",
|
||||
"end"
|
||||
],
|
||||
"properties": {
|
||||
"start": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"Unique id of first rune in this blacklist range."
|
||||
]
|
||||
},
|
||||
"end": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"Unique id of last rune in this blacklist range."
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:blacklistrune#1",
|
||||
"method": "blacklistrune",
|
||||
"params": {
|
||||
"start": 2
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "example:blacklistrune#2",
|
||||
"method": "blacklistrune",
|
||||
"params": {
|
||||
"start": 5,
|
||||
"end": 7
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "example:blacklistrune#3",
|
||||
"method": "blacklistrune",
|
||||
"params": {
|
||||
"start": 3,
|
||||
"end": 4
|
||||
}
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"blacklist": [
|
||||
{
|
||||
"start": 2,
|
||||
"end": 2
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"blacklist": [
|
||||
{
|
||||
"start": 2,
|
||||
"end": 2
|
||||
},
|
||||
{
|
||||
"start": 5,
|
||||
"end": 7
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"blacklist": [
|
||||
{
|
||||
"start": 2,
|
||||
"end": 7
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"author": [
|
||||
"Shahana Farooqui <<sfarooqui@blockstream.com>> is mainly responsible."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-commando-blacklist(7)",
|
||||
"lightning-showrunes(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
100
doc/schemas/lightning-check.json
Normal file
100
doc/schemas/lightning-check.json
Normal file
|
@ -0,0 +1,100 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"rpc": "check",
|
||||
"title": "Command for verifying parameters",
|
||||
"description": [
|
||||
"The **check** RPC command verifies another command without actually making any changes.",
|
||||
"",
|
||||
"This is guaranteed to be safe, and will do all checks up to the point where something in the system would need to be altered (such as checking that channels are in the right state, peers connected, etc).",
|
||||
"",
|
||||
"It does not guarantee successful execution of the command in all cases. For example, a call to lightning-getroute(7) may still fail to find a route even if checking the parameters succeeds."
|
||||
],
|
||||
"request": {
|
||||
"required": [
|
||||
"command_to_check"
|
||||
],
|
||||
"properties": {
|
||||
"command_to_check": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Name of the relevant command."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"properties": {
|
||||
"command_to_check": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The *command_to_check* argument."
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"command_to_check"
|
||||
]
|
||||
},
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:check#1",
|
||||
"method": "check",
|
||||
"params": {
|
||||
"command_to_check": "sendpay",
|
||||
"route": [
|
||||
{
|
||||
"amount_msat": 1011,
|
||||
"msatoshi": 1011,
|
||||
"id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59",
|
||||
"delay": 20,
|
||||
"channel": "1x1x1"
|
||||
},
|
||||
{
|
||||
"amount_msat": 1000,
|
||||
"msatoshi": 1000,
|
||||
"id": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d",
|
||||
"delay": 10,
|
||||
"channel": "2x2x2"
|
||||
}
|
||||
],
|
||||
"payment_hash": "0000000000000000000000000000000000000000000000000000000000000000"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "example:check#2",
|
||||
"method": "check",
|
||||
"params": {
|
||||
"command_to_check": "dev",
|
||||
"subcommand": "slowcmd",
|
||||
"msec": 1000
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "example:check#3",
|
||||
"method": "check",
|
||||
"params": {
|
||||
"command_to_check": "recover",
|
||||
"hsmsecret": "6c696768746e696e672d31000000000000000000000000000000000000000000"
|
||||
}
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"command_to_check": "sendpay"
|
||||
},
|
||||
{
|
||||
"command_to_check": "dev"
|
||||
},
|
||||
{
|
||||
"command_to_check": "recover"
|
||||
}
|
||||
],
|
||||
"author": [
|
||||
"Mark Beckwith <<wythe@intrig.com>> and Rusty Russell <<rusty@rustcorp.com.au>> are mainly responsible."
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
106
doc/schemas/lightning-checkmessage.json
Normal file
106
doc/schemas/lightning-checkmessage.json
Normal file
|
@ -0,0 +1,106 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"rpc": "checkmessage",
|
||||
"title": "Command to check if a signature is from a node",
|
||||
"description": [
|
||||
"The **checkmessage** RPC command is the counterpart to **signmessage**: given a node id (*pubkey*), signature (*zbase*) and a *message*, it verifies that the signature was generated by that node for that message (more technically: by someone who knows that node's secret).",
|
||||
"",
|
||||
"As a special case, if *pubkey* is not specified, we will try every known node key (as per *listnodes*), and verification succeeds if it matches for any one of them. Note: this is implemented far more efficiently than trying each one, so performance is not a concern."
|
||||
],
|
||||
"request": {
|
||||
"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."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"verified",
|
||||
"pubkey"
|
||||
],
|
||||
"properties": {
|
||||
"verified": {
|
||||
"type": "boolean",
|
||||
"enum": [
|
||||
true
|
||||
],
|
||||
"description": [
|
||||
"Whether the signature was valid."
|
||||
]
|
||||
},
|
||||
"pubkey": {
|
||||
"type": "pubkey",
|
||||
"description": [
|
||||
"The *pubkey* parameter, or the pubkey found by looking for known nodes."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:checkmessage#1",
|
||||
"method": "checkmessage",
|
||||
"params": {
|
||||
"message": "testcase to check new rpc error",
|
||||
"zbase": "d66bqz3qsku5fxtqsi37j11pci47ydxa95iusphutggz9ezaxt56neh77kxe5hyr41kwgkncgiu94p9ecxiexgpgsz8daoq4tw8kj8yx",
|
||||
"pubkey": "03be3b0e9992153b1d5a6e1623670b6c3663f72ce6cf2e0dd39c0a373a7de5a3b7"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "example:checkmessage#2",
|
||||
"method": "checkmessage",
|
||||
"params": {
|
||||
"message": "this is a test!",
|
||||
"zbase": "d6tqaeuonjhi98mmont9m4wag7gg4krg1f4txonug3h31e9h6p6k6nbwjondnj46dkyausobstnk7fhyy998bhgc1yr98dfmhb4k54d7",
|
||||
"pubkey": null
|
||||
}
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"pubkey": "03be3b0e9992153b1d5a6e1623670b6c3663f72ce6cf2e0dd39c0a373a7de5a3b7",
|
||||
"verified": true
|
||||
},
|
||||
{
|
||||
"pubkey": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518",
|
||||
"verified": true
|
||||
}
|
||||
],
|
||||
"errors": [
|
||||
"On failure, an error is returned and core lightning exit with the following error code:",
|
||||
"",
|
||||
"- -32602: Parameter missed or malformed;",
|
||||
"- 1301: *pubkey* not found in the graph."
|
||||
],
|
||||
"author": [
|
||||
"Rusty Russell <<rusty@rustcorp.com.au>> is mainly responsible."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-signmessage(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
139
doc/schemas/lightning-checkrune.json
Normal file
139
doc/schemas/lightning-checkrune.json
Normal file
|
@ -0,0 +1,139 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"added": "v23.08",
|
||||
"rpc": "checkrune",
|
||||
"title": "Command to Validate Rune",
|
||||
"description": [
|
||||
"The **checkrune** RPC command checks the validity/authorization rights of specified rune for the given nodeid, method, and params.",
|
||||
"",
|
||||
"If successful, the rune \"usage\" counter (used for ratelimiting) is incremented.",
|
||||
"",
|
||||
"See lightning-createrune(7) for the fields in the rune which are checked."
|
||||
],
|
||||
"request": {
|
||||
"required": [
|
||||
"rune"
|
||||
],
|
||||
"properties": {
|
||||
"rune": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Rune to check for authorization."
|
||||
]
|
||||
},
|
||||
"nodeid": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Node id of requesting node *(required until v23.11)*."
|
||||
]
|
||||
},
|
||||
"method": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Method for which rune needs to be validated *(required until v23.11)*."
|
||||
]
|
||||
},
|
||||
"params": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "array",
|
||||
"description": [
|
||||
"Array of positional parameters."
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"description": [
|
||||
"Parameters for method."
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"valid"
|
||||
],
|
||||
"properties": {
|
||||
"valid": {
|
||||
"type": "boolean",
|
||||
"description": [
|
||||
"True if the rune is valid."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"errors": [
|
||||
"The following error codes may occur:",
|
||||
"",
|
||||
"- 1501 (RUNE_NOT_AUTHORIZED): rune is not for this node (or perhaps completely invalid)",
|
||||
"- 1502 (RUNE_NOT_PERMITTED): rune does not allow this usage (includes a detailed reason why)",
|
||||
"- 1503 (RUNE_BLACKLISTED): rune has been explicitly blacklisted."
|
||||
],
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:checkrune#1",
|
||||
"method": "checkrune",
|
||||
"params": {
|
||||
"nodeid": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518",
|
||||
"rune": "617Obfct0oRBj_uqGFQxDk3XZ1sDFiC2Q5ltm5z1i_k9NSZtZXRob2Q9aW52b2ljZSZwbmFtZWRlc2NyaXB0aW9uPUB0aXBqYXJcfGpiNTVAc2VuZHNhdHMubG9s",
|
||||
"method": "invoice",
|
||||
"params": {
|
||||
"amount_msat": "any",
|
||||
"label": "lbl",
|
||||
"description": [
|
||||
"@tipjar|jb55@sendsats.lol."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "example:checkrune#2",
|
||||
"method": "checkrune",
|
||||
"params": {
|
||||
"nodeid": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518",
|
||||
"rune": "OSqc7ixY6F-gjcigBfxtzKUI54uzgFSA6YfBQoWGDV89MA==",
|
||||
"method": "listpeers",
|
||||
"params": {}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "example:checkrune#3",
|
||||
"method": "checkrune",
|
||||
"params": {
|
||||
"nodeid": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518",
|
||||
"rune": "617Obfct0oRBj_uqGFQxDk3XZ1sDFiC2Q5ltm5z1i_k9NSZtZXRob2Q9aW52b2ljZSZwbmFtZWRlc2NyaXB0aW9uPUB0aXBqYXJcfGpiNTVAc2VuZHNhdHMubG9s",
|
||||
"method": "invoice",
|
||||
"params": {
|
||||
"amount_msat": "any",
|
||||
"label": "lbl",
|
||||
"description": "@tipjar|jb55@sendsats.lol"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"valid": true
|
||||
}
|
||||
],
|
||||
"author": [
|
||||
"Shahana Farooqui <<sfarooqui@blockstream.com>> is mainly responsible for consolidating logic from commando."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-createrune(7)",
|
||||
"lightning-blacklistrune(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
209
doc/schemas/lightning-close.json
Normal file
209
doc/schemas/lightning-close.json
Normal file
|
@ -0,0 +1,209 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"rpc": "close",
|
||||
"title": "Command for closing channels with direct peers",
|
||||
"description": [
|
||||
"The **close** RPC command attempts to close the channel cooperatively with the peer, or unilaterally after *unilateraltimeout*, and the to-local output will be sent to the address specified in *destination*.",
|
||||
"",
|
||||
"The peer needs to be live and connected in order to negotiate a mutual close. The default of unilaterally closing after 48 hours is usually a reasonable indication that you can no longer contact the peer."
|
||||
],
|
||||
"request": {
|
||||
"required": [
|
||||
"id"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Peer id, channel id or short_channel_id. If the given *id* is a peer ID (66 hex digits as a string), then it applies to the active channel of the direct peer corresponding to the given peer ID. If the given *id* is a channel ID (64 hex digits as a string, or the short channel ID *blockheight:txindex:outindex* form), then it applies to that channel."
|
||||
]
|
||||
},
|
||||
"unilateraltimeout": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"If it is not zero, the command will unilaterally close the channel when that number of seconds is reached. If *unilateraltimeout* is zero, then the command will wait indefinitely until the peer is online and can negotiate a mutual close."
|
||||
],
|
||||
"default": "2 days (172800 seconds)"
|
||||
},
|
||||
"destination": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Any Bitcoin bech32 type. If the peer hasn't offered the option_shutdown_anysegwit feature, then taproot addresses (or other v1+ segwit) are not allowed. Tell your friends to upgrade!"
|
||||
],
|
||||
"default": "a Core Lightning wallet address"
|
||||
},
|
||||
"fee_negotiation_step": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"It controls how closing fee negotiation is performed assuming the peer proposes a fee that is different than our estimate. (Note that modern peers use the quick-close protocol which does not allow negotiation: see *feerange* instead).",
|
||||
"",
|
||||
"On every negotiation step we must give up some amount from our proposal towards the peer's proposal. This parameter can be an integer in which case it is interpreted as number of satoshis to step at a time. Or it can be an integer followed by `%` to designate a percentage of the interval to give up. A few examples, assuming the peer proposes a closing fee of 3000 satoshi and our estimate shows it must be 4000:",
|
||||
" * `10`: our next proposal will be 4000-10=3990.",
|
||||
" * `10%`: our next proposal will be 4000-(10% of (4000-3000))=3900.",
|
||||
" * '1': our next proposal will be 3999. This is the most extreme case when we insist on our fee as much as possible.",
|
||||
" * `100%`: our next proposal will be 3000. This is the most relaxed case when we quickly accept the peer's proposal."
|
||||
],
|
||||
"default": "`50%`"
|
||||
},
|
||||
"wrong_funding": {
|
||||
"type": "outpoint",
|
||||
"description": [
|
||||
"It can only be specified if both sides have offered the `shutdown_wrong_funding` feature (enabled by the **experimental-shutdown-wrong-funding** option). It must be a transaction id followed by a colon then the output number. Instead of negotiating a shutdown to spend the expected funding transaction, the shutdown transaction will spend this output instead. This is only allowed if this peer opened the channel and the channel is unused: it can rescue openings which have been manually miscreated."
|
||||
]
|
||||
},
|
||||
"force_lease_closed": {
|
||||
"type": "boolean",
|
||||
"description": [
|
||||
"If the channel has funds leased to the peer (option_will_fund), we prevent initiation of a mutual close unless this flag is passed in."
|
||||
],
|
||||
"default": "False"
|
||||
},
|
||||
"feerange": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "feerate"
|
||||
},
|
||||
"description": [
|
||||
"An optional array [ *min*, *max* ], indicating the minimum and maximum feerates to offer: the peer will obey these if it supports the quick-close protocol. *slow* and *unilateral_close* are the defaults. Note that the maximum fee will be capped at the final commitment transaction fee (unless the experimental anchor-outputs option is negotiated)."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"type"
|
||||
],
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"mutual",
|
||||
"unilateral",
|
||||
"unopened"
|
||||
],
|
||||
"description": [
|
||||
"Whether we successfully negotiated a mutual close, closed without them, or discarded not-yet-opened channel."
|
||||
]
|
||||
}
|
||||
},
|
||||
"allOf": [
|
||||
{
|
||||
"if": {
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"mutual",
|
||||
"unilateral"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"then": {
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"tx",
|
||||
"txid"
|
||||
],
|
||||
"properties": {
|
||||
"type": {},
|
||||
"tx": {
|
||||
"type": "hex",
|
||||
"description": [
|
||||
"The raw bitcoin transaction used to close the channel (if it was open)."
|
||||
]
|
||||
},
|
||||
"txid": {
|
||||
"type": "txid",
|
||||
"description": [
|
||||
"The transaction id of the *tx* field."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"else": {
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"type": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"post_return_value_notes": [
|
||||
"A unilateral close may still occur at any time if the peer did not behave correctly during the close negotiation.",
|
||||
"",
|
||||
"Unilateral closes will return your funds after a delay. The delay will vary based on the peer *to_self_delay* setting, not your own setting."
|
||||
]
|
||||
},
|
||||
"notes": [
|
||||
"Prior to 0.7.2, **close** took two parameters: *force* and *timeout*. *timeout* was the number of seconds before *force* took effect (default, 30), and *force* determined whether the result was a unilateral close or an RPC error (default). Even after the timeout, the channel would be closed if the peer reconnected."
|
||||
],
|
||||
"notifications": [
|
||||
"Notifications may be returned indicating what is going on, especially if the peer is offline and we are waiting."
|
||||
],
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:close#1",
|
||||
"method": "close",
|
||||
"params": {
|
||||
"id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59",
|
||||
"unilateraltimeout": 1,
|
||||
"destination": null,
|
||||
"fee_negotiation_step": null,
|
||||
"force_lease_closed": null,
|
||||
"feerange": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "example:close#2",
|
||||
"method": "close",
|
||||
"params": {
|
||||
"id": "103x1x0",
|
||||
"unilateraltimeout": null,
|
||||
"destination": "bcrt1qeyyk6sl5pr49ycpqyckvmttus5ttj25pd0zpvg",
|
||||
"fee_negotiation_step": null,
|
||||
"force_lease_closed": null,
|
||||
"feerange": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "example:close#3",
|
||||
"method": "close",
|
||||
"params": [
|
||||
"107x1x0",
|
||||
null,
|
||||
"bcrt1qeyyk6sl5pr49ycpqyckvmttus5ttj25pd0zpvg"
|
||||
]
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"tx": "020000000001018d388ffcd216c92d25163a62096ce47d5c9bbd6270ced51c5a1484f89df33e5700000000009db0e28002a00f00000000000016001445503fa4b65ade3ffdb1a92057688456c9ffae1380130f0000000000220020be82765fdb17fd5568f2dd31c6cf1aabc620ef338995ec5d9a2f3e42f43ae4870400473044022058dcde893655f40fc8162a79596440ef3e304273f8d530401fc17bc92c58159b0220428900ca6537538ba237d569a4a09003d663a991aeb331a9f18dfe807ee78806014730440220111270eeed8b4b1a231d3ce6e0e0daad718623ad159a0fd3781fb18118a8fec70220539826ee7c76cad4116d1d8852329f80314b3434cf21c765d8004186451a4cd50147522102324266de8403b3ab157a09f1f784d587af61831c998c151bcc21bb74c2b2314b2102e3bd38009866c9da8ec4aa99cc4ea9c6c0dd46df15c61ef0ce1f271291714e5752ae9c3ed620",
|
||||
"txid": "5d8d917dd7d39fe5a12f121457fc6d712b5e393ed4f16bc8f5976fc08cbbfecd",
|
||||
"type": "unilateral"
|
||||
},
|
||||
{
|
||||
"tx": "0200000000010132cbce7d5f96b4003c3b5c0eab2a29fef90bb6abb833ff312fa122f31e8301810000000000ffffffff02a0860100000000002251205779a060f200d40e8f871a40eb91614cc5bfa6d0a5f852e053400a7feff8615005b10d0000000000160014c9096d43f408ea526020262ccdad7c8516b92a81040047304402207e171d056e81cf8ad2d5a613ecbaa212d5dcbd0bf713145d18911d2cbe9d858802206222911660a26d7ffddc2563ae6d41d6ffad9fbd2fc26cf40eab501a31153b9e0147304402204ae7cdc68dc7966eab73f16a1978643336333d54ae0b6f87bc11a2c19174a9710220601e5276aee0825466cc272c4eb7d353b393ef0dd230d303f46772790dee19190147522102324266de8403b3ab157a09f1f784d587af61831c998c151bcc21bb74c2b2314b2102e3bd38009866c9da8ec4aa99cc4ea9c6c0dd46df15c61ef0ce1f271291714e5752ae00000000",
|
||||
"txid": "4a08e0508e2e39ea033fab5f77b318337f345550421799f6e0eb1b15a892eda4",
|
||||
"type": "mutual"
|
||||
},
|
||||
{
|
||||
"tx": "02000000000101233b513665836d240423f45ffcd1fe19aeb08d62303fa5382ad3285f770683a60000000000ffffffff02a086010000000000225120b47216ab60a0fad97de0ba9b8b370d281dfe55f552d82034e2a8d054c2246e4405b10d0000000000160014c9096d43f408ea526020262ccdad7c8516b92a81040047304402207a9e3ca258861b33827d91514690a757e76730ba8c15dd222340bb13d993a1a502204d0ae329273b69abe62df1ffccce808d5f1a29101a8ee95dae99888376dbaef801473044022033c03f406db9f1c9d924cfd8f6ea42d0962f0ab02e3217aef518aea517ca5ba40220076e2af9d40c676316a2765a86f9efd481de3fc4465ceba33b0782c505ae3452014752210212284c004a3d24146e54b2a24db48f650370a08e1fe9abe8ff41f92b09cd50542102a3032ef980cc735579aa5295d927b9a1bdbafc459f2da14163dc9bd530e0a21152ae00000000",
|
||||
"txid": "d44a1374a30c1a936d2d4fdbe73c0ffff42fec8c27c6cbaec2758b3042f61d08",
|
||||
"type": "mutual"
|
||||
}
|
||||
],
|
||||
"author": [
|
||||
"ZmnSCPxj <<ZmnSCPxj@protonmail.com>> is mainly responsible."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-disconnect(7)",
|
||||
"lightning-fundchannel(7)",
|
||||
"lightningd-config(5)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
138
doc/schemas/lightning-commando-blacklist.json
Normal file
138
doc/schemas/lightning-commando-blacklist.json
Normal file
|
@ -0,0 +1,138 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"added": "v23.05",
|
||||
"deprecated": [
|
||||
"v23.08",
|
||||
"v24.08"
|
||||
],
|
||||
"rpc": "commando-blacklist",
|
||||
"title": "Command to prevent a rune from working",
|
||||
"description": [
|
||||
"The **commando-blacklist** RPC command allows you to effectively revoke the rune you have created (and any runes derived from that rune with additional restictions). Attempting to use these runes will be resulted in a `Blacklisted rune` error message.",
|
||||
"",
|
||||
"All runes created by commando have a unique sequential id within them and can be blacklisted in ranges for efficiency. The command always returns the blacklisted ranges on success. If no parameters are specified, no changes have been made. If start specified without end, that single rune is blacklisted. If end is also specified, every rune from start till end inclusive is blacklisted."
|
||||
],
|
||||
"request": {
|
||||
"required": [],
|
||||
"properties": {
|
||||
"start": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"First rune unique id to blacklist."
|
||||
]
|
||||
},
|
||||
"end": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"Final rune unique id to blacklist (defaults to start)."
|
||||
]
|
||||
}
|
||||
},
|
||||
"dependentUpon": {
|
||||
"start": [
|
||||
"end"
|
||||
]
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"blacklist"
|
||||
],
|
||||
"properties": {
|
||||
"blacklist": {
|
||||
"type": "array",
|
||||
"description": [
|
||||
"The resulting blacklist ranges after the command."
|
||||
],
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"start",
|
||||
"end"
|
||||
],
|
||||
"properties": {
|
||||
"start": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"Unique id of first rune in this blacklist range."
|
||||
]
|
||||
},
|
||||
"end": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"Unique id of last rune in this blacklist range."
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:commando-blacklist#1",
|
||||
"method": "commando-blacklist",
|
||||
"params": {
|
||||
"start": 2
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "example:commando-blacklist#2",
|
||||
"method": "commando-blacklist",
|
||||
"params": {
|
||||
"start": 5,
|
||||
"end": 7
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "example:commando-blacklist#3",
|
||||
"method": "commando-blacklist",
|
||||
"params": {
|
||||
"start": 3,
|
||||
"end": 4
|
||||
}
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"blacklist": [
|
||||
{
|
||||
"start": 2,
|
||||
"end": 2
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"blacklist": [
|
||||
{
|
||||
"start": 2,
|
||||
"end": 2
|
||||
},
|
||||
{
|
||||
"start": 5,
|
||||
"end": 7
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"blacklist": [
|
||||
{
|
||||
"start": 2,
|
||||
"end": 7
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"author": [
|
||||
"Shahana Farooqui <<sfarooqui@blockstream.com>> is mainly responsible."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-commando-listrunes(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
294
doc/schemas/lightning-commando-listrunes.json
Normal file
294
doc/schemas/lightning-commando-listrunes.json
Normal file
|
@ -0,0 +1,294 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"added": "v23.05",
|
||||
"deprecated": [
|
||||
"v23.08",
|
||||
"v24.05"
|
||||
],
|
||||
"rpc": "commando-listrunes",
|
||||
"title": "Command to list previously generated runes",
|
||||
"description": [
|
||||
"The **commando-listrunes** RPC command either lists runes that we stored as we generate them (see lightning-commando-rune(7)) or decodes the rune given on the command line.",
|
||||
"",
|
||||
"NOTE: Runes generated prior to v23.05 were not stored, so will not appear in this list."
|
||||
],
|
||||
"request": {
|
||||
"required": [],
|
||||
"properties": {
|
||||
"rune": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Optional rune to list."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"runes"
|
||||
],
|
||||
"properties": {
|
||||
"runes": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"rune",
|
||||
"unique_id",
|
||||
"restrictions",
|
||||
"restrictions_as_english"
|
||||
],
|
||||
"properties": {
|
||||
"rune": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Base64 encoded rune."
|
||||
]
|
||||
},
|
||||
"unique_id": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Unique id assigned when the rune was generated; this is always a u64 for commando runes."
|
||||
]
|
||||
},
|
||||
"restrictions": {
|
||||
"type": "array",
|
||||
"description": [
|
||||
"The restrictions on what commands this rune can authorize."
|
||||
],
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"alternatives",
|
||||
"english"
|
||||
],
|
||||
"properties": {
|
||||
"alternatives": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"fieldname",
|
||||
"value",
|
||||
"condition",
|
||||
"english"
|
||||
],
|
||||
"properties": {
|
||||
"fieldname": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The field this restriction applies to; see commando-rune(7)."
|
||||
]
|
||||
},
|
||||
"value": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The value accepted for this field."
|
||||
]
|
||||
},
|
||||
"condition": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The way to compare fieldname and value."
|
||||
]
|
||||
},
|
||||
"english": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"English readable description of this alternative."
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"english": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"English readable summary of alternatives above."
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"restrictions_as_english": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"English readable description of the restrictions array above."
|
||||
]
|
||||
},
|
||||
"stored": {
|
||||
"type": "boolean",
|
||||
"enum": [
|
||||
false
|
||||
],
|
||||
"description": [
|
||||
"This is false if the rune does not appear in our datastore (only possible when `rune` is specified)."
|
||||
]
|
||||
},
|
||||
"blacklisted": {
|
||||
"type": "boolean",
|
||||
"enum": [
|
||||
true
|
||||
],
|
||||
"description": [
|
||||
"The rune has been blacklisted; see commando-blacklist(7)."
|
||||
]
|
||||
},
|
||||
"last_used": {
|
||||
"type": "number",
|
||||
"description": [
|
||||
"The last time this rune was successfully used."
|
||||
],
|
||||
"added": "23.11"
|
||||
},
|
||||
"our_rune": {
|
||||
"type": "boolean",
|
||||
"enum": [
|
||||
false
|
||||
],
|
||||
"description": [
|
||||
"This is not a rune for this node (only possible when `rune` is specified)."
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:commando-listrunes#1",
|
||||
"method": "commando-listrunes",
|
||||
"params": "{}"
|
||||
},
|
||||
{
|
||||
"id": "example:commando-listrunes#2",
|
||||
"method": "commando-listrunes",
|
||||
"params": {
|
||||
"rune": "Am3W_wI0PRn4qVNEsJ2iInHyFPQK8wfdqEXztm8-icQ9MA=="
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "example:commando-listrunes#3",
|
||||
"method": "commando-listrunes",
|
||||
"params": {
|
||||
"rune": "m_tyR0qqHUuLEbFJW6AhmBg-9npxVX2yKocQBFi9cvY9MyZpZF4wMjJkMjIzNjIwYTM1OWE0N2ZmNyZtZXRob2Q9bGlzdHBlZXJzJnBuYW1lbGV2ZWwhfHBuYW1lbGV2ZWwvaW8mcGFycjEhfHBhcnIxL2lv"
|
||||
}
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"runes": [
|
||||
{
|
||||
"rune": "OSqc7ixY6F-gjcigBfxtzKUI54uzgFSA6YfBQoWGDV89MA==",
|
||||
"unique_id": "0",
|
||||
"restrictions": [],
|
||||
"restrictions_as_english": ""
|
||||
},
|
||||
{
|
||||
"rune": "Am3W_wI0PRn4qVNEsJ2iInHyFPQK8wfdqEXztm8-icQ9MA==",
|
||||
"stored": false,
|
||||
"our_rune": false,
|
||||
"unique_id": "1",
|
||||
"restrictions": [],
|
||||
"restrictions_as_english": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"runes": [
|
||||
{
|
||||
"rune": "Am3W_wI0PRn4qVNEsJ2iInHyFPQK8wfdqEXztm8-icQ9MA==",
|
||||
"stored": false,
|
||||
"our_rune": false,
|
||||
"unique_id": "1",
|
||||
"restrictions": [],
|
||||
"restrictions_as_english": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"runes": [
|
||||
{
|
||||
"rune": "m_tyR0qqHUuLEbFJW6AhmBg-9npxVX2yKocQBFi9cvY9MyZpZF4wMjJkMjIzNjIwYTM1OWE0N2ZmNyZtZXRob2Q9bGlzdHBlZXJzJnBuYW1lbGV2ZWwhfHBuYW1lbGV2ZWwvaW8mcGFycjEhfHBhcnIxL2lv",
|
||||
"stored": false,
|
||||
"unique_id": "3",
|
||||
"restrictions": [
|
||||
{
|
||||
"alternatives": [
|
||||
{
|
||||
"fieldname": "id",
|
||||
"value": "022d223620a359a47ff7",
|
||||
"condition": "^",
|
||||
"english": "id starts with 022d223620a359a47ff7"
|
||||
}
|
||||
],
|
||||
"english": "id starts with 022d223620a359a47ff7"
|
||||
},
|
||||
{
|
||||
"alternatives": [
|
||||
{
|
||||
"fieldname": "method",
|
||||
"value": "listpeers",
|
||||
"condition": "=",
|
||||
"english": "method equal to listpeers"
|
||||
}
|
||||
],
|
||||
"english": "method equal to listpeers"
|
||||
},
|
||||
{
|
||||
"alternatives": [
|
||||
{
|
||||
"fieldname": "pnamelevel",
|
||||
"value": "",
|
||||
"condition": "!",
|
||||
"english": "pnamelevel is missing"
|
||||
},
|
||||
{
|
||||
"fieldname": "pnamelevel",
|
||||
"value": "io",
|
||||
"condition": "/",
|
||||
"english": "pnamelevel unequal to io"
|
||||
}
|
||||
],
|
||||
"english": "pnamelevel is missing OR pnamelevel unequal to io"
|
||||
},
|
||||
{
|
||||
"alternatives": [
|
||||
{
|
||||
"fieldname": "parr1",
|
||||
"value": "",
|
||||
"condition": "!",
|
||||
"english": "parr1 is missing"
|
||||
},
|
||||
{
|
||||
"fieldname": "parr1",
|
||||
"value": "io",
|
||||
"condition": "/",
|
||||
"english": "parr1 unequal to io"
|
||||
}
|
||||
],
|
||||
"english": "parr1 is missing OR parr1 unequal to io"
|
||||
}
|
||||
],
|
||||
"restrictions_as_english": "id starts with 022d223620a359a47ff7 AND method equal to listpeers AND pnamelevel is missing OR pnamelevel unequal to io AND parr1 is missing OR parr1 unequal to io"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"author": [
|
||||
"Shahana Farooqui <<sfarooqui@blockstream.com>> is mainly responsible."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-commando-rune(7)",
|
||||
"lightning-commando-blacklist(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
296
doc/schemas/lightning-commando-rune.json
Normal file
296
doc/schemas/lightning-commando-rune.json
Normal file
|
@ -0,0 +1,296 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"deprecated": [
|
||||
"v23.08",
|
||||
"v23.05"
|
||||
],
|
||||
"rpc": "commando-rune",
|
||||
"title": "Command to Authorize Remote Peer Access",
|
||||
"description": [
|
||||
"The **commando-rune** RPC command creates a base64 string called a *rune* which can be used to access commands on this node. Each *rune* contains a unique id (a number starting at 0), and can have restrictions inside it. Nobody can remove restrictions from a rune: if you try, the rune will be rejected. There is no limit on how many runes you can issue; the node simply decodes and checks them as they are received (we do store them for lightning-commando- listrunes(7) however)."
|
||||
],
|
||||
"request": {
|
||||
"required": [],
|
||||
"properties": {
|
||||
"rune": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"If supplied, the restrictions are simple appended to that *rune* (it doesn't need to be a rune belonging to this node). If not supplied, a new *rune* is constructed, with a new unique id."
|
||||
]
|
||||
},
|
||||
"restrictions": {
|
||||
"description": [
|
||||
"It can be the string `readonly`, or an array of restrictions.",
|
||||
"Each restriction is an array of one or more alternatives, such as \"method is listpeers\", or \"method is listpeers OR time is before 2023\"."
|
||||
],
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "array",
|
||||
"description": [
|
||||
"Alternatives use a simple language to examine the command which is being run:",
|
||||
" * time: the current UNIX time, e.g. \"time<1656759180\".",
|
||||
" * id: the node_id of the peer, e.g. \"id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605\".",
|
||||
" * method: the command being run, e.g. \"method=withdraw\".",
|
||||
" * per: how often the rune can be used, with suffix \"sec\" (default), \"min\", \"hour\", \"day\" or \"msec\", \"usec\" or \"nsec\". e.g. \"per=5sec\".",
|
||||
" * rate: the rate limit, per minute, e.g. \"rate=60\" is equivalent to \"per=1sec\".",
|
||||
" * pnum: the number of parameters. e.g. \"pnum<2\".",
|
||||
" * pnameX: the parameter named X (with any punctuation like `_` removed). e.g. \"pnamedestination=1RustyRX2oai4EYYDpQGWvEL62BBGqN9T\".",
|
||||
" * parrN: the N'th parameter. e.g. \"parr0=1RustyRX2oai4EYYDpQGWvEL62BBGqN9T\"."
|
||||
],
|
||||
"items": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"readonly"
|
||||
],
|
||||
"description": [
|
||||
"A rune which allows most *get* and *list* commands, and the *summary* command."
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"rune",
|
||||
"unique_id"
|
||||
],
|
||||
"properties": {
|
||||
"rune": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The resulting rune."
|
||||
]
|
||||
},
|
||||
"unique_id": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The id of this rune: this is set at creation and cannot be changed (even as restrictions are added)."
|
||||
]
|
||||
},
|
||||
"warning_unrestricted_rune": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"A warning shown when runes are created with powers that could drain your node."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"restriction_format": [
|
||||
"Restrictions are one or more alternatives. Each alternative is *name* *operator* *value*. The valid names are shown above.",
|
||||
"",
|
||||
"Note that if a value contains `\\`, it must be preceeded by another `\\` to form valid JSON:",
|
||||
"* `=`: passes if equal ie. identical. e.g. `method=withdraw`",
|
||||
"* `/`: not equals, e.g. `method/withdraw`",
|
||||
"* `^`: starts with, e.g. `id^024b9a1fa8e006f1e3937f`",
|
||||
"* `$`: ends with, e.g. `id$381df1cc449605`.",
|
||||
"* `~`: contains, e.g. `id~006f1e3937f65f66c40`.",
|
||||
"* `<`: is a decimal integer, and is less than. e.g. `time<1656759180`",
|
||||
"* `>`: is a decimal integer, and is greater than. e.g. `time>1656759180`",
|
||||
"* `{`: preceeds in alphabetical order (or matches but is shorter),",
|
||||
" e.g. `id{02ff`.",
|
||||
"* `}`: follows in alphabetical order (or matches but is longer),",
|
||||
" e.g. `id}02ff`.",
|
||||
"* `#`: a comment, ignored, e.g. `dumb example#`.",
|
||||
"* `!`: only passes if the *name* does *not* exist. e.g. `pnamedestination!`.",
|
||||
"Every other operator except `#` fails if *name* does not exist!"
|
||||
],
|
||||
"example_usage": [
|
||||
"This creates a fresh rune which can do anything:",
|
||||
"",
|
||||
"```shell",
|
||||
"$ lightning-cli commando-rune",
|
||||
"{",
|
||||
" \"rune\": \"KUhZzNlECC7pYsz3QVbF1TqjIUYi3oyESTI7n60hLMs9MA==\",",
|
||||
" \"unique_id\": \"0\"",
|
||||
"}",
|
||||
"```",
|
||||
"We can add restrictions to that rune, like so:",
|
||||
"",
|
||||
"```shell",
|
||||
"$ lightning-cli commando-rune rune=KUhZzNlECC7pYsz3QVbF1TqjIUYi3oyESTI7n60hLMs9MA== restrictions=readonly",
|
||||
"{",
|
||||
" \"rune\": \"NbL7KkXcPQsVseJ9TdJNjJK2KsPjnt_q4cE_wvc873I9MCZtZXRob2RebGlzdHxtZXRob2ReZ2V0fG1ldGhvZD1zdW1tYXJ5Jm1ldGhvZC9saXN0ZGF0YXN0b3Jl\",",
|
||||
" \"unique_id\": \"0\"",
|
||||
"}",
|
||||
"```",
|
||||
"The \"readonly\" restriction is a short-cut for two restrictions:",
|
||||
"",
|
||||
"1. `[\"method^list\", \"method^get\", \"method=summary\"]`: You may call list, get or summary.",
|
||||
"2. `[\"method/listdatastore\"]`: But not listdatastore: that contains sensitive stuff!",
|
||||
"",
|
||||
"We can do the same manually, like so:",
|
||||
"",
|
||||
"```shell",
|
||||
"$ lightning-cli commando-rune rune=KUhZzNlECC7pYsz3QVbF1TqjIUYi3oyESTI7n60hLMs9MA== restrictions='[[\"method^list\", \"method^get\", \"method=summary\"],[\"method/listdatastore\"]]'",
|
||||
"{",
|
||||
" \"rune\": \"NbL7KkXcPQsVseJ9TdJNjJK2KsPjnt_q4cE_wvc873I9MCZtZXRob2RebGlzdHxtZXRob2ReZ2V0fG1ldGhvZD1zdW1tYXJ5Jm1ldGhvZC9saXN0ZGF0YXN0b3Jl\",",
|
||||
" \"unique_id\": \"0\"",
|
||||
"}",
|
||||
"```",
|
||||
"Let's create a rune which lets a specific peer (024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605) run \"listpeers\" on themselves:",
|
||||
"",
|
||||
"```shell",
|
||||
"$ lightning-cli commando-rune restrictions='[[\"id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605\"],[\"method=listpeers\"],[\"pnum=1\"],[\"pnameid=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605\",\"parr0=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605\"]]'",
|
||||
"{",
|
||||
" \"rune\": \"FE8GHiGVvxcFqCQcClVRRiNE_XEeLYQzyG2jmqto4jM9MiZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDV8cGFycjA9MDI0YjlhMWZhOGUwMDZmMWUzOTM3ZjY1ZjY2YzQwOGU2ZGE4ZTFjYTcyOGVhNDMyMjJhNzM4MWRmMWNjNDQ5NjA1\",",
|
||||
" \"unique_id\": \"2\"",
|
||||
"}",
|
||||
"```",
|
||||
"This allows `listpeers` with 1 argument (`pnum=1`), which is either by name (`pnameid`), or position (`parr0`). We could shorten this in several ways: either allowing only positional or named parameters, or by testing the start of the parameters only. Here's an example which only checks the first 9 bytes of the `listpeers` parameter:",
|
||||
"",
|
||||
"```shell",
|
||||
"$ lightning-cli commando-rune restrictions='[[\"id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605\"],[\"method=listpeers\"],[\"pnum=1\"],[\"pnameid^024b9a1fa8e006f1e393\", \"parr0^024b9a1fa8e006f1e393\"]'",
|
||||
" {",
|
||||
" \"rune\": \"fTQnfL05coEbiBO8SS0cvQwCcPLxE9c02pZCC6HRVEY9MyZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZF4wMjRiOWExZmE4ZTAwNmYxZTM5M3xwYXJyMF4wMjRiOWExZmE4ZTAwNmYxZTM5Mw==\",",
|
||||
" \"unique_id\": \"3\"",
|
||||
"}",
|
||||
"```",
|
||||
"Before we give this to our peer, let's add two more restrictions: that it only be usable for 24 hours from now (`time<`), and that it can only be used twice a minute (`rate=2`). `date +%s` can give us the current time in seconds:",
|
||||
"",
|
||||
"```shell",
|
||||
"$ lightning-cli commando-rune rune=fTQnfL05coEbiBO8SS0cvQwCcPLxE9c02pZCC6HRVEY9MyZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZF4wMjRiOWExZmE4ZTAwNmYxZTM5M3xwYXJyMF4wMjRiOWExZmE4ZTAwNmYxZTM5Mw== restrictions='[[\"time<'$(($(date +%s) + 24*60*60))'\",\"rate=2\"]]'",
|
||||
"{",
|
||||
" \"rune\": \"tU-RLjMiDpY2U0o3W1oFowar36RFGpWloPbW9-RuZdo9MyZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZF4wMjRiOWExZmE4ZTAwNmYxZTM5M3xwYXJyMF4wMjRiOWExZmE4ZTAwNmYxZTM5MyZ0aW1lPDE2NTY5MjA1MzgmcmF0ZT0y\",",
|
||||
" \"unique_id\": \"3\"",
|
||||
"}",
|
||||
"```",
|
||||
"You can also use lightning-decode(7) to examine runes you have been given:",
|
||||
"",
|
||||
"```shell",
|
||||
"$ lightning-cli decode tU-RLjMiDpY2U0o3W1oFowar36RFGpWloPbW9-RuZdo9MyZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZF4wMjRiOWExZmE4ZTAwNmYxZTM5M3xwYXJyMF4wMjRiOWExZmE4ZTAwNmYxZTM5MyZ0aW1lPDE2NTY5MjA1MzgmcmF0ZT0y",
|
||||
"{",
|
||||
" \"type\": \"rune\",",
|
||||
" \"unique_id\": \"3\",",
|
||||
" \"string\": \"b54f912e33220e9636534a375b5a05a306abdfa4451a95a5a0f6d6f7e46e65da:=3&id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605&method=listpeers&pnum=1&pnameid^024b9a1fa8e006f1e393|parr0^024b9a1fa8e006f1e393&time<1656920538&rate=2\",",
|
||||
" \"restrictions\": [",
|
||||
" {",
|
||||
" \"alternatives\": [",
|
||||
" \"id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605\"",
|
||||
" ],",
|
||||
" \"summary\": \"id (of commanding peer) equal to '024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605'\"",
|
||||
" },",
|
||||
" {",
|
||||
" \"alternatives\": [",
|
||||
" \"method=listpeers\"",
|
||||
" ],",
|
||||
" \"summary\": \"method (of command) equal to 'listpeers'\"",
|
||||
" },",
|
||||
" {",
|
||||
" \"alternatives\": [",
|
||||
" \"pnum=1\"",
|
||||
" ],",
|
||||
" \"summary\": \"pnum (number of command parameters) equal to 1\"",
|
||||
" },",
|
||||
" {",
|
||||
" \"alternatives\": [",
|
||||
" \"pnameid^024b9a1fa8e006f1e393\",",
|
||||
" \"parr0^024b9a1fa8e006f1e393\"",
|
||||
" ],",
|
||||
" \"summary\": \"pnameid (object parameter 'id') starts with '024b9a1fa8e006f1e393' OR parr0 (array parameter #0) starts with '024b9a1fa8e006f1e393'\"",
|
||||
" },",
|
||||
" {",
|
||||
" \"alternatives\": [",
|
||||
" \"time<1656920538\"",
|
||||
" ],",
|
||||
" \"summary\": \"time (in seconds since 1970) less than 1656920538 (approximately 19 hours 18 minutes from now)\"",
|
||||
" },",
|
||||
" {",
|
||||
" \"alternatives\": [",
|
||||
" \"rate=2\"",
|
||||
" ],",
|
||||
" \"summary\": \"rate (max per minute) equal to 2\"",
|
||||
" }",
|
||||
" ],",
|
||||
" \"valid\": true",
|
||||
"}",
|
||||
"```"
|
||||
],
|
||||
"sharing_runes": [
|
||||
"Because anyone can add a restriction to a rune, you can always turn a normal rune into a read-only rune, or restrict access for 30 minutes from the time you give it to someone. Adding restrictions before sharing runes is best practice.",
|
||||
"",
|
||||
"If a rune has a ratelimit, any derived rune will have the same id, and thus will compete for that ratelimit. You might want to consider adding a tighter ratelimit to a rune before sharing it, so you will keep the remainder. For example, if you rune has a limit of 60 times per minute, adding a limit of 5 times per minute and handing that rune out means you can still use your original rune 55 times per minute."
|
||||
],
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:commando-rune#1",
|
||||
"method": "commando-rune",
|
||||
"params": "{}"
|
||||
},
|
||||
{
|
||||
"id": "example:commando-rune#2",
|
||||
"method": "commando-rune",
|
||||
"params": {
|
||||
"restrictions": "readonly"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "example:commando-rune#3",
|
||||
"method": "commando-rune",
|
||||
"params": {
|
||||
"restrictions": [
|
||||
[
|
||||
"id^022d223620a359a47ff7"
|
||||
],
|
||||
[
|
||||
"method=listpeers"
|
||||
]
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "example:commando-rune#4",
|
||||
"method": "commando-rune",
|
||||
"params": {
|
||||
"restrictions": [
|
||||
[
|
||||
"method=pay"
|
||||
],
|
||||
[
|
||||
"pnameamountmsat<10000"
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"rune": "OSqc7ixY6F-gjcigBfxtzKUI54uzgFSA6YfBQoWGDV89MA==",
|
||||
"unique_id": "0",
|
||||
"warning_unrestricted_rune": "WARNING: This rune has no restrictions! Anyone who has access to this rune could drain funds from your node. Be careful when giving this to apps that you don't trust. Consider using the restrictions parameter to only allow access to specific rpc methods."
|
||||
},
|
||||
{
|
||||
"rune": "zm0x_eLgHexaTvZn3Cz7gb_YlvrlYGDo_w4BYlR9SS09MSZtZXRob2RebGlzdHxtZXRob2ReZ2V0fG1ldGhvZD1zdW1tYXJ5Jm1ldGhvZC9saXN0ZGF0YXN0b3Jl",
|
||||
"unique_id": "1"
|
||||
},
|
||||
{
|
||||
"rune": "YPojv9qgHPa3im0eiqRb-g8aRq76OasyfltGGqdFUOU9MyZpZF4wMjJkMjIzNjIwYTM1OWE0N2ZmNyZtZXRob2Q9bGlzdHBlZXJz",
|
||||
"unique_id": "2"
|
||||
},
|
||||
{
|
||||
"rune": "b3hXuEM7Pqzk-C7HUw83xzvHOV7fmuGaWjdo-wHdfg89MCZtZXRob2Q9cGF5JnBuYW1lYW1vdW50bXNhdDwxMDAwMA==",
|
||||
"unique_id": "3"
|
||||
}
|
||||
],
|
||||
"author": [
|
||||
"Rusty Russell <<rusty@rustcorp.com.au>> wrote the original Python commando.py plugin, the in-tree commando plugin, and this manual page.",
|
||||
"",
|
||||
"Christian Decker came up with the name \"commando\", which almost excuses his previous adoption of the name \"Eltoo\"."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-commando(7)",
|
||||
"lightning-decode(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
183
doc/schemas/lightning-commando.json
Normal file
183
doc/schemas/lightning-commando.json
Normal file
|
@ -0,0 +1,183 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"rpc": "commando",
|
||||
"title": "Command to Send a Command to a Remote Peer",
|
||||
"description": [
|
||||
"The **commando** RPC command is a homage to bad 80s movies. It also sends a directly-connected *peer_id* a custom message, containing a request to run *method* (with an optional dictionary of *params*); generally the peer will only allow you to run a command if it has provided you with a *rune* which allows it."
|
||||
],
|
||||
"request": {
|
||||
"required": [
|
||||
"peer_id",
|
||||
"method"
|
||||
],
|
||||
"properties": {
|
||||
"peer_id": {
|
||||
"type": "pubkey",
|
||||
"description": [
|
||||
"Peer to command."
|
||||
]
|
||||
},
|
||||
"method": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Method to invoke on peer."
|
||||
]
|
||||
},
|
||||
"params": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "array",
|
||||
"description": [
|
||||
"Array of positional parameters."
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"description": [
|
||||
"Parameters for method."
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"rune": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Rune to authorize the command."
|
||||
]
|
||||
},
|
||||
"filter": {
|
||||
"type": "object",
|
||||
"description": [
|
||||
"Filter to peer to apply to any successful result."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [],
|
||||
"properties": {},
|
||||
"pre_return_value_notes": [
|
||||
"On success, the return depends on the *method* invoked."
|
||||
]
|
||||
},
|
||||
"errors": [
|
||||
"On failure, one of the following error codes may be returned:",
|
||||
"",
|
||||
"- -32600: Usually means peer is not connected",
|
||||
"- 19535: the local commando plugin discovered an error.",
|
||||
"- 19536: the remote commando plugin discovered an error.",
|
||||
"- 19537: the remote commando plugin said we weren't authorized.",
|
||||
"",
|
||||
"It can also fail if the peer does not respond, in which case it will simply hang awaiting a response."
|
||||
],
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:commando#1",
|
||||
"method": "commando",
|
||||
"params": {
|
||||
"peer_id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518",
|
||||
"rune": "zm0x_eLgHexaTvZn3Cz7gb_YlvrlYGDo_w4BYlR9SS09MSZtZXRob2RebGlzdHxtZXRob2ReZ2V0fG1ldGhvZD1zdW1tYXJ5Jm1ldGhvZC9saXN0ZGF0YXN0b3Jl",
|
||||
"method": "getinfo",
|
||||
"params": {}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "example:commando#2",
|
||||
"method": "commando",
|
||||
"params": {
|
||||
"peer_id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518",
|
||||
"rune": "m_tyR0qqHUuLEbFJW6AhmBg-9npxVX2yKocQBFi9cvY9MyZpZF4wMjJkMjIzNjIwYTM1OWE0N2ZmNyZtZXRob2Q9bGlzdHBlZXJzJnBuYW1lbGV2ZWwhfHBuYW1lbGV2ZWwvaW8mcGFycjEhfHBhcnIxL2lv",
|
||||
"method": "listpeers",
|
||||
"params": [
|
||||
"022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59",
|
||||
"broken"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "example:commando#3",
|
||||
"method": "commando",
|
||||
"params": {
|
||||
"peer_id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518",
|
||||
"rune": "b3hXuEM7Pqzk-C7HUw83xzvHOV7fmuGaWjdo-wHdfg89MCZtZXRob2Q9cGF5JnBuYW1lYW1vdW50bXNhdDwxMDAwMA==",
|
||||
"method": "pay",
|
||||
"params": {
|
||||
"bolt11": "lnbcrt1pja05v6sp5n6gnm380ckkrnhzvytz0hvym0vcf0mlrk586nlp72cq7e2hhhffspp5cwhuvl4jhlqep3st2703z89jp7j6wucm8ytlj7rk9ckk0mv7whysdq5v3jhxcmjd9c8g6t0dceqxqyjw5qcqp99qxpqysgq40udwjtktkry0yyq9408q5vtmj534h88j5nn562lamam0rtfqfu3093t2dhhc63qnqe5maa5jc9ad5pm08q2k2udvp6skw9f6ez9c9qptatlau",
|
||||
"amount_msat": 9999
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518",
|
||||
"alias": "JUNIORBEAM-v23.11-415-gd120eba",
|
||||
"color": "0266e4",
|
||||
"num_peers": 1,
|
||||
"num_pending_channels": 0,
|
||||
"num_active_channels": 0,
|
||||
"num_inactive_channels": 0,
|
||||
"address": [],
|
||||
"binding": [
|
||||
{
|
||||
"type": "ipv4",
|
||||
"address": "127.0.0.1",
|
||||
"port": 42513
|
||||
}
|
||||
],
|
||||
"version": "v23.11-415-gd120eba",
|
||||
"blockheight": 101,
|
||||
"network": "regtest",
|
||||
"fees_collected_msat": 0,
|
||||
"lightning-dir": "/tmp/ltests-7u_8_rtu/test_commando_rune_1/lightning-1/regtest",
|
||||
"our_features": {
|
||||
"init": "08a0000a8a5961",
|
||||
"node": "88a0000a8a5961",
|
||||
"channel": "",
|
||||
"invoice": "02000002024100"
|
||||
}
|
||||
},
|
||||
{
|
||||
"peers": [
|
||||
{
|
||||
"id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59",
|
||||
"connected": true,
|
||||
"num_channels": 0,
|
||||
"netaddr": [
|
||||
"127.0.0.1:40119"
|
||||
],
|
||||
"features": "08a0000a8a5961",
|
||||
"log": [
|
||||
{
|
||||
"type": "SKIPPED",
|
||||
"num_skipped": 30
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"destination": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59",
|
||||
"payment_hash": "c3afc67eb2bfc190c60b579f111cb20fa5a7731b3917f978762e2d67ed9e75c9",
|
||||
"created_at": 1708642714.8110592,
|
||||
"parts": 1,
|
||||
"amount_msat": 9999,
|
||||
"amount_sent_msat": 9999,
|
||||
"payment_preimage": "17632717785b1a833a296ba1831cb968602872e68881c2f324e06e87979296dc",
|
||||
"status": "complete"
|
||||
}
|
||||
],
|
||||
"author": [
|
||||
"Rusty Russell <<rusty@rustcorp.com.au>> wrote the original Python commando.py plugin, the in-tree commando plugin, and this manual page.",
|
||||
"",
|
||||
"Christian Decker came up with the name \"commando\", which almost excuses his previous adoption of the name \"Eltoo\"."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-commando-rune(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
228
doc/schemas/lightning-connect.json
Normal file
228
doc/schemas/lightning-connect.json
Normal file
|
@ -0,0 +1,228 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"rpc": "connect",
|
||||
"title": "Command for connecting to another lightning node",
|
||||
"description": [
|
||||
"The **connect** RPC command establishes a new connection with another node in the Lightning Network.",
|
||||
"",
|
||||
"Connecting to a node is just the first step in opening a channel with another node. Once the peer is connected a channel can be opened with lightning-fundchannel(7).",
|
||||
"",
|
||||
"If there are active channels with the peer, **connect** returns once all the subdaemons are in place to handle the channels, not just once it's connected."
|
||||
],
|
||||
"request": {
|
||||
"required": [
|
||||
"id"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The target node's public key. As a convenience, *id* may be of the form *id@host* or *id@host:port*. In this case, the *host* and *port* parameters must be omitted. This can fail if your C-lightning node is a fresh install that has not connected to any peers yet (your node has no gossip yet), or if the target *id* is a fresh install that has no channels yet (nobody will gossip about a node until it has one published channel)."
|
||||
]
|
||||
},
|
||||
"host": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The peer's hostname or IP address. If *host* is not specified (or doesn't work), the connection will be attempted to an IP belonging to *id* obtained through gossip with other already connected peers. If *host* begins with a `/` it is interpreted as a local path and the connection will be made to that local socket (see **bind-addr** in lightningd-config(5))."
|
||||
]
|
||||
},
|
||||
"port": {
|
||||
"type": "u16",
|
||||
"description": [
|
||||
"The peer's port number. If not specified, the *port* depends on the current network:",
|
||||
" * bitcoin **mainnet**: 9735.",
|
||||
" * bitcoin **testnet**: 19735.",
|
||||
" * bitcoin **signet**: 39735.",
|
||||
" * bitcoin **regtest**: 19846."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"id",
|
||||
"features",
|
||||
"direction",
|
||||
"address"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "pubkey",
|
||||
"description": [
|
||||
"The peer we connected to."
|
||||
]
|
||||
},
|
||||
"features": {
|
||||
"type": "hex",
|
||||
"description": [
|
||||
"BOLT 9 features bitmap offered by peer."
|
||||
]
|
||||
},
|
||||
"direction": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"in",
|
||||
"out"
|
||||
],
|
||||
"description": [
|
||||
"Whether they initiated connection or we did."
|
||||
]
|
||||
},
|
||||
"address": {
|
||||
"type": "object",
|
||||
"description": [
|
||||
"Address information (mainly useful if **direction** is *out*)."
|
||||
],
|
||||
"additionalProperties": true,
|
||||
"required": [
|
||||
"type"
|
||||
],
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"local socket",
|
||||
"ipv4",
|
||||
"ipv6",
|
||||
"torv2",
|
||||
"torv3"
|
||||
],
|
||||
"description": [
|
||||
"Type of connection (*torv2*/*torv3* only if **direction** is *out*)."
|
||||
]
|
||||
}
|
||||
},
|
||||
"allOf": [
|
||||
{
|
||||
"if": {
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"local socket"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"then": {
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"socket"
|
||||
],
|
||||
"properties": {
|
||||
"type": {},
|
||||
"socket": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Socket filename."
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"if": {
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"ipv4",
|
||||
"ipv6",
|
||||
"torv2",
|
||||
"torv3"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"then": {
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"address",
|
||||
"port"
|
||||
],
|
||||
"properties": {
|
||||
"type": {},
|
||||
"address": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Address in expected format for **type**."
|
||||
]
|
||||
},
|
||||
"port": {
|
||||
"type": "u16",
|
||||
"description": [
|
||||
"Port number."
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"errors": [
|
||||
"On failure, one of the following errors will be returned:",
|
||||
"",
|
||||
"- 400: Unable to connect, no address known for peer",
|
||||
"- 401: If some addresses are known but connecting to all of them failed, the message will contain details about the failures",
|
||||
"- 402: If the peer disconnected while we were connecting",
|
||||
"- -32602: If the given parameters are wrong"
|
||||
],
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:connect#1",
|
||||
"method": "connect",
|
||||
"params": {
|
||||
"id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59",
|
||||
"host": "localhost",
|
||||
"port": 44619
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "example:connect#2",
|
||||
"method": "connect",
|
||||
"params": {
|
||||
"id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59",
|
||||
"host": "127.0.0.1",
|
||||
"port": 42839
|
||||
}
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59",
|
||||
"features": "08a0000a0a69a2",
|
||||
"direction": "out",
|
||||
"address": {
|
||||
"type": "ipv4",
|
||||
"address": "127.0.0.1",
|
||||
"port": 44619
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59",
|
||||
"features": "08a0000a8a5961",
|
||||
"direction": "out",
|
||||
"address": {
|
||||
"type": "ipv4",
|
||||
"address": "127.0.0.1",
|
||||
"port": 42839
|
||||
}
|
||||
}
|
||||
],
|
||||
"author": [
|
||||
"Rusty Russell <<rusty@rustcorp.com.au>> is mainly responsible. Felix <<fixone@gmail.com>> is the original author of this manpage."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-fundchannel(7)",
|
||||
"lightning-listpeers(7)",
|
||||
"lightning-listchannels(7)",
|
||||
"lightning-disconnect(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
207
doc/schemas/lightning-createinvoice.json
Normal file
207
doc/schemas/lightning-createinvoice.json
Normal file
|
@ -0,0 +1,207 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"rpc": "createinvoice",
|
||||
"title": "Low-level invoice creation",
|
||||
"description": [
|
||||
"The **createinvoice** RPC command signs and saves an invoice into the database."
|
||||
],
|
||||
"request": {
|
||||
"required": [
|
||||
"invstring",
|
||||
"label",
|
||||
"preimage"
|
||||
],
|
||||
"properties": {
|
||||
"invstring": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The bolt11 form, but the final signature is ignored. Minimal sanity checks are done. (Note: if **experimental-offers** is enabled, *invstring* can actually be an unsigned bolt12 invoice)."
|
||||
]
|
||||
},
|
||||
"label": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"type": "integer"
|
||||
}
|
||||
],
|
||||
"description": [
|
||||
"A unique string or number (which is treated as a string, so `01` is different from `1`); it is never revealed to other nodes on the lightning network, but it can be used to query the status of this invoice."
|
||||
]
|
||||
},
|
||||
"preimage": {
|
||||
"type": "hex",
|
||||
"description": [
|
||||
"The preimage to supply upon successful payment of the invoice."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"label",
|
||||
"created_index",
|
||||
"payment_hash",
|
||||
"status",
|
||||
"description",
|
||||
"expires_at"
|
||||
],
|
||||
"properties": {
|
||||
"label": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The label for the invoice."
|
||||
]
|
||||
},
|
||||
"bolt11": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The bolt11 string (always present unless **bolt12** is)."
|
||||
]
|
||||
},
|
||||
"bolt12": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The bolt12 string instead of **bolt11** (**experimental-offers** only)."
|
||||
]
|
||||
},
|
||||
"payment_hash": {
|
||||
"type": "hash",
|
||||
"description": [
|
||||
"The hash of the *payment_preimage* which will prove payment."
|
||||
]
|
||||
},
|
||||
"amount_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"The amount of the invoice (if it has one)."
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"paid",
|
||||
"expired",
|
||||
"unpaid"
|
||||
],
|
||||
"description": [
|
||||
"Whether it has been paid, or can no longer be paid."
|
||||
]
|
||||
},
|
||||
"description": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Description extracted from **bolt11** or **bolt12**."
|
||||
]
|
||||
},
|
||||
"expires_at": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"UNIX timestamp of when invoice expires (or expired)."
|
||||
]
|
||||
},
|
||||
"created_index": {
|
||||
"type": "u64",
|
||||
"added": "v23.08",
|
||||
"description": [
|
||||
"1-based index indicating order this invoice was created in."
|
||||
]
|
||||
},
|
||||
"pay_index": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"Incrementing id for when this was paid (**status** *paid* only)."
|
||||
]
|
||||
},
|
||||
"amount_received_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"Amount actually received (**status** *paid* only)."
|
||||
]
|
||||
},
|
||||
"paid_at": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"UNIX timestamp of when invoice was paid (**status** *paid* only)."
|
||||
]
|
||||
},
|
||||
"paid_outpoint": {
|
||||
"type": "object",
|
||||
"description": [
|
||||
"Outpoint this invoice was paid with (**status** *paid* only)."
|
||||
],
|
||||
"added": "v23.11",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"txid",
|
||||
"outnum"
|
||||
],
|
||||
"properties": {
|
||||
"txid": {
|
||||
"added": "v23.11",
|
||||
"type": "txid",
|
||||
"description": [
|
||||
"ID of the transaction that paid the invoice (**status** *paid* only)."
|
||||
]
|
||||
},
|
||||
"outnum": {
|
||||
"added": "v23.11",
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"The 0-based output number of the transaction that paid the invoice (**status** *paid* only)."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"payment_preimage": {
|
||||
"type": "secret",
|
||||
"description": [
|
||||
"The proof of payment: SHA256 of this **payment_hash**."
|
||||
]
|
||||
},
|
||||
"local_offer_id": {
|
||||
"type": "hex",
|
||||
"description": [
|
||||
"The *id* of our offer which created this invoice (**experimental-offers** only)."
|
||||
],
|
||||
"maxLength": 64,
|
||||
"minLength": 64
|
||||
},
|
||||
"invreq_payer_note": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The optional *invreq_payer_note* from invoice_request which created this invoice (**experimental-offers** only)."
|
||||
]
|
||||
}
|
||||
},
|
||||
"pre_return_value_notes": [
|
||||
"(Note: the return format is the same as lightning-listinvoices(7))."
|
||||
]
|
||||
},
|
||||
"errors": [
|
||||
"On failure, an error is returned and no invoice is created. If the lightning process fails before responding, the caller should use lightning-listinvoices(7) to query whether this invoice was created or not.",
|
||||
"",
|
||||
"The following error codes may occur:",
|
||||
"",
|
||||
"- -1: Catchall nonspecific error.",
|
||||
"- 900: An invoice with the given *label* already exists."
|
||||
],
|
||||
"author": [
|
||||
"Rusty Russell <<rusty@rustcorp.com.au>> is mainly responsible."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-invoice(7)",
|
||||
"lightning-listinvoices(7)",
|
||||
"lightning-delinvoice(7)",
|
||||
"lightning-getroute(7)",
|
||||
"lightning-sendpay(7)",
|
||||
"lightning-offer(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
233
doc/schemas/lightning-createonion.json
Normal file
233
doc/schemas/lightning-createonion.json
Normal file
|
@ -0,0 +1,233 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"rpc": "createonion",
|
||||
"title": "Low-level command to create a custom onion",
|
||||
"description": [
|
||||
"The **createonion** RPC command allows the caller to create a custom onion with custom payloads at each hop in the route. A custom onion can be used to implement protocol extensions that are not supported by Core Lightning directly."
|
||||
],
|
||||
"request": {
|
||||
"required": [
|
||||
"hops",
|
||||
"assocdata"
|
||||
],
|
||||
"properties": {
|
||||
"hops": {
|
||||
"type": "array",
|
||||
"description": [
|
||||
"A JSON list of dicts, each specifying a node and the payload destined for that node."
|
||||
],
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"pubkey",
|
||||
"payload"
|
||||
],
|
||||
"properties": {
|
||||
"pubkey": {
|
||||
"type": "pubkey",
|
||||
"description": [
|
||||
"Node pubkey."
|
||||
]
|
||||
},
|
||||
"payload": {
|
||||
"type": "hex",
|
||||
"description": [
|
||||
"Payload to be sent to the node."
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"assocdata": {
|
||||
"type": "hex",
|
||||
"description": [
|
||||
"The associated data that the onion should commit to. If the onion is to be used to send a payment later it MUST match the `payment_hash` of the payment in order to be valid."
|
||||
]
|
||||
},
|
||||
"session_key": {
|
||||
"type": "secret",
|
||||
"description": [
|
||||
"Can be used to specify a secret that is used to generate the shared secrets used to encrypt the onion for each hop. It should only be used for testing or if a specific shared secret is important. If not specified it will be securely generated internally, and the shared secrets will be returned."
|
||||
]
|
||||
},
|
||||
"onion_size": {
|
||||
"type": "u16",
|
||||
"description": [
|
||||
"A size different from the default payment onion (1300 bytes). May be used for custom protocols like trampoline routing."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"onion",
|
||||
"shared_secrets"
|
||||
],
|
||||
"properties": {
|
||||
"onion": {
|
||||
"type": "hex",
|
||||
"description": [
|
||||
"The onion packet (*onion_size* bytes)."
|
||||
]
|
||||
},
|
||||
"shared_secrets": {
|
||||
"type": "array",
|
||||
"description": [
|
||||
"One shared secret for each node in the *hops* parameter."
|
||||
],
|
||||
"items": {
|
||||
"type": "secret",
|
||||
"description": [
|
||||
"The shared secret with this hop."
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"example_usage": [
|
||||
"The following is an example of a 3 hop onion:",
|
||||
"",
|
||||
"```json",
|
||||
"[",
|
||||
" {",
|
||||
" \"pubkey\": \"022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59\",",
|
||||
" \"payload\": \"11020203e904017b06080000670000010001\"",
|
||||
" }, {",
|
||||
" \"pubkey\": \"035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d\",",
|
||||
" \"payload\": \"11020203e804017506080000670000030001\"",
|
||||
" }, {",
|
||||
" \"pubkey\": \"0382ce59ebf18be7d84677c2e35f23294b9992ceca95491fcf8a56c6cb2d9de199\",",
|
||||
" \"payload\": \"07020203e8040175\"",
|
||||
" }",
|
||||
"]",
|
||||
"```",
|
||||
"",
|
||||
"The *hops* parameter is very similar to the result from `getroute` however it needs to be modified slightly. The following is the `getroute` response from which the above *hops* parameter was generated:",
|
||||
"",
|
||||
"```json",
|
||||
"[",
|
||||
" {",
|
||||
" \"id\": \"022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59\",",
|
||||
" \"channel\": \"103x2x1\",",
|
||||
" \"direction\": 1,",
|
||||
" \"msatoshi\": 1002,",
|
||||
" \"amount_msat\": \"1002msat\",",
|
||||
" \"delay\": 21,",
|
||||
" }, {",
|
||||
" \"id\": \"035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d\",",
|
||||
" \"channel\": \"103x1x1\",",
|
||||
" \"direction\": 0,",
|
||||
" \"msatoshi\": 1001,",
|
||||
" \"amount_msat\": \"1001msat\",",
|
||||
" \"delay\": 15,",
|
||||
" }, {",
|
||||
" \"id\": \"0382ce59ebf18be7d84677c2e35f23294b9992ceca95491fcf8a56c6cb2d9de199\",",
|
||||
" \"channel\": \"103x3x1\",",
|
||||
" \"direction\": 0,",
|
||||
" \"msatoshi\": 1000,",
|
||||
" \"amount_msat\": \"1000msat\",",
|
||||
" \"delay\": 9,",
|
||||
" }",
|
||||
"]",
|
||||
"```",
|
||||
"",
|
||||
" - Notice that the payload in the *hops* parameter is the hex-encoded TLV of the parameters in the `getroute` response, with length prepended as a `bigsize_t`.",
|
||||
" - Except for the pubkey, the values are shifted left by one, i.e., the 1st payload in `createonion` corresponds to the 2nd set of values from `getroute`.",
|
||||
" - The final payload is a copy of the last payload sans `channel`",
|
||||
"",
|
||||
"These rules are directly derived from the onion construction. Please refer BOLT 04 for details and rationale.",
|
||||
"",
|
||||
"The following example is the result of calling *createonion* with the above hops parameter:",
|
||||
"",
|
||||
" ```json",
|
||||
" {",
|
||||
" \"onion\": \"0003f3f80d2142b953319336d2fe4097[...]6af33fcf4fb113bce01f56dd62248a9e5fcbbfba35c\",",
|
||||
" \"shared_secrets\": [",
|
||||
" \"88ce98c73e4d9293ab1797b0a913fe9bca0213a566252047d01b8af6da871f3e\",",
|
||||
" \"4474d296810e57bd460ef8b83d2e7d288321f8a99ff7686f87384699747bcfc4\",",
|
||||
" \"2a862e4123e01799a732be487fbce297f7dc7cc1467e410f18369cfee476adc2\"",
|
||||
" ]",
|
||||
" }",
|
||||
"```",
|
||||
"",
|
||||
"The `onion` corresponds to 1366 hex-encoded bytes. Each shared secret consists of 32 hex-encoded bytes. Both arguments can be passed on to **sendonion**."
|
||||
],
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:createonion#1",
|
||||
"method": "createonion",
|
||||
"params": {
|
||||
"hops": [
|
||||
{
|
||||
"pubkey": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518",
|
||||
"payload": "e4000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
|
||||
},
|
||||
{
|
||||
"pubkey": "0324653eac434488002cc06bbfb7f10fe18991e35f9fe4302dbea6d2353dc0ab1c",
|
||||
"payload": "e30000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
|
||||
},
|
||||
{
|
||||
"pubkey": "027f31ebc5462c1fdce1b737ecff52d37d75dea43ce11c74d25aa297165faa2007",
|
||||
"payload": "e30000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
|
||||
},
|
||||
{
|
||||
"pubkey": "032c0b7cf95324a07d05398b240174dc0c2be444d96b159aa6c7f7b1e668680991",
|
||||
"payload": "e30000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
|
||||
},
|
||||
{
|
||||
"pubkey": "02edabbd16b41c8371b92ef2f04c1185b4f03b6dcd52ba9b78d9d7c89c8f221145",
|
||||
"payload": "e30000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
|
||||
}
|
||||
],
|
||||
"assocdata": "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB",
|
||||
"onion_size": 1301
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "example:createonion#2",
|
||||
"method": "createonion",
|
||||
"params": {
|
||||
"hops": [
|
||||
{
|
||||
"pubkey": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59",
|
||||
"payload": "0cfdb000084869207468657265"
|
||||
}
|
||||
],
|
||||
"assocdata": "36bf44cc8d80498b95eb05e36ae5811206d3a1d8b5c8d59bbcad035d386a4de8"
|
||||
}
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"onion": "00034c3f9e11d92555260db3ee4ba0378a645d01c2556451f4289a1d9b43c7afa9a4f9ecc7010dafb26787bb583c514c3b3990d40c8168b1046659d7bc2512d2f1ee0afd2b87c42de2b70102b649634d211b38049593dbb6ed8ee8f93f0b9ff23cd9654c1341137711ce67751d40867cc90c290a9446be2b8a5a43641d4549505b13e807b4240b5b82ffaf22cb534cff01be46db3985ac83b7db465fbd86d4c8d472f60678946c71eca97dd5db732fe5a6d3765e5a5afad72f035207173e7eaaa0da4f0a4540472c7dd269a030428ae586a61b2a70a428055c3848427d2a2e8bd521aadbaf79d56ea39df63c059772e026d57f0b6844c1ab99e936beadf42aaa78193b05f7380e242258deeaa90db316a943d311ef4f2a08f422422c9da454f9666742ad61c6ae003bce83cf6243adf64a728ea50bdaf129ab2ac70e1988a117609cbefc01c884f86b2494349d1067f5cf17760cdab6ae076631693147e8712412d4f0b17cf288b394fd9e29419156ee629966553c2e7598631cbf7493820388eef1ae9f4d2f9da88872e8afbbedb3b46cd7c461cbe4c5491dc6f4a68bc244584bc79b1bb227c869fae16dab4b16412523c984d3ed2b872f63b95a62f66563d2b03c3d1b5fff0290411b293569ce8435b96b447be776b49395a8d94f48cb2f7699a38e8de58d6fff04075d226dcac07668512b6d2c20d4c49d03ad300a52769e4ebbacf97378633126958df1817effc12fd679723123df244fd9b5421f8a2aedb9a8b6fb4049e3a7cae3985059081239bea38351f0c90ed5a0ff45cc492e6ab353e4c13d22ff48912d6ecfda711edfb88dc0767ecfc5dddf8fb0e112a538aeee55c0f73b3b8afc4f40ef3588eabde5b95344a4525adf67841dd67b1db10da180fb346e0bd2958f095d011827063c42361964f8ac2c356d2ec1868a9498dcd6b5915a4df4601c58fcbeb688e14de61300f13183c154b3320cc8e80042a46f22d796f56ff1fdd7e28440c05f14b960c1d0a7c627b09295112bcb635b0e2447a9374fafc4a23ceaf9de4d10b29b2f6cabd7f0c7706cf0404452681d7372d559b644627b2695960deb3b4ae57028e0164b29d5ef9e701d3122b6a5715c502e1dca5252e8c215ed754b01a193041ad9751ed2fff1b55991e256edd6099a38004a367ad097c7caf953da302201263715517f6d32cff57969be994df42fd6cadb649e3c738be798f779aaf4c07cada6bf1e4115b74e2670baf4b1592c70b10a6c043b6606b428b3f79545dc8e9783c876e5402909858f9c604963c37fbc477137c8908e6cfa11ece18c8784a6f25428a5ee1e91d0095fe310d6a91139a7c5c6624bbfcaa15ee847a25b06f57332917f68526a6317f575792e9bcba8576a96bc5859b1f2a00fd8ab08a5ac4ab71833b0b711d1f120cbdb374bcedcdcbeba3806644f5082ec737a945221f5d99562fcbb02a43beeafb16ceecd4e35f06a04c9ff9f4f33725ab62cf22c36650280e4cfb9e150a2c4ebee7785108522e8ecb4682d2d751168e7597299346c3a5e885e36eda66b9a1112997111135767972d771b02c1a36c1d1fb1ce539ecfb98e9e1d8f8fdbf89aec28ad34ff5c00c1a4a8c59848dc8b64c0e65f6f10122e60b4adc1cfc602f49d6cfbdd54be6b0951d3f9cafe8cdd0428f9ce6994844e92d8b72d44edda623bad428b398f88643c3904bda16dd15e886ca4ef6ea7f1450744ac38ffce902569d2e9026bcedd6d0ee54aceabda22bf2de72cba89e6c274064619e32a1192cf2d78b56cf497f7785a6d599de9f8383d1f66f47fc385dc569ee1f08ddbbc7f1aeb0a0126fc4020d948dda10255f11e776db7a037059a40fde38a2ee0c0ce49c7f3df175881bf12371fa72fec3fba657107892a97efe41dcc18aeecd99f3e46c33cf42c2a0ba8b75cf000",
|
||||
"shared_secrets": [
|
||||
"ccf2512684e2508cb4a842393757e6040b7d25e29d3a2031f29d00a000af6128",
|
||||
"d4cec39fe6287d41165bf5c608b0c720a411208a83c64c805a012c86662a2e5a",
|
||||
"91bc712ebd4a900e05830394ca8b1f1168777ecdd6996029d96ec8838b9903b9",
|
||||
"93c373dcb14dc36ababa3e0c5c55869a667ca175e09913a98c3be67e6af97e16",
|
||||
"b2642a5770a6b61ade071fdf69d3ea365cf48434fc2a2c399512778821a33e5c"
|
||||
]
|
||||
},
|
||||
{
|
||||
"onion": "0002cdce4bfaa9faa2c060afafe001b80bde07fc670e882c063a80b4738d5f78c9351825c6461cdfcd4fe4144d3b51f63da6351b28dd49c7bfdb0b4f7d8bda4ad0d99699eda39e551084c0a095746c358d1dc6d2eec8082f2aa2f69ae8f61b1f1437ae0ed673078fec6c0510a34058167ad1a34e819a3813d4cf27b2c4917a8c6ca3d70c3381a2a41b4c1b4540adf0e922e25f57d1cfc3064f29cfec4c17244160121975cab59b44c83b4a4905bf7ebfbd308de376334bf86d8aa92c674f7bcfec85680d73e9fee72642c98c603128e358c86e0bc88a60aaebc2637441a57261c61c6be145f00f2fc56164a6495f4b52d3172cb0ef52e91fa0d32a9ae2502d17433bda58d93fbc24a70ec6b5e740952a61404c7370eafe52599c7ee52e77b1cda87c46da98d2ff0d02fe09db5adcb2d2e9bcd083ef58392907b8a21681fa4ea1e4806b4676656457fea000fa504f9b4d159fe8b241266ac91dcc0351053c6dcc1493a6b02bed652cc8b92a8470c98924ebfde6ddc5cf7fd75f6e83a7350642053b70d4834179c30eb56d8c86656cda784daf3b6cd125779bec51099301e3f79f78d85d0454aef8bf5f9058491881b73e99b662b64080cd3eb16fd7f9d9640c18738736cfc15f391232b7df92f46ceb5abf08732ff833e9409ee541d7c926f7a0fe3e233d3eee4a63b65ab23b7c835b7cdd809ddfac8abb1df471fa66a54092815aa41e6fc1a026b86c5675d39c4e8c5c4b4acd48534165239f5634b9e828a7f9df94efcd2a39045efdee4d2f006a63ae828e6e90e3610c522085da6e0198141d6e501d83aba32057f4e59f9b7dfb0bf949c5ef91917cb54561d45a9e7ead049c57deb62d14ba6e18f5d7b0fb9f15e97bf5bd9f909f99c86c787357946654b87c489d34245d07fbb72119166e338b608a4178b452695235dd96bf7fd338e29a9f054ec1a63a442e12602d2329834297f6a197d8a377d608f402f0bcc936f45f33c8d2f9d40e5aef41816dd883add81ca20f1e0631457fe00aa2bd75c9165ffcd96c100c1db83a53aeee23d59f2a542ee3ba39ba62298ddfbd9ecfafd6b5d2121eb003ee23a2ebb8c6b6b687f42492c962510c5acf5231ff96635eba37354559ba39b042d9b6883cac662f418d7c62f9908b2a67964af5e5471804f7684e0d582b8bfec99816bb3442cca1d1fe4efd75d573ebf09fa9cad811063864fb14be4a7768ec2ddb118a77969e986c6584c4b20f8622941ca73d73562857d36e17a46a68d6e10147aaefff1ffb9809f0652a5f760148ed33550661b63c8176d5679e701c221d8a49d4062eb04010ea74cc1132fbeb8934c6e582ba2a16162b7e9171f95bce4ec3e339e70c781f95aaca406cd718b74397658fdefdd093486664be7ed13efa437012f1f57f9f1f4fb4eef7501ccf0e0ac4edc01fde138038c4dd65cb5c3291ad02a6728d6761b1afa35d49bd6ef117012bdd9bd6ee8a175620feb2249aa18d6175351b4bfc2b2b4fd57ff52f5969b109aa9b6cb2cde8f350917c0da2da1bc3d52eb0c7e6080b8f69c5783f2ed26feceb05ba4e7ed66676041d03d0acd3dd6343a85ac0b9c36f9640ddd0db884822f98dc42ea7911a6938dc14ba19d3d25a2b2f82794a2b5dd751dc856d7a9ccdb2d351a0b84e7030fa925ac949a37594f3aa2ba28ae5155b0aaac9c6820b8888d0b8a9db148513b9e3dbde68333ac30a0720289b6a0145d88629d49e76a6d3538330c5aececc9d54127b0a5a0e92d5a5a73beb71132c208b589cab61d53ed357c907929198c559426ae729b374a803dd3321a45ccca39efd39eddaba6e79a2f8911bdf74e18733dc7efc51132b5608d97fd2d0f22fa8961de04cdf6d0dbfbab21e362e7abaef3976f993088aa97ed3f1f4bcf3fffb012f583558bd2f15face9cba20b3e6754b70",
|
||||
"shared_secrets": [
|
||||
"3f53c03f98eb83db88ff97c2c4004051ce23265ed2414a7aebf7a3e7078839ab"
|
||||
]
|
||||
}
|
||||
],
|
||||
"author": [
|
||||
"Christian Decker <<decker.christian@gmail.com>> is mainly responsible."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-sendonion(7)",
|
||||
"lightning-getroute(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>",
|
||||
"",
|
||||
"[BOLT 04](https://github.com/lightning/bolts/blob/master/04-onion-routing.md)"
|
||||
]
|
||||
}
|
280
doc/schemas/lightning-createrune.json
Normal file
280
doc/schemas/lightning-createrune.json
Normal file
|
@ -0,0 +1,280 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"added": "v23.08",
|
||||
"rpc": "createrune",
|
||||
"title": "Command to Create/Update Rune for Authorizing Remote Peer Access",
|
||||
"description": [
|
||||
"The **createrune** RPC command creates a base64 string called a *rune* which can be used to access commands on this node. Each *rune* contains a unique id (a number starting at 0), and can have restrictions inside it. Nobody can remove restrictions from a rune: if you try, the rune will be rejected. There is no limit on how many runes you can issue; the node simply decodes and checks them as they are received.",
|
||||
"",
|
||||
"Oh, I almost forgot. Runes can also be invoked like in ancient times with the **invokerune** command. Feel the magical powers of a rune by invoking it."
|
||||
],
|
||||
"request": {
|
||||
"required": [],
|
||||
"properties": {
|
||||
"rune": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"If supplied, the restrictions are simple appended to that *rune* (it doesn't need to be a rune belonging to this node). If not supplied, a new *rune* is constructed, with a new unique id."
|
||||
]
|
||||
},
|
||||
"restrictions": {
|
||||
"description": [
|
||||
"It can be the string `readonly`, or an array of restrictions.",
|
||||
"Each restriction is an array of one or more alternatives, such as \"method is listpeers\", or \"method is listpeers OR time is before 2023\"."
|
||||
],
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "array",
|
||||
"description": [
|
||||
"Alternatives use a simple language to examine the command which is being run:",
|
||||
" * time: the current UNIX time, e.g. \"time<1656759180\".",
|
||||
" * id: the node_id of the peer, e.g. \"id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605\".",
|
||||
" * method: the command being run, e.g. \"method=withdraw\".",
|
||||
" * per: how often the rune can be used, with suffix \"sec\" (default), \"min\", \"hour\", \"day\" or \"msec\", \"usec\" or \"nsec\". e.g. \"per=5sec\".",
|
||||
" * rate: the rate limit, per minute, e.g. \"rate=60\" is equivalent to \"per=1sec\".",
|
||||
" * pnum: the number of parameters. e.g. \"pnum<2\".",
|
||||
" * pnameX: the parameter named X (with any punctuation like `_` removed). e.g. \"pnamedestination=1RustyRX2oai4EYYDpQGWvEL62BBGqN9T\".",
|
||||
" * parrN: the N'th parameter. e.g. \"parr0=1RustyRX2oai4EYYDpQGWvEL62BBGqN9T\"."
|
||||
],
|
||||
"items": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"readonly"
|
||||
],
|
||||
"description": [
|
||||
"A rune which allows most *get* and *list* commands, and the *summary* command."
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"rune",
|
||||
"unique_id"
|
||||
],
|
||||
"properties": {
|
||||
"rune": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The resulting rune."
|
||||
]
|
||||
},
|
||||
"unique_id": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The id of this rune: this is set at creation and cannot be changed (even as restrictions are added)."
|
||||
]
|
||||
},
|
||||
"warning_unrestricted_rune": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"A warning shown when runes are created with powers that could drain your node."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"restriction_format": [
|
||||
"Restrictions are one or more alternatives. Each alternative is *name* *operator* *value*. The valid names are shown above.",
|
||||
"",
|
||||
"Note that if a value contains `\\`, it must be preceeded by another `\\` to form valid JSON:",
|
||||
"* `=`: passes if equal ie. identical. e.g. `method=withdraw`",
|
||||
"* `/`: not equals, e.g. `method/withdraw`",
|
||||
"* `^`: starts with, e.g. `id^024b9a1fa8e006f1e3937f`",
|
||||
"* `$`: ends with, e.g. `id$381df1cc449605`.",
|
||||
"* `~`: contains, e.g. `id~006f1e3937f65f66c40`.",
|
||||
"* `<`: is a decimal integer, and is less than. e.g. `time<1656759180`",
|
||||
"* `>`: is a decimal integer, and is greater than. e.g. `time>1656759180`",
|
||||
"* `{`: preceeds in alphabetical order (or matches but is shorter),",
|
||||
" e.g. `id{02ff`.",
|
||||
"* `}`: follows in alphabetical order (or matches but is longer),",
|
||||
" e.g. `id}02ff`.",
|
||||
"* `#`: a comment, ignored, e.g. `dumb example#`.",
|
||||
"* `!`: only passes if the *name* does *not* exist. e.g. `pnamedestination!`.",
|
||||
"Every other operator except `#` fails if *name* does not exist!"
|
||||
],
|
||||
"example_usage": [
|
||||
"This creates a fresh rune which can do anything:",
|
||||
"",
|
||||
"```shell",
|
||||
"$ lightning-cli commando-rune",
|
||||
"{",
|
||||
" \"rune\": \"KUhZzNlECC7pYsz3QVbF1TqjIUYi3oyESTI7n60hLMs9MA==\",",
|
||||
" \"unique_id\": \"0\"",
|
||||
"}",
|
||||
"```",
|
||||
"We can add restrictions to that rune, like so:",
|
||||
"",
|
||||
"```shell",
|
||||
"$ lightning-cli commando-rune rune=KUhZzNlECC7pYsz3QVbF1TqjIUYi3oyESTI7n60hLMs9MA== restrictions=readonly",
|
||||
"{",
|
||||
" \"rune\": \"NbL7KkXcPQsVseJ9TdJNjJK2KsPjnt_q4cE_wvc873I9MCZtZXRob2RebGlzdHxtZXRob2ReZ2V0fG1ldGhvZD1zdW1tYXJ5Jm1ldGhvZC9saXN0ZGF0YXN0b3Jl\",",
|
||||
" \"unique_id\": \"0\"",
|
||||
"}",
|
||||
"```",
|
||||
"The \"readonly\" restriction is a short-cut for two restrictions:",
|
||||
"",
|
||||
"1. `[\"method^list\", \"method^get\", \"method=summary\"]`: You may call list, get or summary.",
|
||||
"2. `[\"method/listdatastore\"]`: But not listdatastore: that contains sensitive stuff!",
|
||||
"",
|
||||
"We can do the same manually, like so:",
|
||||
"",
|
||||
"```shell",
|
||||
"$ lightning-cli commando-rune rune=KUhZzNlECC7pYsz3QVbF1TqjIUYi3oyESTI7n60hLMs9MA== restrictions='[[\"method^list\", \"method^get\", \"method=summary\"],[\"method/listdatastore\"]]'",
|
||||
"{",
|
||||
" \"rune\": \"NbL7KkXcPQsVseJ9TdJNjJK2KsPjnt_q4cE_wvc873I9MCZtZXRob2RebGlzdHxtZXRob2ReZ2V0fG1ldGhvZD1zdW1tYXJ5Jm1ldGhvZC9saXN0ZGF0YXN0b3Jl\",",
|
||||
" \"unique_id\": \"0\"",
|
||||
"}",
|
||||
"```",
|
||||
"Let's create a rune which lets a specific peer (024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605) run \"listpeers\" on themselves:",
|
||||
"",
|
||||
"```shell",
|
||||
"$ lightning-cli commando-rune restrictions='[[\"id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605\"],[\"method=listpeers\"],[\"pnum=1\"],[\"pnameid=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605\",\"parr0=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605\"]]'",
|
||||
"{",
|
||||
" \"rune\": \"FE8GHiGVvxcFqCQcClVRRiNE_XEeLYQzyG2jmqto4jM9MiZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDV8cGFycjA9MDI0YjlhMWZhOGUwMDZmMWUzOTM3ZjY1ZjY2YzQwOGU2ZGE4ZTFjYTcyOGVhNDMyMjJhNzM4MWRmMWNjNDQ5NjA1\",",
|
||||
" \"unique_id\": \"2\"",
|
||||
"}",
|
||||
"```",
|
||||
"This allows `listpeers` with 1 argument (`pnum=1`), which is either by name (`pnameid`), or position (`parr0`). We could shorten this in several ways: either allowing only positional or named parameters, or by testing the start of the parameters only. Here's an example which only checks the first 9 bytes of the `listpeers` parameter:",
|
||||
"",
|
||||
"```shell",
|
||||
"$ lightning-cli commando-rune restrictions='[[\"id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605\"],[\"method=listpeers\"],[\"pnum=1\"],[\"pnameid^024b9a1fa8e006f1e393\", \"parr0^024b9a1fa8e006f1e393\"]'",
|
||||
" {",
|
||||
" \"rune\": \"fTQnfL05coEbiBO8SS0cvQwCcPLxE9c02pZCC6HRVEY9MyZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZF4wMjRiOWExZmE4ZTAwNmYxZTM5M3xwYXJyMF4wMjRiOWExZmE4ZTAwNmYxZTM5Mw==\",",
|
||||
" \"unique_id\": \"3\"",
|
||||
"}",
|
||||
"```",
|
||||
"Before we give this to our peer, let's add two more restrictions: that it only be usable for 24 hours from now (`time<`), and that it can only be used twice a minute (`rate=2`). `date +%s` can give us the current time in seconds:",
|
||||
"",
|
||||
"```shell",
|
||||
"$ lightning-cli commando-rune rune=fTQnfL05coEbiBO8SS0cvQwCcPLxE9c02pZCC6HRVEY9MyZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZF4wMjRiOWExZmE4ZTAwNmYxZTM5M3xwYXJyMF4wMjRiOWExZmE4ZTAwNmYxZTM5Mw== restrictions='[[\"time<'$(($(date +%s) + 24*60*60))'\",\"rate=2\"]]'",
|
||||
"{",
|
||||
" \"rune\": \"tU-RLjMiDpY2U0o3W1oFowar36RFGpWloPbW9-RuZdo9MyZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZF4wMjRiOWExZmE4ZTAwNmYxZTM5M3xwYXJyMF4wMjRiOWExZmE4ZTAwNmYxZTM5MyZ0aW1lPDE2NTY5MjA1MzgmcmF0ZT0y\",",
|
||||
" \"unique_id\": \"3\"",
|
||||
"}",
|
||||
"```",
|
||||
"You can also use lightning-decode(7) to examine runes you have been given:",
|
||||
"",
|
||||
"```shell",
|
||||
"$ lightning-cli decode tU-RLjMiDpY2U0o3W1oFowar36RFGpWloPbW9-RuZdo9MyZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZF4wMjRiOWExZmE4ZTAwNmYxZTM5M3xwYXJyMF4wMjRiOWExZmE4ZTAwNmYxZTM5MyZ0aW1lPDE2NTY5MjA1MzgmcmF0ZT0y",
|
||||
"{",
|
||||
" \"type\": \"rune\",",
|
||||
" \"unique_id\": \"3\",",
|
||||
" \"string\": \"b54f912e33220e9636534a375b5a05a306abdfa4451a95a5a0f6d6f7e46e65da:=3&id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605&method=listpeers&pnum=1&pnameid^024b9a1fa8e006f1e393|parr0^024b9a1fa8e006f1e393&time<1656920538&rate=2\",",
|
||||
" \"restrictions\": [",
|
||||
" {",
|
||||
" \"alternatives\": [",
|
||||
" \"id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605\"",
|
||||
" ],",
|
||||
" \"summary\": \"id (of commanding peer) equal to '024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605'\"",
|
||||
" },",
|
||||
" {",
|
||||
" \"alternatives\": [",
|
||||
" \"method=listpeers\"",
|
||||
" ],",
|
||||
" \"summary\": \"method (of command) equal to 'listpeers'\"",
|
||||
" },",
|
||||
" {",
|
||||
" \"alternatives\": [",
|
||||
" \"pnum=1\"",
|
||||
" ],",
|
||||
" \"summary\": \"pnum (number of command parameters) equal to 1\"",
|
||||
" },",
|
||||
" {",
|
||||
" \"alternatives\": [",
|
||||
" \"pnameid^024b9a1fa8e006f1e393\",",
|
||||
" \"parr0^024b9a1fa8e006f1e393\"",
|
||||
" ],",
|
||||
" \"summary\": \"pnameid (object parameter 'id') starts with '024b9a1fa8e006f1e393' OR parr0 (array parameter #0) starts with '024b9a1fa8e006f1e393'\"",
|
||||
" },",
|
||||
" {",
|
||||
" \"alternatives\": [",
|
||||
" \"time<1656920538\"",
|
||||
" ],",
|
||||
" \"summary\": \"time (in seconds since 1970) less than 1656920538 (approximately 19 hours 18 minutes from now)\"",
|
||||
" },",
|
||||
" {",
|
||||
" \"alternatives\": [",
|
||||
" \"rate=2\"",
|
||||
" ],",
|
||||
" \"summary\": \"rate (max per minute) equal to 2\"",
|
||||
" }",
|
||||
" ],",
|
||||
" \"valid\": true",
|
||||
"}",
|
||||
"```"
|
||||
],
|
||||
"sharing_runes": [
|
||||
"Because anyone can add a restriction to a rune, you can always turn a normal rune into a read-only rune, or restrict access for 30 minutes from the time you give it to someone. Adding restrictions before sharing runes is best practice.",
|
||||
"",
|
||||
"If a rune has a ratelimit, any derived rune will have the same id, and thus will compete for that ratelimit. You might want to consider adding a tighter ratelimit to a rune before sharing it, so you will keep the remainder. For example, if you rune has a limit of 60 times per minute, adding a limit of 5 times per minute and handing that rune out means you can still use your original rune 55 times per minute."
|
||||
],
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:createrune#1",
|
||||
"method": "createrune",
|
||||
"params": {
|
||||
"restrictions": [
|
||||
[
|
||||
"method/getinfo"
|
||||
]
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "example:createrune#2",
|
||||
"method": "createrune",
|
||||
"params": {
|
||||
"restrictions": "readonly"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "example:createrune#3",
|
||||
"method": "createrune",
|
||||
"params": [
|
||||
"enX0sTpHB8y1ktyTAF80CnEvGetG340Ne3AGItudBS49NCZwbnVtPTA=",
|
||||
[
|
||||
[
|
||||
"rate=3"
|
||||
]
|
||||
]
|
||||
]
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"rune": "S5f-BKt3rR-cvJmujdpDCUQm_XLahfB4iQuDlwqMJiQ9MCZtZXRob2QvZ2V0aW5mbw==",
|
||||
"unique_id": "0"
|
||||
},
|
||||
{
|
||||
"rune": "oVkzoiQ67VCU1h_aRjPqCeWktGX54ARDsqqQgDL-uMs9MCZtZXRob2RebGlzdHxtZXRob2ReZ2V0fG1ldGhvZD1zdW1tYXJ5Jm1ldGhvZC9saXN0ZGF0YXN0b3Jl",
|
||||
"unique_id": "1"
|
||||
},
|
||||
{
|
||||
"rune": "_h2eKjoK7ITAF-JQ1S5oum9oMQesrz-t1FR9kDChRB49NCZwbnVtPTAmcmF0ZT0z",
|
||||
"unique_id": "2"
|
||||
}
|
||||
],
|
||||
"author": [
|
||||
"Rusty Russell <<rusty@rustcorp.com.au>> wrote the original Python commando.py plugin, the in-tree commando plugin, and this manual page.",
|
||||
"",
|
||||
"Shahana Farooqui <<sfarooqui@blockstream.com>> is mainly responsible for migrating commando-rune to createrune."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-commando-rune(7)",
|
||||
"lightning-checkrune(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
203
doc/schemas/lightning-datastore.json
Normal file
203
doc/schemas/lightning-datastore.json
Normal file
|
@ -0,0 +1,203 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"rpc": "datastore",
|
||||
"title": "Command for storing (plugin) data",
|
||||
"description": [
|
||||
"The **datastore** RPC command allows plugins to store data in the Core Lightning database, for later retrieval."
|
||||
],
|
||||
"request": {
|
||||
"required": [
|
||||
"key"
|
||||
],
|
||||
"properties": {
|
||||
"key": {
|
||||
"description": [
|
||||
"A key can either have children or a value, never both: parents are created and removed automatically."
|
||||
],
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "array",
|
||||
"description": [
|
||||
"An array of values to form a hierarchy (though a single value is treated as a one-element array). Using the first element of the key as the plugin name (e.g. `[ 'summary' ]`) is recommended."
|
||||
],
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
},
|
||||
"string": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Data to be saved in string format."
|
||||
]
|
||||
},
|
||||
"hex": {
|
||||
"type": "hex",
|
||||
"description": [
|
||||
"Data to be saved in hex format."
|
||||
]
|
||||
},
|
||||
"mode": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Write mode to determine how the record is updated:",
|
||||
" * `must-create`: fails if it already exists.",
|
||||
" * `must-replace`: fails if it doesn't already exist.",
|
||||
" * `create-or-replace`: never fails.",
|
||||
" * `must-append`: must already exist, append this to what's already there.",
|
||||
" * `create-or-append`: append if anything is there, otherwise create."
|
||||
],
|
||||
"enum": [
|
||||
"must-create",
|
||||
"must-replace",
|
||||
"create-or-replace",
|
||||
"must-append",
|
||||
"create-or-append"
|
||||
],
|
||||
"default": "`must-create`"
|
||||
},
|
||||
"generation": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"If specified, means that the update will fail if the previously-existing data is not exactly that generation. This allows for simple atomicity. This is only legal with *mode* `must-replace` or `must-append`."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"key"
|
||||
],
|
||||
"properties": {
|
||||
"key": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Part of the key added to the datastore."
|
||||
]
|
||||
}
|
||||
},
|
||||
"generation": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"The number of times this has been updated."
|
||||
]
|
||||
},
|
||||
"hex": {
|
||||
"type": "hex",
|
||||
"description": [
|
||||
"The hex data which has been added to the datastore."
|
||||
]
|
||||
},
|
||||
"string": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The data as a string, if it's valid utf-8."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"errors": [
|
||||
"The following error codes may occur:",
|
||||
"",
|
||||
"- 1202: The key already exists (and mode said it must not)",
|
||||
"- 1203: The key does not exist (and mode said it must)",
|
||||
"- 1204: The generation was wrong (and generation was specified)",
|
||||
"- 1205: The key has children already.",
|
||||
"- 1206: One of the parents already exists with a value.",
|
||||
"- -32602: invalid parameters"
|
||||
],
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:datastore#1",
|
||||
"method": "datastore",
|
||||
"params": {
|
||||
"key": [
|
||||
"test_libplugin",
|
||||
"name"
|
||||
],
|
||||
"string": "foobar",
|
||||
"hex": null,
|
||||
"mode": "must-replace",
|
||||
"generation": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "example:datastore#2",
|
||||
"method": "datastore",
|
||||
"params": {
|
||||
"key": "somekey",
|
||||
"string": null,
|
||||
"hex": "61",
|
||||
"mode": "create-or-append",
|
||||
"generation": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "example:datastore#3",
|
||||
"method": "datastore",
|
||||
"params": {
|
||||
"key": [
|
||||
"a",
|
||||
"d",
|
||||
"e",
|
||||
"f",
|
||||
"g"
|
||||
],
|
||||
"string": "somedatatostoreinthedatastore",
|
||||
"hex": null,
|
||||
"mode": null,
|
||||
"generation": null
|
||||
}
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"key": [
|
||||
"test_libplugin",
|
||||
"name"
|
||||
],
|
||||
"generation": 1,
|
||||
"hex": "666f6f626172",
|
||||
"string": "foobar"
|
||||
},
|
||||
{
|
||||
"key": [
|
||||
"somekey"
|
||||
],
|
||||
"generation": 3,
|
||||
"hex": "736f6d6564617461",
|
||||
"string": "somedata"
|
||||
},
|
||||
{
|
||||
"key": [
|
||||
"a",
|
||||
"d",
|
||||
"e",
|
||||
"f",
|
||||
"g"
|
||||
],
|
||||
"generation": 0,
|
||||
"hex": "736f6d6564617461746f73746f7265696e7468656461746173746f7265",
|
||||
"string": "somedatatostoreinthedatastore"
|
||||
}
|
||||
],
|
||||
"author": [
|
||||
"Rusty Russell <<rusty@rustcorp.com.au>> is mainly responsible."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-listdatastore(7)",
|
||||
"lightning-deldatastore(7)",
|
||||
"lightning-datastoreusage(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
122
doc/schemas/lightning-datastoreusage.json
Normal file
122
doc/schemas/lightning-datastoreusage.json
Normal file
|
@ -0,0 +1,122 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"added": "v23.11",
|
||||
"rpc": "datastoreusage",
|
||||
"title": "Command for listing datastore usage info",
|
||||
"description": [
|
||||
"The **datastoreusage** RPC command allows the caller to fetch the total bytes that are stored under a certain *key* (or from the root), including the size of the *key*.",
|
||||
"",
|
||||
"All descendants of the *key* (or root) are taken into account."
|
||||
],
|
||||
"request": {
|
||||
"required": [],
|
||||
"properties": {
|
||||
"key": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "array",
|
||||
"description": [
|
||||
"Key is an array of values (though a single value is treated as a one-element array). Used as the starting point to traverse the datastore."
|
||||
],
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"datastoreusage"
|
||||
],
|
||||
"properties": {
|
||||
"datastoreusage": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"key",
|
||||
"total_bytes"
|
||||
],
|
||||
"properties": {
|
||||
"key": {
|
||||
"type": "string",
|
||||
"added": "v23.11",
|
||||
"description": [
|
||||
"The key from which the database was traversed."
|
||||
]
|
||||
},
|
||||
"total_bytes": {
|
||||
"type": "u64",
|
||||
"added": "v23.11",
|
||||
"description": [
|
||||
"The total bytes that are stored under the *key*, including the all descendants data and the size of the keys themselves."
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:datastoreusage#1",
|
||||
"method": "datastoreusage",
|
||||
"params": {
|
||||
"key": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "example:datastoreusage#2",
|
||||
"method": "datastoreusage",
|
||||
"params": {
|
||||
"key": "a"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "example:datastoreusage#3",
|
||||
"method": "datastoreusage",
|
||||
"params": {
|
||||
"key": [
|
||||
"a",
|
||||
"thisissomelongkeythattriestostore46bytesofdata"
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"datastoreusage": {
|
||||
"key": "[]",
|
||||
"total_bytes": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"datastoreusage": {
|
||||
"key": "[a]",
|
||||
"total_bytes": 32
|
||||
}
|
||||
},
|
||||
{
|
||||
"datastoreusage": {
|
||||
"key": "[a,thisissomelongkeythattriestostore46bytesofdata]",
|
||||
"total_bytes": 77
|
||||
}
|
||||
}
|
||||
],
|
||||
"author": [
|
||||
"Peter Neuroth <<pet.v.ne@gmail.com>> is mainly responsible."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-datastore(7)",
|
||||
"lightning-deldatastore(7)",
|
||||
"lightning-listdatastore(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
2096
doc/schemas/lightning-decode.json
Normal file
2096
doc/schemas/lightning-decode.json
Normal file
File diff suppressed because it is too large
Load diff
290
doc/schemas/lightning-decodepay.json
Normal file
290
doc/schemas/lightning-decodepay.json
Normal file
|
@ -0,0 +1,290 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"added": "v23.05",
|
||||
"rpc": "decodepay",
|
||||
"title": "Command for decoding a bolt11 string (low-level)",
|
||||
"description": [
|
||||
"The **decodepay** RPC command checks and parses a *bolt11* string as specified by the BOLT 11 specification."
|
||||
],
|
||||
"request": {
|
||||
"required": [
|
||||
"bolt11"
|
||||
],
|
||||
"properties": {
|
||||
"bolt11": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Bolt11 invoice to decode."
|
||||
]
|
||||
},
|
||||
"description": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Description of the invoice to decode."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"currency",
|
||||
"created_at",
|
||||
"expiry",
|
||||
"payee",
|
||||
"min_final_cltv_expiry",
|
||||
"payment_hash",
|
||||
"signature"
|
||||
],
|
||||
"properties": {
|
||||
"currency": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The BIP173 name for the currency."
|
||||
]
|
||||
},
|
||||
"created_at": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"The UNIX-style timestamp of the invoice."
|
||||
]
|
||||
},
|
||||
"expiry": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"The number of seconds this is valid after *timestamp*."
|
||||
]
|
||||
},
|
||||
"payee": {
|
||||
"type": "pubkey",
|
||||
"description": [
|
||||
"The public key of the recipient."
|
||||
]
|
||||
},
|
||||
"amount_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"Amount the invoice asked for."
|
||||
]
|
||||
},
|
||||
"payment_hash": {
|
||||
"type": "hash",
|
||||
"description": [
|
||||
"The hash of the *payment_preimage*."
|
||||
]
|
||||
},
|
||||
"signature": {
|
||||
"type": "signature",
|
||||
"description": [
|
||||
"Signature of the *payee* on this invoice."
|
||||
]
|
||||
},
|
||||
"description": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The description of the purpose of the purchase."
|
||||
]
|
||||
},
|
||||
"description_hash": {
|
||||
"type": "hash",
|
||||
"description": [
|
||||
"The hash of the description, in place of *description*."
|
||||
]
|
||||
},
|
||||
"min_final_cltv_expiry": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"The minimum CLTV delay for the final node."
|
||||
]
|
||||
},
|
||||
"payment_secret": {
|
||||
"type": "hash",
|
||||
"description": [
|
||||
"The secret to hand to the payee node."
|
||||
]
|
||||
},
|
||||
"features": {
|
||||
"type": "hex",
|
||||
"description": [
|
||||
"The features bitmap for this invoice."
|
||||
]
|
||||
},
|
||||
"payment_metadata": {
|
||||
"type": "hex",
|
||||
"description": [
|
||||
"The payment_metadata to put in the payment."
|
||||
]
|
||||
},
|
||||
"fallbacks": {
|
||||
"type": "array",
|
||||
"description": [
|
||||
"Onchain addresses."
|
||||
],
|
||||
"items": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"type",
|
||||
"hex"
|
||||
],
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The address type (if known)."
|
||||
],
|
||||
"enum": [
|
||||
"P2PKH",
|
||||
"P2SH",
|
||||
"P2WPKH",
|
||||
"P2WSH",
|
||||
"P2TR"
|
||||
]
|
||||
},
|
||||
"addr": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The address in appropriate format for *type*."
|
||||
]
|
||||
},
|
||||
"hex": {
|
||||
"type": "hex",
|
||||
"description": [
|
||||
"Raw encoded address."
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"routes": {
|
||||
"type": "array",
|
||||
"description": [
|
||||
"Route hints to the *payee*."
|
||||
],
|
||||
"items": {
|
||||
"type": "array",
|
||||
"description": [
|
||||
"Hops in the route."
|
||||
],
|
||||
"items": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"pubkey",
|
||||
"short_channel_id",
|
||||
"fee_base_msat",
|
||||
"fee_proportional_millionths",
|
||||
"cltv_expiry_delta"
|
||||
],
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"pubkey": {
|
||||
"type": "pubkey",
|
||||
"description": [
|
||||
"The public key of the node."
|
||||
]
|
||||
},
|
||||
"short_channel_id": {
|
||||
"type": "short_channel_id",
|
||||
"description": [
|
||||
"A channel to the next peer."
|
||||
]
|
||||
},
|
||||
"fee_base_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"The base fee for payments."
|
||||
]
|
||||
},
|
||||
"fee_proportional_millionths": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"The parts-per-million fee for payments."
|
||||
]
|
||||
},
|
||||
"cltv_expiry_delta": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"The CLTV delta across this hop."
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"extra": {
|
||||
"type": "array",
|
||||
"description": [
|
||||
"Any extra fields we didn't know how to parse."
|
||||
],
|
||||
"items": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"tag",
|
||||
"data"
|
||||
],
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"tag": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The bech32 letter which identifies this field."
|
||||
],
|
||||
"maxLength": 1,
|
||||
"minLength": 1
|
||||
},
|
||||
"data": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The bech32 data for this field."
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"post_return_value_notes": [
|
||||
"Technically, the *description* field is optional if a *description_hash* field is given, but in this case **decodepay** will only succeed if the optional *description* field is passed and matches the *description_hash*. In practice, these are currently unused."
|
||||
]
|
||||
},
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:decodepay#1",
|
||||
"method": "decodepay",
|
||||
"params": {
|
||||
"bolt11": "lnbcrt110u1pjmr5lzsp5sfjyj3xn7ux592k36hmmt4ax98n6lgct22wvj54yck0upcmep63qpp5qu436g855lr40ftdt7csatk5pdvtdzzfmfqluwtvm0fds95jsadqdpq0pzk7s6j8y69xjt6xe25j5j4g44hsatdxqyjw5qcqp99qxpqysgquwma3zrw4cd8e8j4u9uh4gxukaacckse64kx2l9dqv8rvrysdq5r5dt38t9snqj9u5ar07h2exr4fg56wpudkhkk7gtxlyt72ku5fpqqd4fnlk",
|
||||
"description": null
|
||||
}
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"currency": "bcrt",
|
||||
"created_at": 1706152930,
|
||||
"expiry": 604800,
|
||||
"payee": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59",
|
||||
"amount_msat": 11000000,
|
||||
"description": [
|
||||
"XEoCR94SIz6UIRUEkxum."
|
||||
],
|
||||
"min_final_cltv_expiry": 5,
|
||||
"payment_secret": "82644944d3f70d42aad1d5f7b5d7a629e7afa30b529cc952a4c59fc0e3790ea2",
|
||||
"features": "02024100",
|
||||
"payment_hash": "072b1d20f4a7c757a56d5fb10eaed40b58b68849da41fe396cdbd2d81692875a",
|
||||
"signature": "3045022100e3b7d8886eae1a7c9e55e1797aa0dcb77b8c5a19d56c657cad030e360c90682802203a35713acb098245e53a37faeac98754a29a7078db5ed6f2166f917e55b94484"
|
||||
}
|
||||
],
|
||||
"author": [
|
||||
"Rusty Russell <<rusty@rustcorp.com.au>> is mainly responsible."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-pay(7)",
|
||||
"lightning-getroute(7)",
|
||||
"lightning-sendpay(7)"
|
||||
],
|
||||
"resources": [
|
||||
"[BOLT #11](https://github.com/lightning/bolts/blob/master/11-payment-encoding.md)",
|
||||
"",
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
131
doc/schemas/lightning-deldatastore.json
Normal file
131
doc/schemas/lightning-deldatastore.json
Normal file
|
@ -0,0 +1,131 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"rpc": "deldatastore",
|
||||
"title": "Command for removing (plugin) data",
|
||||
"description": [
|
||||
"The **deldatastore** RPC command allows plugins to delete data it has stored in the Core Lightning database.",
|
||||
"",
|
||||
"The command fails if the *key* isn't present, or if *generation* is specified and the generation of the data does not exactly match."
|
||||
],
|
||||
"request": {
|
||||
"required": [
|
||||
"key"
|
||||
],
|
||||
"properties": {
|
||||
"key": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "array",
|
||||
"description": [
|
||||
"Key is an array of values (though a single value is treated as a one-element array), to form a heirarchy. Using the first element of the key as the plugin name (e.g. [ 'summary' ]) is recommended. A key can either have children or a value, never both: parents are created and removed automatically."
|
||||
],
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
},
|
||||
"generation": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"If specified, means that the update will fail if the previously-existing data is not exactly that generation. This allows for simple atomicity. This is only legal with mode `must-replace` or `must-append`."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"key"
|
||||
],
|
||||
"properties": {
|
||||
"key": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Part of the key added to the datastore."
|
||||
]
|
||||
}
|
||||
},
|
||||
"generation": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"The number of times this has been updated."
|
||||
]
|
||||
},
|
||||
"hex": {
|
||||
"type": "hex",
|
||||
"description": [
|
||||
"The hex data which has removed from the datastore."
|
||||
]
|
||||
},
|
||||
"string": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The data as a string, if it's valid utf-8."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"errors": [
|
||||
"The following error codes may occur:",
|
||||
"",
|
||||
"- 1200: the key does not exist",
|
||||
"- 1201: the key does exist, but the generation is wrong",
|
||||
"- -32602: invalid parameters"
|
||||
],
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:deldatastore#1",
|
||||
"method": "deldatastore",
|
||||
"params": {
|
||||
"key": "otherkey",
|
||||
"generation": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "example:deldatastore#2",
|
||||
"method": "deldatastore",
|
||||
"params": {
|
||||
"key": [
|
||||
"a"
|
||||
],
|
||||
"generation": null
|
||||
}
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"key": [
|
||||
"otherkey"
|
||||
],
|
||||
"generation": 1,
|
||||
"hex": "6f746865726461746161",
|
||||
"string": "otherdataa"
|
||||
},
|
||||
{
|
||||
"key": [
|
||||
"a"
|
||||
],
|
||||
"generation": 0,
|
||||
"hex": "6176616c",
|
||||
"string": "aval"
|
||||
}
|
||||
],
|
||||
"author": [
|
||||
"Rusty Russell <<rusty@rustcorp.com.au>> is mainly responsible."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-listdatastore(7)",
|
||||
"lightning-datastore(7)",
|
||||
"lightning-datastoreusage(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
47
doc/schemas/lightning-delexpiredinvoice.json
Normal file
47
doc/schemas/lightning-delexpiredinvoice.json
Normal file
|
@ -0,0 +1,47 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"rpc": "delexpiredinvoice",
|
||||
"title": "Command for removing expired invoices",
|
||||
"description": [
|
||||
"The **delexpiredinvoice** RPC command removes all invoices that have expired on or before the given *maxexpirytime*."
|
||||
],
|
||||
"request": {
|
||||
"required": [],
|
||||
"properties": {
|
||||
"maxexpirytime": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"Invoice expiry time in seconds. If not specified then all expired invoices are deleted."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [],
|
||||
"properties": {}
|
||||
},
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:delexpiredinvoice#1",
|
||||
"method": "delexpiredinvoice",
|
||||
"params": {
|
||||
"maxexpirytime": null
|
||||
}
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{}
|
||||
],
|
||||
"author": [
|
||||
"ZmnSCPxj <<ZmnSCPxj@protonmail.com>> is mainly responsible."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-delinvoice(7)",
|
||||
"lightning-autoclean-status(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
86
doc/schemas/lightning-delforward.json
Normal file
86
doc/schemas/lightning-delforward.json
Normal file
|
@ -0,0 +1,86 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"rpc": "delforward",
|
||||
"title": "Command for removing a forwarding entry",
|
||||
"description": [
|
||||
"The **delforward** RPC command removes a single forward from **listforwards**, using the uniquely-identifying *in_channel* and *in_htlc_id* (and, as a sanity check, the *status*) given by that command.",
|
||||
"",
|
||||
"This command is mainly used by the *autoclean* plugin (see lightningd- config(7)), As these database entries are only kept for your own analysis, removing them has no effect on the running of your node."
|
||||
],
|
||||
"request": {
|
||||
"required": [
|
||||
"in_channel",
|
||||
"in_htlc_id",
|
||||
"status"
|
||||
],
|
||||
"properties": {
|
||||
"in_channel": {
|
||||
"type": "short_channel_id",
|
||||
"description": [
|
||||
"Only the matching forwards on the given inbound channel are deleted. Note: for **listforwards** entries without an *in_htlc_id* entry (no longer created in v22.11, but can exist from older versions), a value of 18446744073709551615 can be used, but then it will delete *all* entries without *in_htlc_id* for this *in_channel* and *status*."
|
||||
]
|
||||
},
|
||||
"in_htlc_id": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"The unique HTLC id the sender gave this (not present if incoming channel was closed before upgrade to v22.11)."
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The status of the forward to delete. You cannot delete forwards which have status *offered* (i.e. are currently active)."
|
||||
],
|
||||
"enum": [
|
||||
"settled",
|
||||
"local_failed",
|
||||
"failed"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [],
|
||||
"properties": {}
|
||||
},
|
||||
"errors": [
|
||||
"The following errors may be reported:",
|
||||
"",
|
||||
"- 1401: The forward specified does not exist."
|
||||
],
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:delforward#1",
|
||||
"method": "delforward",
|
||||
"params": {
|
||||
"in_channel": "103x1x0",
|
||||
"in_htlc_id": 2,
|
||||
"status": "local_failed"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "example:delforward#2",
|
||||
"method": "delforward",
|
||||
"params": [
|
||||
"103x1x0",
|
||||
1,
|
||||
"failed"
|
||||
]
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{},
|
||||
{}
|
||||
],
|
||||
"author": [
|
||||
"Rusty Russell <<rusty@rustcorp.com.au>> is mainly responsible."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-autoclean(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
338
doc/schemas/lightning-delinvoice.json
Normal file
338
doc/schemas/lightning-delinvoice.json
Normal file
|
@ -0,0 +1,338 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"rpc": "delinvoice",
|
||||
"title": "Command for removing an invoice (or just its description)",
|
||||
"description": [
|
||||
"The **delinvoice** RPC command removes an invoice with *status* as given in **listinvoices**, or with *desconly* set, removes its description."
|
||||
],
|
||||
"request": {
|
||||
"required": [
|
||||
"label",
|
||||
"status"
|
||||
],
|
||||
"properties": {
|
||||
"label": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"type": "u64"
|
||||
}
|
||||
],
|
||||
"description": [
|
||||
"Label of the invoice to be deleted."
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Label of the invoice to be deleted. The caller should be particularly aware of the error case caused by the *status* changing just before this command is invoked!"
|
||||
],
|
||||
"enum": [
|
||||
"paid",
|
||||
"expired",
|
||||
"unpaid"
|
||||
]
|
||||
},
|
||||
"desconly": {
|
||||
"type": "boolean",
|
||||
"description": [
|
||||
"If set to True, the invoice is not deleted, but has its description removed (this can save space with very large descriptions, as would be used with lightning-invoice(7) *deschashonly*."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"label",
|
||||
"payment_hash",
|
||||
"status",
|
||||
"created_index",
|
||||
"expires_at"
|
||||
],
|
||||
"properties": {
|
||||
"label": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Unique label given at creation time."
|
||||
]
|
||||
},
|
||||
"bolt11": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"BOLT11 string."
|
||||
]
|
||||
},
|
||||
"bolt12": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"BOLT12 string."
|
||||
]
|
||||
},
|
||||
"amount_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"The amount required to pay this invoice."
|
||||
]
|
||||
},
|
||||
"description": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Description used in the invoice."
|
||||
]
|
||||
},
|
||||
"payment_hash": {
|
||||
"type": "hash",
|
||||
"description": [
|
||||
"The hash of the *payment_preimage* which will prove payment."
|
||||
]
|
||||
},
|
||||
"created_index": {
|
||||
"type": "u64",
|
||||
"added": "v23.08",
|
||||
"description": [
|
||||
"1-based index indicating order this invoice was created in."
|
||||
]
|
||||
},
|
||||
"updated_index": {
|
||||
"type": "u64",
|
||||
"added": "v23.08",
|
||||
"description": [
|
||||
"1-based index indicating order this invoice was changed (only present if it has changed since creation)."
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"State of invoice."
|
||||
],
|
||||
"enum": [
|
||||
"paid",
|
||||
"expired",
|
||||
"unpaid"
|
||||
]
|
||||
},
|
||||
"expires_at": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"UNIX timestamp when invoice expires (or expired)."
|
||||
]
|
||||
}
|
||||
},
|
||||
"allOf": [
|
||||
{
|
||||
"if": {
|
||||
"required": [
|
||||
"bolt12"
|
||||
]
|
||||
},
|
||||
"then": {
|
||||
"required": [],
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"label": {},
|
||||
"bolt12": {},
|
||||
"status": {},
|
||||
"expires_at": {},
|
||||
"msatoshi": {},
|
||||
"amount_msat": {},
|
||||
"description": {},
|
||||
"payment_hash": {},
|
||||
"pay_index": {},
|
||||
"created_index": {},
|
||||
"updated_index": {},
|
||||
"amount_received_msat": {},
|
||||
"paid_at": {},
|
||||
"payment_preimage": {},
|
||||
"local_offer_id": {
|
||||
"type": "hex",
|
||||
"description": [
|
||||
"Offer for which this invoice was created."
|
||||
]
|
||||
},
|
||||
"invreq_payer_note": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The optional *invreq_payer_note* from invoice_request which created this invoice."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"else": {
|
||||
"required": [
|
||||
"bolt11"
|
||||
],
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"label": {},
|
||||
"bolt11": {},
|
||||
"status": {},
|
||||
"expires_at": {},
|
||||
"msatoshi": {},
|
||||
"amount_msat": {},
|
||||
"description": {},
|
||||
"payment_hash": {},
|
||||
"pay_index": {},
|
||||
"created_index": {},
|
||||
"updated_index": {},
|
||||
"amount_received_msat": {},
|
||||
"msatoshi_received": {},
|
||||
"paid_at": {},
|
||||
"payment_preimage": {}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"if": {
|
||||
"properties": {
|
||||
"status": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"paid"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"then": {
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"pay_index",
|
||||
"amount_received_msat",
|
||||
"paid_at",
|
||||
"payment_preimage"
|
||||
],
|
||||
"properties": {
|
||||
"label": {},
|
||||
"bolt11": {},
|
||||
"bolt12": {},
|
||||
"status": {},
|
||||
"expires_at": {},
|
||||
"msatoshi": {},
|
||||
"amount_msat": {},
|
||||
"description": {},
|
||||
"payment_hash": {},
|
||||
"invreq_payer_note": {},
|
||||
"local_offer_id": {},
|
||||
"created_index": {},
|
||||
"updated_index": {},
|
||||
"pay_index": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"Unique index for this invoice payment."
|
||||
]
|
||||
},
|
||||
"amount_received_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"How much was actually received."
|
||||
]
|
||||
},
|
||||
"paid_at": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"UNIX timestamp of when payment was received."
|
||||
]
|
||||
},
|
||||
"payment_preimage": {
|
||||
"type": "secret",
|
||||
"description": [
|
||||
"SHA256 of this is the *payment_hash* offered in the invoice."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"else": {
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"label": {},
|
||||
"bolt11": {},
|
||||
"bolt12": {},
|
||||
"status": {},
|
||||
"msatoshi": {},
|
||||
"amount_msat": {},
|
||||
"description": {},
|
||||
"payment_hash": {},
|
||||
"expires_at": {},
|
||||
"created_index": {},
|
||||
"updated_index": {},
|
||||
"pay_index": {},
|
||||
"invreq_payer_note": {},
|
||||
"local_offer_id": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"pre_return_value_notes": [
|
||||
"Note: The return is the same as an object from lightning-listinvoice(7)."
|
||||
]
|
||||
},
|
||||
"errors": [
|
||||
"The following errors may be reported:",
|
||||
"",
|
||||
"- -1: Database error.",
|
||||
"- 905: An invoice with that label does not exist.",
|
||||
"- 906: The invoice *status* does not match the parameter. An error object will be returned as error *data*, containing *current_status* and *expected_status* fields. This is most likely due to the *status* of the invoice changing just before this command is invoked.",
|
||||
"- 908: The invoice already has no description, and *desconly* was set."
|
||||
],
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:delinvoice#1",
|
||||
"method": "delinvoice",
|
||||
"params": {
|
||||
"label": "invlabel2",
|
||||
"status": "unpaid",
|
||||
"desconly": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "example:delinvoice#2",
|
||||
"method": "delinvoice",
|
||||
"params": {
|
||||
"label": "keysend-1708640419.666098582",
|
||||
"status": "paid",
|
||||
"desconly": null
|
||||
}
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"label": "invlabel2",
|
||||
"bolt11": "lnbcrt420p1pja0tefsp5vvzg40t4g24l0eqk0jch7mc6jm3ec52ts8w8gwzpwtx9c8nv05rspp533e9csxurt7j9sn2cx7hsn6m00475qgrau8sux5r7djpdedwy2fshp5xqsmrtgfcwsnhxcxmf3tuc65kl6fxvqhvujfmxw2kpeh95yy2x8sxqyjw5qcqp99qxpqysgqgfjrz4q5zcq2lluxxg9h475mq2d3w0tpdstm5274zmhadjl8cqapylfskzk96apka5599a2flm90rmavsk7q8mhh87yle3sgh5vrlycq72fern",
|
||||
"payment_hash": "8c725c40dc1afd22c26ac1bd784f5b7bebea0103ef0f0e1a83f36416e5ae2293",
|
||||
"amount_msat": 42,
|
||||
"status": "unpaid",
|
||||
"expires_at": 1709238697,
|
||||
"created_index": 3
|
||||
},
|
||||
{
|
||||
"label": "keysend-1708640419.666098582",
|
||||
"bolt11": "lnbcrt1pja0j9rsp5tg3zvj846gcdzw394njazq40s946sq2ur3hkl4xu4xudtjdtckxspp5fuunrfzsnyz2uxjmg2n95mqhghv4fpvv2kud3kvq4fkys3vmzu5sdqvddjhjum9dejqxqyjw5qcqp99qxpqysgqwt7r0gjlgt7zrfldc3um9myfc36acpqnsdn77c2m42facjtps30yufc5nsmwzhgexlj59f6xa5hess6e3tqrxynt9fejzj3rrshddtcqnappmj",
|
||||
"payment_hash": "4f3931a4509904ae1a5b42a65a6c1745d954858c55b8d8d980aa6c48459b1729",
|
||||
"status": "paid",
|
||||
"pay_index": 1,
|
||||
"amount_received_msat": 10000000,
|
||||
"paid_at": 1708640419,
|
||||
"payment_preimage": "b760af47f456a217e8dfda21a282f1f78c903487c1b21b3b318135f75aa3bf11",
|
||||
"description": "keysend",
|
||||
"expires_at": 1709245219,
|
||||
"created_index": 1,
|
||||
"updated_index": 1
|
||||
}
|
||||
],
|
||||
"author": [
|
||||
"Rusty Russell <<rusty@rustcorp.com.au>> is mainly responsible."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-listinvoice(7)",
|
||||
"lightning-waitinvoice(7)",
|
||||
"lightning-invoice(7)",
|
||||
"lightning-delexpiredinvoice(7)",
|
||||
"lightning-autoclean-status(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
293
doc/schemas/lightning-delpay.json
Normal file
293
doc/schemas/lightning-delpay.json
Normal file
|
@ -0,0 +1,293 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"rpc": "delpay",
|
||||
"title": "Command for removing a completed or failed payment",
|
||||
"description": [
|
||||
"The **delpay** RPC command deletes a payment with the given `payment_hash` if its status is either `complete` or `failed`. If *partid* and *groupid* are not specified, all payment parts with matchin status are deleted."
|
||||
],
|
||||
"request": {
|
||||
"required": [
|
||||
"payment_hash",
|
||||
"status"
|
||||
],
|
||||
"properties": {
|
||||
"payment_hash": {
|
||||
"type": "hash",
|
||||
"description": [
|
||||
"The unique identifier of a payment."
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Expected status of the payment. Only deletes if the payment status matches. Deleting a `pending` payment will return an error."
|
||||
],
|
||||
"enum": [
|
||||
"complete",
|
||||
"failed"
|
||||
]
|
||||
},
|
||||
"partid": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"Specific partid to delete (must be paired with *groupid*)."
|
||||
]
|
||||
},
|
||||
"groupid": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"Specific groupid to delete (must be paired with *partid*)."
|
||||
]
|
||||
}
|
||||
},
|
||||
"pairedWith": [
|
||||
[
|
||||
"partid",
|
||||
"groupid"
|
||||
]
|
||||
]
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"payments"
|
||||
],
|
||||
"properties": {
|
||||
"payments": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"created_index",
|
||||
"id",
|
||||
"payment_hash",
|
||||
"status",
|
||||
"amount_sent_msat",
|
||||
"created_at"
|
||||
],
|
||||
"properties": {
|
||||
"created_index": {
|
||||
"added": "v23.11",
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"1-based index indicating order this payment was created in."
|
||||
]
|
||||
},
|
||||
"id": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"Old synonym for created_index."
|
||||
]
|
||||
},
|
||||
"payment_hash": {
|
||||
"type": "hash",
|
||||
"description": [
|
||||
"The hash of the *payment_preimage* which will prove payment."
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"pending",
|
||||
"failed",
|
||||
"complete"
|
||||
],
|
||||
"description": [
|
||||
"Status of the payment."
|
||||
]
|
||||
},
|
||||
"amount_sent_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"The amount we actually sent, including fees."
|
||||
]
|
||||
},
|
||||
"partid": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"Unique ID within this (multi-part) payment."
|
||||
]
|
||||
},
|
||||
"destination": {
|
||||
"type": "pubkey",
|
||||
"description": [
|
||||
"The final destination of the payment if known."
|
||||
]
|
||||
},
|
||||
"amount_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"The amount the destination received, if known."
|
||||
]
|
||||
},
|
||||
"created_at": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"The UNIX timestamp showing when this payment was initiated."
|
||||
]
|
||||
},
|
||||
"updated_index": {
|
||||
"added": "v23.11",
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"1-based index indicating order this payment was changed (only present if it has changed since creation)."
|
||||
]
|
||||
},
|
||||
"completed_at": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"The UNIX timestamp showing when this payment was completed."
|
||||
]
|
||||
},
|
||||
"groupid": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"Grouping key to disambiguate multiple attempts to pay an invoice or the same payment_hash."
|
||||
]
|
||||
},
|
||||
"payment_preimage": {
|
||||
"type": "secret",
|
||||
"description": [
|
||||
"Proof of payment."
|
||||
]
|
||||
},
|
||||
"label": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The label, if given to sendpay."
|
||||
]
|
||||
},
|
||||
"bolt11": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The bolt11 string (if pay supplied one)."
|
||||
]
|
||||
},
|
||||
"bolt12": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The bolt12 string (if supplied for pay: **experimental-offers** only)."
|
||||
]
|
||||
},
|
||||
"erroronion": {
|
||||
"type": "hex",
|
||||
"description": [
|
||||
"The error onion returned on failure, if any."
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"pre_return_value_notes": [
|
||||
"The returned format is the same as lightning-listsendpays(7). If the payment is a multi-part payment (MPP) the command return a list of payments will be returned -- one payment object for each partid."
|
||||
]
|
||||
},
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:delpay#1",
|
||||
"method": "delpay",
|
||||
"params": {
|
||||
"payment_hash": "4fa2f1b001067ec06d7f95b8695b8acd9ef04c1b4d1110e3b94e1fa0687bb1e0",
|
||||
"status": "complete"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "example:delpay#2",
|
||||
"method": "delpay",
|
||||
"params": [
|
||||
"c9d4547473d0d646f1fdd8ca7f01803e4d31ceab01df33c79456f9c24b04034e",
|
||||
"failed"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "example:delpay#3",
|
||||
"method": "delpay",
|
||||
"params": {
|
||||
"payment_hash": "bbc35e0a46d1483292a4ff8d4daaceaab8c3c084dd835be4128785b52e469c64",
|
||||
"status": "complete",
|
||||
"groupid": 1,
|
||||
"partid": 1
|
||||
}
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"payments": [
|
||||
{
|
||||
"id": 1,
|
||||
"payment_hash": "8dfd6538eeb33811c9114a75f792a143728d7f05643f38c3d574d3097e8910c0",
|
||||
"destination": "0219f8900ee78a89f050c24d8b69492954f9fdbabed753710845eb75d3a75a5880",
|
||||
"msatoshi": 1000,
|
||||
"amount_msat": "1000msat",
|
||||
"msatoshi_sent": 1000,
|
||||
"amount_sent_msat": "1000msat",
|
||||
"created_at": 1596224858,
|
||||
"status": "complete",
|
||||
"payment_preimage": "35bd4e2b481a1a84a22215b5372672cf81460a671816960ddb206464359e1822",
|
||||
"bolt11": "lntb10n1p0jga20pp53h7k2w8wkvuprjg3ff6l0y4pgdeg6lc9vsln3s74wnfsjl5fzrqqdqdw3jhxazldahx2xqyjw5qcqp2sp5wut5jnhr6n7jd5747ky2g5flmw7hgx9yjnqzu60ps2jf6f7tc0us9qy9qsqu2a0k37nckl62005p69xavlkydkvhnypk4dphffy4x09zltwh9437ad7xkl83tefdarzhu5t30ju5s56wlrg97qkx404pq3srfc425cq3ke9af"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"payments": [
|
||||
{
|
||||
"created_index": 2,
|
||||
"id": 2,
|
||||
"payment_hash": "c9d4547473d0d646f1fdd8ca7f01803e4d31ceab01df33c79456f9c24b04034e",
|
||||
"groupid": 1,
|
||||
"updated_index": 2,
|
||||
"destination": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d",
|
||||
"amount_msat": 100000,
|
||||
"amount_sent_msat": 100002,
|
||||
"created_at": 1706316468,
|
||||
"completed_at": 1706316471,
|
||||
"status": "failed",
|
||||
"bolt11": "lnbcrt1u1pjmg54nsp5ke626txv6wwwmqmpuy63t3jnu9hqxwj880zsfkkj7jjqagdaz2sqpp5e829garn6rtydu0amr987qvq8exnrn4tq80n83u52muuyjcyqd8qdq8v3jhxccxqyjw5qcqp99qxpqysgqalktfwy9svsamvvvrzzzzpdaa4rh7n6s5p7t9lx7qv0raz4vnm9knkh5ury3u5cmnhx2gms98nxkclm3833uhjrlnzmftc685vz2f0gpfnjy4y"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"payments": [
|
||||
{
|
||||
"created_index": 3,
|
||||
"id": 3,
|
||||
"payment_hash": "bbc35e0a46d1483292a4ff8d4daaceaab8c3c084dd835be4128785b52e469c64",
|
||||
"groupid": 1,
|
||||
"updated_index": 3,
|
||||
"partid": 1,
|
||||
"destination": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d",
|
||||
"amount_msat": 100000,
|
||||
"amount_sent_msat": 102100,
|
||||
"created_at": 1708641193,
|
||||
"completed_at": 1708641194,
|
||||
"status": "complete",
|
||||
"payment_preimage": "a6ebb1cfbf69e76200f196f1eafd28a3d850633499c223a7eb7a7dba3b995286"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"errors": [
|
||||
"On failure, an error is returned. If the lightning process fails before responding, the",
|
||||
"caller should use lightning-listsentpays(7) or lightning-listpays(7) to query whether this payment was deleted or not.",
|
||||
"",
|
||||
"The following error codes may occur:",
|
||||
"",
|
||||
"- -32602: Parameter missed or malformed;",
|
||||
"- 211: Payment status mismatch. Check the correct status via **paystatus**;",
|
||||
"- 208: Payment with payment_hash not found."
|
||||
],
|
||||
"author": [
|
||||
"Vincenzo Palazzo <<vincenzo.palazzo@protonmail.com>> is mainly responsible."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-listpays(7)",
|
||||
"lightning-listsendpays(7)",
|
||||
"lightning-paystatus(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
54
doc/schemas/lightning-deprecations.json
Normal file
54
doc/schemas/lightning-deprecations.json
Normal file
|
@ -0,0 +1,54 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"added": "v24.02",
|
||||
"rpc": "deprecations",
|
||||
"title": "Command to enable/disable deprecated APIs",
|
||||
"description": [
|
||||
"The **deprecations** RPC command is used to override global config option `allow-deprecated-apis` for further RPC commands on this same connection. This can be useful for developer testing to ensure you don't accidentally rely on deprecated features."
|
||||
],
|
||||
"request": {
|
||||
"required": [
|
||||
"enable"
|
||||
],
|
||||
"properties": {
|
||||
"enable": {
|
||||
"type": "boolean",
|
||||
"description": [
|
||||
"Flag to enable or disable deprecated APIs. Setting it to `false` will neither accept deprecated parameters or commands, nor output deprecated fields."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"properties": {}
|
||||
},
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:deprecations#1",
|
||||
"method": "deprecations",
|
||||
"params": {
|
||||
"enable": false
|
||||
}
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{}
|
||||
],
|
||||
"errors": [
|
||||
"On failure, one of the following error codes may be returned:",
|
||||
"",
|
||||
"- -32602: Error in given parameters."
|
||||
],
|
||||
"author": [
|
||||
"Rusty Russell <<rusty@blockstream.com>> wrote the initial version of this man page."
|
||||
],
|
||||
"see_also": [
|
||||
"lightningd-config(5)",
|
||||
"lightning-notifications(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
90
doc/schemas/lightning-disableinvoicerequest.json
Normal file
90
doc/schemas/lightning-disableinvoicerequest.json
Normal file
|
@ -0,0 +1,90 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"added": "v22.11",
|
||||
"rpc": "disableinvoicerequest",
|
||||
"title": "Command for removing an invoice request",
|
||||
"warning": "experimental-offers only",
|
||||
"description": [
|
||||
"The **disableinvoicerequest** RPC command disables an invoice_request, so that no further invoices will be accepted (and thus, no further payments made)..",
|
||||
"",
|
||||
"We currently don't support deletion of invoice_requests, so they are not forgotten entirely (there may be payments which refer to this invoice_request)."
|
||||
],
|
||||
"request": {
|
||||
"required": [
|
||||
"invreq_id"
|
||||
],
|
||||
"properties": {
|
||||
"invreq_id": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"A specific invoice can be disabled by providing the `invreq_id`, which is presented by lightning-invoicerequest(7)."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"invreq_id",
|
||||
"single_use",
|
||||
"active",
|
||||
"bolt12",
|
||||
"used"
|
||||
],
|
||||
"properties": {
|
||||
"invreq_id": {
|
||||
"type": "hash",
|
||||
"description": [
|
||||
"The SHA256 hash of all invoice_request fields less than 160."
|
||||
]
|
||||
},
|
||||
"active": {
|
||||
"type": "boolean",
|
||||
"enum": [
|
||||
false
|
||||
],
|
||||
"description": [
|
||||
"Whether the invoice_request is currently active."
|
||||
]
|
||||
},
|
||||
"single_use": {
|
||||
"type": "boolean",
|
||||
"description": [
|
||||
"Whether the invoice_request will become inactive after we pay an invoice for it."
|
||||
]
|
||||
},
|
||||
"bolt12": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The bolt12 string starting with lnr."
|
||||
]
|
||||
},
|
||||
"used": {
|
||||
"type": "boolean",
|
||||
"description": [
|
||||
"Whether the invoice_request has already been used."
|
||||
]
|
||||
},
|
||||
"label": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The label provided when creating the invoice_request."
|
||||
]
|
||||
}
|
||||
},
|
||||
"pre_return_value_notes": [
|
||||
"Note: the returned object is the same format as **listinvoicerequest**."
|
||||
]
|
||||
},
|
||||
"author": [
|
||||
"Rusty Russell <<rusty@rustcorp.com.au>> is mainly responsible."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-invoicerequest(7)",
|
||||
"lightning-listinvoicerequest(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
107
doc/schemas/lightning-disableoffer.json
Normal file
107
doc/schemas/lightning-disableoffer.json
Normal file
|
@ -0,0 +1,107 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"rpc": "disableoffer",
|
||||
"title": "Command for removing an offer",
|
||||
"warning": "experimental-offers only",
|
||||
"description": [
|
||||
"The **disableoffer** RPC command disables an offer, so that no further invoices will be given out.",
|
||||
"",
|
||||
"We currently don't support deletion of offers, so offers are not forgotten entirely (there may be invoices which refer to this offer)."
|
||||
],
|
||||
"request": {
|
||||
"required": [
|
||||
"offer_id"
|
||||
],
|
||||
"properties": {
|
||||
"offer_id": {
|
||||
"type": "hash",
|
||||
"description": [
|
||||
"The id we use to identify this offer."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"offer_id",
|
||||
"active",
|
||||
"single_use",
|
||||
"bolt12",
|
||||
"used"
|
||||
],
|
||||
"properties": {
|
||||
"offer_id": {
|
||||
"type": "hash",
|
||||
"description": [
|
||||
"The merkle hash of the offer."
|
||||
]
|
||||
},
|
||||
"active": {
|
||||
"type": "boolean",
|
||||
"enum": [
|
||||
false
|
||||
],
|
||||
"description": [
|
||||
"Whether the offer can produce invoices/payments."
|
||||
]
|
||||
},
|
||||
"single_use": {
|
||||
"type": "boolean",
|
||||
"description": [
|
||||
"Whether the offer is disabled after first successful use."
|
||||
]
|
||||
},
|
||||
"bolt12": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The bolt12 string representing this offer."
|
||||
]
|
||||
},
|
||||
"used": {
|
||||
"type": "boolean",
|
||||
"description": [
|
||||
"Whether the offer has had an invoice paid / payment made."
|
||||
]
|
||||
},
|
||||
"label": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The label provided when offer was created."
|
||||
]
|
||||
}
|
||||
},
|
||||
"pre_return_value_notes": [
|
||||
"Note: the returned object is the same format as **listoffers**."
|
||||
]
|
||||
},
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:disableoffer#1",
|
||||
"method": "disableoffer",
|
||||
"params": {
|
||||
"offer_id": "713a16ccd4eb10438bdcfbc2c8276be301020dd9d489c530773ba64f3b33307d"
|
||||
}
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"offer_id": "053a5c566fbea2681a5ff9c05a913da23e45b95d09ef5bd25d7d408f23da7084",
|
||||
"active": false,
|
||||
"single_use": false,
|
||||
"bolt12": "lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcgqvqcdgq2z9pk7enxv4jjqen0wgs8yatnw3ujz83qkc6rvp4j28rt3dtrn32zkvdy7efhnlrpr5rp5geqxs783wtlj550qs8czzku4nk3pqp6m593qxgunzuqcwkmgqkmp6ty0wyvjcqdguv3pnpukedwn6cr87m89t74h3auyaeg89xkvgzpac70z3m9rn5xzu28c",
|
||||
"used": false
|
||||
}
|
||||
],
|
||||
"author": [
|
||||
"Rusty Russell <<rusty@rustcorp.com.au>> is mainly responsible."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-offer(7)",
|
||||
"lightning-listoffers(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
80
doc/schemas/lightning-disconnect.json
Normal file
80
doc/schemas/lightning-disconnect.json
Normal file
|
@ -0,0 +1,80 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"rpc": "disconnect",
|
||||
"title": "Command for disconnecting from another lightning node",
|
||||
"description": [
|
||||
"The disconnect RPC command closes an existing connection to a peer, identified by *id*, in the Lightning Network, as long as it doesn't have an active channel."
|
||||
],
|
||||
"request": {
|
||||
"required": [
|
||||
"id"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "pubkey",
|
||||
"description": [
|
||||
"The public key of the peer to terminate the connection. It can be discovered in the output of the listpeers command, which returns a set of peers:",
|
||||
"{",
|
||||
" 'peers':",
|
||||
" [",
|
||||
" {",
|
||||
" 'id': '0563aea81...',",
|
||||
" 'connected': true,",
|
||||
" ...",
|
||||
" }",
|
||||
" ]",
|
||||
"}"
|
||||
]
|
||||
},
|
||||
"force": {
|
||||
"type": "boolean",
|
||||
"description": [
|
||||
"If set to True, it will disconnect even with an active channel."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"properties": {}
|
||||
},
|
||||
"errors": [
|
||||
"On error the returned object will contain `code` and `message` properties, with `code` being one of the following:",
|
||||
"",
|
||||
"- -32602: If the given parameters are wrong.",
|
||||
"- -1: Catchall nonspecific error."
|
||||
],
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:disconnect#1",
|
||||
"method": "disconnect",
|
||||
"params": {
|
||||
"id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518",
|
||||
"force": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "example:disconnect#2",
|
||||
"method": "disconnect",
|
||||
"params": {
|
||||
"id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59",
|
||||
"force": true
|
||||
}
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{},
|
||||
{}
|
||||
],
|
||||
"author": [
|
||||
"Michael Hawkins <<michael.hawkins@protonmail.com>>."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-connect(1)",
|
||||
"lightning-listpeers(1)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
63
doc/schemas/lightning-emergencyrecover.json
Normal file
63
doc/schemas/lightning-emergencyrecover.json
Normal file
|
@ -0,0 +1,63 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"rpc": "emergencyrecover",
|
||||
"title": "Command for recovering channels from the emergency.recovery file in the lightning directory",
|
||||
"description": [
|
||||
"The **emergencyrecover** RPC command fetches data from the emergency.recover file and tries to reconnect to the peer and force him to close the channel. The data in this file has enough information to reconnect and sweep the funds.",
|
||||
"",
|
||||
"This recovery method is not spontaneous and it depends on the peer, so it should be used as a last resort to recover the funds stored in a channel in case of severe data loss."
|
||||
],
|
||||
"request": {
|
||||
"required": [],
|
||||
"properties": {}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"stubs"
|
||||
],
|
||||
"properties": {
|
||||
"stubs": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "hash",
|
||||
"description": [
|
||||
"Channel IDs of channels successfully inserted."
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:emergencyrecover#1",
|
||||
"method": "emergencyrecover",
|
||||
"params": "{}"
|
||||
},
|
||||
{
|
||||
"id": "example:emergencyrecover#2",
|
||||
"method": "emergencyrecover",
|
||||
"params": "{}"
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"stubs": []
|
||||
},
|
||||
{
|
||||
"stubs": [
|
||||
"c00734472f344fdadd0bf787de182e5cf144ccda5d731b0f7c75befd1f1eff52"
|
||||
]
|
||||
}
|
||||
],
|
||||
"author": [
|
||||
"Aditya <<aditya.sharma20111@gmail.com>> is mainly responsible."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-getsharedsecret(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
488
doc/schemas/lightning-feerates.json
Normal file
488
doc/schemas/lightning-feerates.json
Normal file
|
@ -0,0 +1,488 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"rpc": "feerates",
|
||||
"title": "Command for querying recommended onchain feerates",
|
||||
"description": [
|
||||
"The **feerates** command returns the feerates that CLN will use. The feerates will be based on the recommended feerates from the backend. The backend may fail to provide estimates, but if it was able to provide estimates in the past, CLN will continue to use those for a while. CLN will also smoothen feerate estimations from the backend.",
|
||||
"",
|
||||
"Explorers often present fees in \"sat/vB\": 4 sat/vB is `4000perkb` or `1000perkw`.",
|
||||
"",
|
||||
"Bitcoin transactions have non-witness and witness bytes:",
|
||||
"",
|
||||
"* Non-witness bytes count as 4 weight, 1 virtual byte. All bytes other than SegWit witness count as non-witness bytes. * Witness bytes count as 1 weight, 0.25 virtual bytes.",
|
||||
"",
|
||||
"Thus, all *perkb* feerates will be exactly 4 times *perkw* feerates.",
|
||||
"",
|
||||
"To compute the fee for a transaction, multiply its weight or virtual bytes by the appropriate *perkw* or *perkw* feerate returned by this command, then divide by 1000.",
|
||||
"",
|
||||
"There is currently no way to change these feerates from the RPC. If you need custom control over onchain feerates, you will need to provide your own plugin that replaces the `bcli` plugin backend. For commands like lightning-withdraw(7) or lightning-fundchannel(7) you can provide a preferred feerate directly as a parameter, which will override the recommended feerates returned by **feerates**."
|
||||
],
|
||||
"request": {
|
||||
"required": [
|
||||
"style"
|
||||
],
|
||||
"properties": {
|
||||
"style": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Fee rate style to use. This can be:",
|
||||
" *perkw* - provide feerate in units of satoshis per 1000 weight (e.g. the minimum fee is usually `253perkw`).",
|
||||
" *perkb* - provide feerate in units of satoshis per 1000 virtual bytes (eg. the minimum fee is usually `1000perkb`)."
|
||||
],
|
||||
"enum": [
|
||||
"perkb",
|
||||
"perkw"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [],
|
||||
"properties": {
|
||||
"warning_missing_feerates": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Some fee estimates are missing."
|
||||
]
|
||||
},
|
||||
"perkb": {
|
||||
"type": "object",
|
||||
"description": [
|
||||
"If *style* parameter was perkb."
|
||||
],
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"min_acceptable",
|
||||
"max_acceptable",
|
||||
"floor",
|
||||
"estimates"
|
||||
],
|
||||
"properties": {
|
||||
"min_acceptable": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"The smallest feerate that we allow peers to specify: half the 100-block estimate."
|
||||
]
|
||||
},
|
||||
"max_acceptable": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"The largest feerate we will accept from remote negotiations. If a peer attempts to set the feerate higher than this we will unilaterally close the channel (or simply forget it if it's not open yet)."
|
||||
]
|
||||
},
|
||||
"floor": {
|
||||
"type": "u32",
|
||||
"added": "v23.05",
|
||||
"description": [
|
||||
"The smallest feerate that our backend tells us it will accept (i.e. minrelayfee or mempoolminfee)."
|
||||
]
|
||||
},
|
||||
"estimates": {
|
||||
"type": "array",
|
||||
"added": "v23.05",
|
||||
"description": [
|
||||
"Feerate estimates from plugin which we are using (usuallly bcli)."
|
||||
],
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"blockcount",
|
||||
"feerate",
|
||||
"smoothed_feerate"
|
||||
],
|
||||
"properties": {
|
||||
"blockcount": {
|
||||
"type": "u32",
|
||||
"added": "v23.05",
|
||||
"description": [
|
||||
"The number of blocks the feerate is expected to get a transaction in."
|
||||
]
|
||||
},
|
||||
"feerate": {
|
||||
"type": "u32",
|
||||
"added": "v23.05",
|
||||
"description": [
|
||||
"The feerate for this estimate, in given *style*."
|
||||
]
|
||||
},
|
||||
"smoothed_feerate": {
|
||||
"type": "u32",
|
||||
"added": "v23.05",
|
||||
"description": [
|
||||
"The feerate, smoothed over time (useful for coordinating with other nodes)."
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"opening": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"Default feerate for lightning-fundchannel(7) and lightning-withdraw(7)."
|
||||
]
|
||||
},
|
||||
"mutual_close": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"Feerate to aim for in cooperative shutdown. Note that since mutual close is a **negotiation**, the actual feerate used in mutual close will be somewhere between this and the corresponding mutual close feerate of the peer."
|
||||
]
|
||||
},
|
||||
"unilateral_close": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"Feerate for commitment_transaction in a live channel which we originally funded."
|
||||
]
|
||||
},
|
||||
"unilateral_anchor_close": {
|
||||
"type": "u32",
|
||||
"added": "v23.08",
|
||||
"description": [
|
||||
"Feerate for commitment_transaction in a live channel which we originally funded (if anchor_outputs was negotiated)."
|
||||
]
|
||||
},
|
||||
"delayed_to_us": {
|
||||
"type": "u32",
|
||||
"deprecated": [
|
||||
"v23.05",
|
||||
"v24.05"
|
||||
],
|
||||
"description": [
|
||||
"Feerate for returning unilateral close funds to our wallet."
|
||||
]
|
||||
},
|
||||
"htlc_resolution": {
|
||||
"type": "u32",
|
||||
"deprecated": [
|
||||
"v23.05",
|
||||
"v24.05"
|
||||
],
|
||||
"description": [
|
||||
"Feerate for returning unilateral close HTLC outputs to our wallet."
|
||||
]
|
||||
},
|
||||
"penalty": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"Feerate to use when creating penalty tx for watchtowers."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"perkw": {
|
||||
"type": "object",
|
||||
"description": [
|
||||
"If *style* parameter was perkw."
|
||||
],
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"min_acceptable",
|
||||
"max_acceptable",
|
||||
"floor",
|
||||
"estimates"
|
||||
],
|
||||
"properties": {
|
||||
"min_acceptable": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"The smallest feerate that you can use, usually the minimum relayed feerate of the backend."
|
||||
]
|
||||
},
|
||||
"max_acceptable": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"The largest feerate we will accept from remote negotiations. If a peer attempts to set the feerate higher than this we will unilaterally close the channel (or simply forget it if it's not open yet)."
|
||||
]
|
||||
},
|
||||
"floor": {
|
||||
"type": "u32",
|
||||
"added": "v23.05",
|
||||
"description": [
|
||||
"The smallest feerate that our backend tells us it will accept (i.e. minrelayfee or mempoolminfee)."
|
||||
]
|
||||
},
|
||||
"estimates": {
|
||||
"type": "array",
|
||||
"added": "v23.05",
|
||||
"description": [
|
||||
"Feerate estimates from plugin which we are using (usuallly bcli)."
|
||||
],
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"blockcount",
|
||||
"feerate",
|
||||
"smoothed_feerate"
|
||||
],
|
||||
"properties": {
|
||||
"blockcount": {
|
||||
"type": "u32",
|
||||
"added": "v23.05",
|
||||
"description": [
|
||||
"The number of blocks the feerate is expected to get a transaction in."
|
||||
]
|
||||
},
|
||||
"feerate": {
|
||||
"type": "u32",
|
||||
"added": "v23.05",
|
||||
"description": [
|
||||
"The feerate for this estimate, in given *style*."
|
||||
]
|
||||
},
|
||||
"smoothed_feerate": {
|
||||
"type": "u32",
|
||||
"added": "v23.05",
|
||||
"description": [
|
||||
"The feerate, smoothed over time (useful for coordinating with other nodes)."
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"opening": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"Default feerate for lightning-fundchannel(7) and lightning-withdraw(7)."
|
||||
]
|
||||
},
|
||||
"mutual_close": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"Feerate to aim for in cooperative shutdown. Note that since mutual close is a **negotiation**, the actual feerate used in mutual close will be somewhere between this and the corresponding mutual close feerate of the peer."
|
||||
]
|
||||
},
|
||||
"unilateral_close": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"Feerate for commitment_transaction in a live channel which we originally funded (if anchor_outputs was not negotiated)."
|
||||
]
|
||||
},
|
||||
"unilateral_anchor_close": {
|
||||
"type": "u32",
|
||||
"added": "v23.08",
|
||||
"description": [
|
||||
"Feerate for commitment_transaction in a live channel which we originally funded (if anchor_outputs was negotiated)."
|
||||
]
|
||||
},
|
||||
"delayed_to_us": {
|
||||
"type": "u32",
|
||||
"deprecated": [
|
||||
"v23.05",
|
||||
"v24.05"
|
||||
],
|
||||
"description": [
|
||||
"Feerate for returning unilateral close funds to our wallet."
|
||||
]
|
||||
},
|
||||
"htlc_resolution": {
|
||||
"type": "u32",
|
||||
"deprecated": [
|
||||
"v23.05",
|
||||
"v24.05"
|
||||
],
|
||||
"description": [
|
||||
"Feerate for returning unilateral close HTLC outputs to our wallet."
|
||||
]
|
||||
},
|
||||
"penalty": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"Feerate to use when creating penalty tx for watchtowers."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"onchain_fee_estimates": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"opening_channel_satoshis",
|
||||
"mutual_close_satoshis",
|
||||
"unilateral_close_satoshis",
|
||||
"htlc_timeout_satoshis",
|
||||
"htlc_success_satoshis"
|
||||
],
|
||||
"properties": {
|
||||
"opening_channel_satoshis": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"Estimated cost of typical channel open."
|
||||
]
|
||||
},
|
||||
"mutual_close_satoshis": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"Estimated cost of typical channel close."
|
||||
]
|
||||
},
|
||||
"unilateral_close_satoshis": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"Estimated cost of typical unilateral close (without HTLCs). If anchors are supported, this assumes a channel with anchors."
|
||||
]
|
||||
},
|
||||
"unilateral_close_nonanchor_satoshis": {
|
||||
"added": "v23.08",
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"Estimated cost of non-anchor typical unilateral close (without HTLCs)."
|
||||
]
|
||||
},
|
||||
"htlc_timeout_satoshis": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"Estimated cost of typical HTLC timeout transaction (non-anchors)."
|
||||
]
|
||||
},
|
||||
"htlc_success_satoshis": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"Estimated cost of typical HTLC fulfillment transaction (non-anchors)."
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"errors": [
|
||||
"The **feerates** command will never error, however some fields may be missing in the result if feerate estimates for that kind of transaction are unavailable."
|
||||
],
|
||||
"notes": [
|
||||
"Many other commands have a *feerate* parameter. This can be:",
|
||||
"",
|
||||
"* One of the strings to use lightningd's internal estimates:",
|
||||
" * *urgent* (next 6 blocks or so)",
|
||||
" * *normal* (next 12 blocks or so)",
|
||||
" * *slow* (next 100 blocks or so)",
|
||||
" * *minimum* for the lowest value bitcoind will currently accept (added in v23.05)",
|
||||
"",
|
||||
"* A number, with an optional suffix:",
|
||||
" * *blocks* means aim for confirmation in that many blocks (added in v23.05)",
|
||||
" * *perkw* means the number is interpreted as satoshi-per-kilosipa (weight)",
|
||||
" * *perkb* means it is interpreted bitcoind-style as satoshi-per-kilobyte. ",
|
||||
"",
|
||||
"Omitting the suffix is equivalent to *perkb*."
|
||||
],
|
||||
"trivia": [
|
||||
"In C-lightning we like to call the weight unit \"sipa\" in honor of Pieter Wuille, who uses the name \"sipa\" on IRC and elsewhere. Internally we call the *perkw* style as \"feerate per kilosipa\"."
|
||||
],
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:feerates#1",
|
||||
"method": "feerates",
|
||||
"params": {
|
||||
"style": "perkw",
|
||||
"urgent": null,
|
||||
"normal": null,
|
||||
"slow": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "example:feerates#2",
|
||||
"method": "feerates",
|
||||
"params": {
|
||||
"style": "perkb",
|
||||
"urgent": null,
|
||||
"normal": null,
|
||||
"slow": null
|
||||
}
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"perkw": {
|
||||
"opening": 1000000,
|
||||
"mutual_close": 26362,
|
||||
"unilateral_close": 26362,
|
||||
"unilateral_anchor_close": 1000000,
|
||||
"penalty": 26362,
|
||||
"min_acceptable": 3750,
|
||||
"max_acceptable": 10000000,
|
||||
"floor": 253,
|
||||
"estimates": [
|
||||
{
|
||||
"blockcount": 2,
|
||||
"feerate": 1000000,
|
||||
"smoothed_feerate": 26362
|
||||
},
|
||||
{
|
||||
"blockcount": 6,
|
||||
"feerate": 1000000,
|
||||
"smoothed_feerate": 26362
|
||||
},
|
||||
{
|
||||
"blockcount": 12,
|
||||
"feerate": 1000000,
|
||||
"smoothed_feerate": 26362
|
||||
},
|
||||
{
|
||||
"blockcount": 100,
|
||||
"feerate": 1000000,
|
||||
"smoothed_feerate": 26362
|
||||
}
|
||||
]
|
||||
},
|
||||
"onchain_fee_estimates": {
|
||||
"opening_channel_satoshis": 702000,
|
||||
"mutual_close_satoshis": 17741,
|
||||
"unilateral_close_satoshis": 1112000,
|
||||
"unilateral_close_nonanchor_satoshis": 15764,
|
||||
"htlc_timeout_satoshis": 17478,
|
||||
"htlc_success_satoshis": 18532
|
||||
}
|
||||
},
|
||||
{
|
||||
"perkb": {
|
||||
"opening": 25000,
|
||||
"mutual_close": 25000,
|
||||
"unilateral_close": 44000,
|
||||
"unilateral_anchor_close": 25000,
|
||||
"penalty": 25000,
|
||||
"min_acceptable": 12500,
|
||||
"max_acceptable": 600000,
|
||||
"floor": 1012,
|
||||
"estimates": [
|
||||
{
|
||||
"blockcount": 2,
|
||||
"feerate": 60000,
|
||||
"smoothed_feerate": 60000
|
||||
},
|
||||
{
|
||||
"blockcount": 6,
|
||||
"feerate": 44000,
|
||||
"smoothed_feerate": 44000
|
||||
},
|
||||
{
|
||||
"blockcount": 12,
|
||||
"feerate": 25000,
|
||||
"smoothed_feerate": 25000
|
||||
}
|
||||
]
|
||||
},
|
||||
"onchain_fee_estimates": {
|
||||
"opening_channel_satoshis": 4387,
|
||||
"mutual_close_satoshis": 4206,
|
||||
"unilateral_close_satoshis": 6578,
|
||||
"unilateral_close_nonanchor_satoshis": 6578,
|
||||
"htlc_timeout_satoshis": 7293,
|
||||
"htlc_success_satoshis": 7733
|
||||
}
|
||||
}
|
||||
],
|
||||
"author": [
|
||||
"ZmnSCPxj <<ZmnSCPxj@protonmail.com>> wrote the initial version of this manpage."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-parsefeerate(7)",
|
||||
"lightning-fundchannel(7)",
|
||||
"lightning-withdraw(7)",
|
||||
"lightning-txprepare(7)",
|
||||
"lightning-fundchannel_start(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
227
doc/schemas/lightning-fetchinvoice.json
Normal file
227
doc/schemas/lightning-fetchinvoice.json
Normal file
|
@ -0,0 +1,227 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"rpc": "fetchinvoice",
|
||||
"title": "Command for fetch an invoice for an offer",
|
||||
"warning": "experimental-offers only",
|
||||
"description": [
|
||||
"The **fetchinvoice** RPC command contacts the issuer of an *offer* to get an actual invoice that can be paid. It highlights any changes between the offer and the returned invoice.",
|
||||
"",
|
||||
"If **fetchinvoice-noconnect** is not specified in the configuation, it will connect to the destination in the (currently common!) case where it cannot find a route which supports `option_onion_messages`."
|
||||
],
|
||||
"request": {
|
||||
"required": [
|
||||
"offer"
|
||||
],
|
||||
"properties": {
|
||||
"offer": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Offer string to get an actual invoice that can be paid."
|
||||
]
|
||||
},
|
||||
"amount_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"Required if the offer does not specify an amount at all, otherwise it is optional (but presumably if you set it to less than the offer, you will get an error from the issuer)."
|
||||
]
|
||||
},
|
||||
"quantity": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"Required if the offer specifies quantity_max, otherwise it is not allowed."
|
||||
]
|
||||
},
|
||||
"recurrence_counter": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"Required if the offer specifies recurrence, otherwise it is not allowed. recurrence_counter should first be set to 0, and incremented for each successive invoice in a given series."
|
||||
]
|
||||
},
|
||||
"recurrence_start": {
|
||||
"type": "number",
|
||||
"description": [
|
||||
"Required if the offer specifies recurrence_base with start_any_period set, otherwise it is not allowed. It indicates what period number to start at."
|
||||
]
|
||||
},
|
||||
"recurrence_label": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Required if recurrence_counter is set, and otherwise is not allowed. It must be the same as prior fetchinvoice calls for the same recurrence, as it is used to link them together."
|
||||
]
|
||||
},
|
||||
"timeout": {
|
||||
"type": "number",
|
||||
"description": [
|
||||
"If we don't get a reply before this we fail (default, 60 seconds)."
|
||||
]
|
||||
},
|
||||
"payer_note": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"To ask the issuer to include in the fetched invoice."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"invoice",
|
||||
"changes"
|
||||
],
|
||||
"properties": {
|
||||
"invoice": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The BOLT12 invoice we fetched."
|
||||
]
|
||||
},
|
||||
"changes": {
|
||||
"type": "object",
|
||||
"description": [
|
||||
"Summary of changes from offer."
|
||||
],
|
||||
"additionalProperties": false,
|
||||
"required": [],
|
||||
"properties": {
|
||||
"description_appended": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Extra characters appended to the *description* field."
|
||||
]
|
||||
},
|
||||
"description": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"A completely replaced *description* field."
|
||||
]
|
||||
},
|
||||
"vendor_removed": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The *vendor* from the offer, which is missing in the invoice."
|
||||
]
|
||||
},
|
||||
"vendor": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"A completely replaced *vendor* field."
|
||||
]
|
||||
},
|
||||
"amount_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"The amount, if different from the offer amount multiplied by any *quantity* (or the offer had no amount, or was not in BTC)."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"next_period": {
|
||||
"type": "object",
|
||||
"description": [
|
||||
"Only for recurring invoices if the next period is under the *recurrence_limit*."
|
||||
],
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"counter",
|
||||
"starttime",
|
||||
"endtime",
|
||||
"paywindow_start",
|
||||
"paywindow_end"
|
||||
],
|
||||
"properties": {
|
||||
"counter": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"The index of the next period to fetchinvoice."
|
||||
]
|
||||
},
|
||||
"starttime": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"UNIX timestamp that the next period starts."
|
||||
]
|
||||
},
|
||||
"endtime": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"UNIX timestamp that the next period ends."
|
||||
]
|
||||
},
|
||||
"paywindow_start": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"UNIX timestamp of the earliest time that the next invoice can be fetched."
|
||||
]
|
||||
},
|
||||
"paywindow_end": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"UNIX timestamp of the latest time that the next invoice can be fetched."
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"errors": [
|
||||
"The following error codes may occur:",
|
||||
"",
|
||||
"- -1: Catchall nonspecific error.",
|
||||
"- 1002: Offer has expired.",
|
||||
"- 1003: Cannot find a route to the node making the offer.",
|
||||
"- 1004: The node making the offer returned an error message.",
|
||||
"- 1005: We timed out trying to fetch an invoice."
|
||||
],
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:fetchinvoice#1",
|
||||
"method": "fetchinvoice",
|
||||
"params": {
|
||||
"offer": "lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcgqypq5zmnd9khqmr9yp6x2um5zcssxhftzxfdlwsnfcgw2sy8t5mxa0ytcdfat2nkdwqvpy9nnsa9mzza",
|
||||
"payer_note": "Thanks for the fish!"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "example:fetchinvoice#2",
|
||||
"method": "fetchinvoice",
|
||||
"params": {
|
||||
"offer": "lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcgqypq5zmnd9khqmr9yp6x2um5zcssxhftzxfdlwsnfcgw2sy8t5mxa0ytcdfat2nkdwqvpy9nnsa9mzza",
|
||||
"amount_msat": 3
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "example:fetchinvoice#3",
|
||||
"method": "fetchinvoice",
|
||||
"params": {
|
||||
"offer": "lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcgqypq5zmnd9khqmr9yp6x2um5zsqs593pqgkjyd3q5dv6gllh77kygly9c3kfy0d9xwyjyxsq2nq3c83u5vw4j",
|
||||
"quantity": 2
|
||||
}
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"invoice": "lni1qqgvcm9h7yakcmw4mzazspu8vfgpwq3qqc3xu3s3rg94nj40zfsy866mhu5vxne6tcej5878k2mneuvgjy8ssqgzpg9hx6tdwpkx2gr5v4ehg93pqdwjkyvjm7apxnssu4qgwhfkd67ghs6n6k48v6uqczgt88p6tky965pqqc3xu3s3rg94nj40zfsy866mhu5vxne6tcej5878k2mneuvgjy84sggren772kj8mau5jp86nc6fszx48rv7ep0quszyyls8rlld3sshjr94j9z5dpsku6mnypnx7u3qw35x2grxd9eksgdqnqp462c3jt0m5y6wzrj5pp6axehtez7r20265antsrqfpvuu8fwcshgr0tsv8e6829e8xmv7laz0kwhtlx6vtk8q3d6rtthdhtwvnn6j585szquc2t7us8kguxypzasg8ewkakgx2ny5ugks0f32x67sm9e5fms4asqrylajc2dqh8ag55mv5p5ghy3e2z8zwmllle8uu7jsxv5ke8d6rr5h7kthmz7ya0hxp4nt7elvw7vghcl6fgsuqqqqqqqqqqqqqqq9qqqqqqqqqqqqq8fykt06c5sqqqqqpfqyvhtunn4gyzy0lphn4wn6ctzlsajy46wscjcglf3hxcnvlaxqs3ydkhgaklsc42spq2czzq6a9vge9ha6zd8ppe2qsawnvm4u30p484d2we4cpsyskwwr5hvgthcyqyuen02ejwpa9cjjrttvp223yxsqkrwnlaszkhas84w0ape300ued4p75xu3cqtcg0cslsx9fvh7dhdqx565t6wa0alf6u2hug90j2hs",
|
||||
"changes": {}
|
||||
},
|
||||
{
|
||||
"invoice": "lni1qqg0mfchkz0gkmn8zzu5zaxd0qvlzq3qqc3xu3s3rg94nj40zfsy866mhu5vxne6tcej5878k2mneuvgjy8ssqgzpg9hx6tdwpkx2gr5v4ehg93pqdwjkyvjm7apxnssu4qgwhfkd67ghs6n6k48v6uqczgt88p6tky965pqqc3xu3s3rg94nj40zfsy866mhu5vxne6tcej5878k2mneuvgjy84yqgrtqss8d4vgzd3286u9rk0zg9qr7a6z2xm6mjnz9pydztcn0j74tjvch0f5zvqxhftzxfdlwsnfcgw2sy8t5mxa0ytcdfat2nkdwqvpy9nnsa9mzzaqth4fzjqxxmsaxvc4v2urs6hsh6k0e564x00g68vuyp5w7yjedzxvqgr8ltzmj0n7ltxr0tz9rafn9zcy9jldjqfuf20w6gjmr7nj04d360sqvkdwprxn22dlp3xay9yq4nhrw2jm0c8t6r7japhdad6leawxyqzkg92tx8gqxp9f2d8j5k2axta0gr7yr9zrsqqqqqqqqqqqqqqq5qqqqqqqqqqqqqayjedltzjqqqqqq9yq3ja0jwj4qswt3kgs9mxq7gck66x60m5rndykpw3a7hf4ntlp9qe2vgwzzrvcwd2qypmqggrt543ryklhgf5uy89gzr46dnwhj9ux5744fmxhqxqjzeecwja3pwlqsxyjcdwur4hl4qf7nsjgg8euvy45lznufh5kydkwz6llsucuhvwp9ezeggaj3k057ge6ftvaffjkwn6j3y7faeuysrx3m2xccphu65sx",
|
||||
"changes": {}
|
||||
},
|
||||
{
|
||||
"invoice": "lni1qqgd508mv9rpjg2ec8dr8qcslf2cjq3qqc3xu3s3rg94nj40zfsy866mhu5vxne6tcej5878k2mneuvgjy8ssqgzpg9hx6tdwpkx2gr5v4ehg9qppgtzzq3dygmzpg6e53ll0aavg37gt3rvjg762vufygdqq4xprs0regcat9gzqp3zderpzxstt8927ynqg044h0egcd8n5h3n9g0u0v4h8ncc3yg02cqsykppqfkyy6q8ry9pchxtuajh456hhcf7dxx733cx76etuv5ftfmfa2ymhgycqgkjyd3q5dv6gllh77kygly9c3kfy0d9xwyjyxsq2nq3c83u5vw4jq6uhkeymz26zx7zgw4gdmw2vj9xqn4hu2sqxhp0pcgt87pf9chyfvqsywtejxjh603kx7am3zaf6d6xuumw30p8zmcdz7r95nn4lr92exk3qqe2x6xqwpdzh2zwq3vnyra8nfc6d7y6hegpkvc7p2nulj7hvhwl5hjfr23wn60mjftqspn7d4ejhrpsr5m2y8qqqqqqqqqqqqqqqpgqqqqqqqqqqqqp6f9jm7k9yqqqqqq2gpr96l9mt2pqxuyr0gqw92h0xz2y2uy5uxss4ujcac5jehj9ay2sxkapr80t5ha65qgykqssytfzxcs2xkdy0lml0tzy0jzugmyj8kjn8zfzrgq9fsgurc72x82e7pqxhl4u29cjluw5s8fwa9wtvh0qytr7vqk0vtndsz07mrrtmjw629m8mnqkjaf43kt889qeq2f7deu6t853lngpzclapt8nj0g528v9ay",
|
||||
"changes": {}
|
||||
}
|
||||
],
|
||||
"author": [
|
||||
"Rusty Russell <<rusty@rustcorp.com.au>> is mainly responsible."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-sendinvoice(7)",
|
||||
"lightning-pay(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
310
doc/schemas/lightning-fundchannel.json
Normal file
310
doc/schemas/lightning-fundchannel.json
Normal file
|
@ -0,0 +1,310 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"rpc": "fundchannel",
|
||||
"title": "Command for establishing a lightning channel",
|
||||
"description": [
|
||||
"The **fundchannel** RPC command opens a payment channel with a peer by committing a funding transaction to the blockchain as defined in BOLT #2.",
|
||||
"",
|
||||
"If not already connected, **fundchannel** will automatically attempt to connect if Core Lightning knows a way to contact the node (either from normal gossip, or from a previous **connect** call).",
|
||||
"",
|
||||
"This auto-connection can fail if Core Lightning does not know how to contact the target node; see lightning-connect(7).",
|
||||
"",
|
||||
"Once the transaction is confirmed, normal channel operations may begin. Readiness is indicated by **listpeers** reporting a *state* of `CHANNELD_NORMAL` for the channel."
|
||||
],
|
||||
"request": {
|
||||
"required": [
|
||||
"id",
|
||||
"amount"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "pubkey",
|
||||
"description": [
|
||||
"Id is the peer id obtained from connect."
|
||||
]
|
||||
},
|
||||
"amount": {
|
||||
"type": "msat_or_all",
|
||||
"description": [
|
||||
"The amount in satoshis taken from the internal wallet to fund the channel (but if we have any anchor channels, this will always leave at least `min-emergency- msat` as change). The string *all* can be used to specify all available funds (or 16777215 satoshi if more is available and large channels were not negotiated with the peer). Otherwise, it is in satoshi precision; it can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*. The value cannot be less than the dust limit, currently set to 546, nor more than 16777215 satoshi (unless large channels were negotiated with the peer)."
|
||||
]
|
||||
},
|
||||
"feerate": {
|
||||
"type": "feerate",
|
||||
"description": [
|
||||
"Used for the opening transaction and (unless *option_anchors_zero_fee_htlc_tx* is negotiated), as initial feerate for commitment and HTLC transactions (see NOTES in lightning-feerates(7))."
|
||||
],
|
||||
"default": "*normal*"
|
||||
},
|
||||
"announce": {
|
||||
"type": "boolean",
|
||||
"description": [
|
||||
"Whether to announce this channel or not. An unannounced channel is considered private."
|
||||
],
|
||||
"default": "True"
|
||||
},
|
||||
"minconf": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"The minimum number of confirmations that used outputs should have."
|
||||
],
|
||||
"default": "1"
|
||||
},
|
||||
"push_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"The amount of millisatoshis to push to the channel peer at open. Note that this is a gift to the peer -- these satoshis are added to the initial balance of the peer at channel start and are largely unrecoverable once pushed."
|
||||
]
|
||||
},
|
||||
"close_to": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"A Bitcoin address to which the channel funds should be sent to on close. Only valid if both peers have negotiated `option_upfront_shutdown_script`. Returns `close_to` set to closing script iff is negotiated."
|
||||
]
|
||||
},
|
||||
"request_amt": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"An amount of liquidity you'd like to lease from the peer. If peer supports `option_will_fund`, indicates to them to include this much liquidity into the channel. Must also pass in *compact_lease*."
|
||||
]
|
||||
},
|
||||
"compact_lease": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"A compact representation of the peer's expected channel lease terms. If the peer's terms don't match this set, we will fail to open the channel."
|
||||
]
|
||||
},
|
||||
"utxos": {
|
||||
"type": "array",
|
||||
"description": [
|
||||
"The utxos to be used to fund the channel, as an array of `txid:vout`."
|
||||
],
|
||||
"items": {
|
||||
"type": "outpoint"
|
||||
}
|
||||
},
|
||||
"mindepth": {
|
||||
"description": [
|
||||
"Number of confirmations required before we consider the channel active."
|
||||
],
|
||||
"type": "u32"
|
||||
},
|
||||
"reserve": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"The amount we want the peer to maintain on its side of the channel. It can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*."
|
||||
],
|
||||
"default": "1% of the funding amount"
|
||||
},
|
||||
"channel_type": {
|
||||
"added": "v24.02",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"Represents the explicit channel type to request. There is currently no sanity checking on this value so if you use strange values and your channel breaks, you get to keep both pieces. BOLT 2 defines the following value types:",
|
||||
"```",
|
||||
"The currently defined basic types are:",
|
||||
" - no features (no bits set).",
|
||||
" - `option_static_remotekey` (bit 12).",
|
||||
" - `option_anchor_outputs` and `option_static_remotekey` (bits 20 and 12).",
|
||||
" - `option_anchors_zero_fee_htlc_tx` and `option_static_remotekey` (bits 22 and 12).",
|
||||
"",
|
||||
"Each basic type has the following variations allowed:",
|
||||
" - `option_scid_alias` (bit 46).",
|
||||
" - `option_zeroconf` (bit 50).",
|
||||
"```"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"tx",
|
||||
"txid",
|
||||
"outnum",
|
||||
"channel_type",
|
||||
"channel_id"
|
||||
],
|
||||
"properties": {
|
||||
"tx": {
|
||||
"type": "hex",
|
||||
"description": [
|
||||
"The raw transaction which funded the channel."
|
||||
]
|
||||
},
|
||||
"txid": {
|
||||
"type": "txid",
|
||||
"description": [
|
||||
"The txid of the transaction which funded the channel."
|
||||
]
|
||||
},
|
||||
"outnum": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"The 0-based output index showing which output funded the channel."
|
||||
]
|
||||
},
|
||||
"channel_id": {
|
||||
"type": "hash",
|
||||
"description": [
|
||||
"The channel_id of the resulting channel."
|
||||
]
|
||||
},
|
||||
"channel_type": {
|
||||
"type": "object",
|
||||
"description": [
|
||||
"Channel_type as negotiated with peer."
|
||||
],
|
||||
"added": "v24.02",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"bits",
|
||||
"names"
|
||||
],
|
||||
"properties": {
|
||||
"bits": {
|
||||
"type": "array",
|
||||
"description": [
|
||||
"Each bit set in this channel_type."
|
||||
],
|
||||
"added": "v24.02",
|
||||
"items": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"Bit number."
|
||||
]
|
||||
}
|
||||
},
|
||||
"names": {
|
||||
"type": "array",
|
||||
"description": [
|
||||
"Feature name for each bit set in this channel_type."
|
||||
],
|
||||
"added": "v24.02",
|
||||
"items": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"static_remotekey/even",
|
||||
"anchor_outputs/even",
|
||||
"anchors_zero_fee_htlc_tx/even",
|
||||
"scid_alias/even",
|
||||
"zeroconf/even"
|
||||
],
|
||||
"description": [
|
||||
"Name of feature bit."
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"close_to": {
|
||||
"type": "hex",
|
||||
"description": [
|
||||
"The raw scriptPubkey which mutual close will go to; only present if *close_to* parameter was specified and peer supports `option_upfront_shutdown_script`."
|
||||
]
|
||||
},
|
||||
"mindepth": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"Number of confirmations before we consider the channel active."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"example_usage": [
|
||||
"This example shows how to use lightning-cli to open new channel with peer 03f...fc1 from one whole utxo bcc1...39c:0 (you can use **listfunds** command to get txid and vout):",
|
||||
"",
|
||||
"```shell",
|
||||
"lightning-cli -k fundchannel id=03f...fc1 amount=all feerate=normal utxos='[\"bcc1...39c:0\"]'",
|
||||
"```"
|
||||
],
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:fundchannel#1",
|
||||
"method": "fundchannel",
|
||||
"params": {
|
||||
"id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59",
|
||||
"amount": 1000000,
|
||||
"feerate": null,
|
||||
"announce": true,
|
||||
"minconf": null,
|
||||
"utxos": null,
|
||||
"push_msat": null,
|
||||
"close_to": null,
|
||||
"request_amt": null,
|
||||
"compact_lease": null,
|
||||
"mindepth": null,
|
||||
"reserve": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "example:fundchannel#2",
|
||||
"method": "fundchannel",
|
||||
"params": {
|
||||
"id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59",
|
||||
"amount": 10000000,
|
||||
"feerate": null,
|
||||
"announce": true,
|
||||
"minconf": null,
|
||||
"utxos": null,
|
||||
"push_msat": 1000000000,
|
||||
"close_to": null,
|
||||
"request_amt": null,
|
||||
"compact_lease": null,
|
||||
"mindepth": null,
|
||||
"reserve": null,
|
||||
"channel_type": null
|
||||
}
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"tx": "020000000001014ca47b75e6982fce6b5ebb6e7ec163dc5b6bed1562934e6febe816103b2b207e0000000000fdffffff0240420f00000000002200205b8cd3b914cf67cdd8fa6273c930353dd36476734fbd962102c2df53b90880cd012f0f000000000022512063ffee4ea7d51e6cadf9086e286a2527922aaa25b8c53aebf32fa32a0a627f5a02473044022058fc4d51c8254d37b266d3db3f8fda7420882b6ec9226d66b8c0139f2707c09602205798d8ce23d4c692a7384362a2e0afd9703f062239a786d7a1840a28d3a1152e012103d745445c9362665f22e0d96e9e766f273f3260dea39c8a76bfa05dd2684ddccf66000000",
|
||||
"txid": "6c0a3d8f32f556f3bd8b8c85413c4636a9513c6195abb925ea73c47183d40b7b",
|
||||
"channel_id": "7b0bd48371c473ea25b9ab95613c51a936463c41858c8bbdf356f5328f3d0a6c",
|
||||
"outnum": 0
|
||||
},
|
||||
{
|
||||
"tx": "0200000000010141cfa0e9957c7c6d0bb5069d92937f9545e6e6ee9b4650f47f509d5ea65df4690100000000fdffffff0280969800000000002200205b8cd3b914cf67cdd8fa6273c930353dd36476734fbd962102c2df53b90880cd4118530b0000000022512063ffee4ea7d51e6cadf9086e286a2527922aaa25b8c53aebf32fa32a0a627f5a0247304402206488c7dfbc4180781ed0d5ca7ff2c8ce134480c349d03978765053a393229d9a022066c75dee1f19b410ea1c7756d0cb2c097e52b13f4d9bbd033efa4ed95d817e14012103d745445c9362665f22e0d96e9e766f273f3260dea39c8a76bfa05dd2684ddccf66000000",
|
||||
"txid": "6aa1231b6356777468a55aea1f49dad6415592aef6c1e652f8a64357c7235301",
|
||||
"channel_id": "015323c75743a6f852e6c1f6ae925541d6da491fea5aa568747756631b23a16a",
|
||||
"channel_type": {
|
||||
"bits": [
|
||||
12,
|
||||
22
|
||||
],
|
||||
"names": [
|
||||
"static_remotekey/even",
|
||||
"anchors_zero_fee_htlc_tx/even"
|
||||
]
|
||||
},
|
||||
"outnum": 0
|
||||
}
|
||||
],
|
||||
"errors": [
|
||||
"The following error codes may occur:",
|
||||
"",
|
||||
"- -1: Catchall nonspecific error.",
|
||||
"- 300: The maximum allowed funding amount is exceeded.",
|
||||
"- 301: There are not enough funds in the internal wallet (including fees) to create the transaction.",
|
||||
"- 302: The output amount is too small, and would be considered dust.",
|
||||
"- 303: Broadcasting of the funding transaction failed, the internal call to bitcoin-cli returned with an error.",
|
||||
"- 313: The `min-emergency-msat` reserve not be preserved (and we have or are opening anchor channels).",
|
||||
"",
|
||||
"Failure may also occur if **lightningd** and the peer cannot agree on channel parameters (funding limits, channel reserves, fees, etc.)."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-connect(7)",
|
||||
"lightning-listfunds()",
|
||||
"lightning-listpeers(7)",
|
||||
"lightning-feerates(7)",
|
||||
"lightning-multifundchannel(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
89
doc/schemas/lightning-fundchannel_cancel.json
Normal file
89
doc/schemas/lightning-fundchannel_cancel.json
Normal file
|
@ -0,0 +1,89 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"rpc": "fundchannel_cancel",
|
||||
"title": "Command for completing channel establishment",
|
||||
"description": [
|
||||
"`fundchannel_cancel` is a lower level RPC command. It allows channel opener to cancel a channel before funding broadcast with a connected peer.",
|
||||
"",
|
||||
"Note that the funding transaction MUST NOT be broadcast before `fundchannel_cancel`. Broadcasting transaction before `fundchannel_cancel` WILL lead to unrecoverable loss of funds.",
|
||||
"",
|
||||
"If `fundchannel_cancel` is called after `fundchannel_complete`, the remote peer may disconnect when command succeeds. In this case, user need to connect to remote peer again before opening channel."
|
||||
],
|
||||
"request": {
|
||||
"required": [
|
||||
"id"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "pubkey",
|
||||
"description": [
|
||||
"Node id of the remote peer with which to cancel."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"cancelled"
|
||||
],
|
||||
"properties": {
|
||||
"cancelled": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"A message indicating it was cancelled by RPC."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:fundchannel_cancel#1",
|
||||
"method": "fundchannel_cancel",
|
||||
"params": {
|
||||
"id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "example:fundchannel_cancel#2",
|
||||
"method": "fundchannel_cancel",
|
||||
"params": {
|
||||
"id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59"
|
||||
}
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"cancelled": "Channel open canceled by RPC"
|
||||
},
|
||||
{
|
||||
"cancelled": "Channel open canceled by RPC(after fundchannel_complete)"
|
||||
}
|
||||
],
|
||||
"errors": [
|
||||
"On error the returned object will contain `code` and `message` properties, with `code` being one of the following:",
|
||||
"",
|
||||
"- -32602: If the given parameters are wrong.",
|
||||
"- 306: Unknown peer id.",
|
||||
"- 307: No channel currently being funded that can be cancelled.",
|
||||
"- 308: It is unsafe to cancel the channel: the funding transaction has been broadcast, or there are HTLCs already in the channel, or the peer was the initiator and not us."
|
||||
],
|
||||
"author": [
|
||||
"Lisa Neigut <<niftynei@gmail.com>> is mainly responsible."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-connect(7)",
|
||||
"lightning-fundchannel(7)",
|
||||
"lightning-multifundchannel(7)",
|
||||
"lightning-fundchannel_start(7)",
|
||||
"lightning-fundchannel_complete(7)",
|
||||
"lightning-openchannel_init(7)",
|
||||
"lightning-openchannel_update(7)",
|
||||
"lightning-openchannel_signed(7)",
|
||||
"lightning-openchannel_abort(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
98
doc/schemas/lightning-fundchannel_complete.json
Normal file
98
doc/schemas/lightning-fundchannel_complete.json
Normal file
|
@ -0,0 +1,98 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"rpc": "fundchannel_complete",
|
||||
"title": "Command for completing channel establishment",
|
||||
"description": [
|
||||
"`fundchannel_complete` is a lower level RPC command. It allows a user to complete an initiated channel establishment with a connected peer.",
|
||||
"",
|
||||
"Note that the funding transaction MUST NOT be broadcast until after channel establishment has been successfully completed, as the commitment transactions for this channel are not secured until this command successfully completes. Broadcasting transaction before can lead to unrecoverable loss of funds."
|
||||
],
|
||||
"request": {
|
||||
"required": [
|
||||
"id",
|
||||
"psbt"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "pubkey",
|
||||
"description": [
|
||||
"Node id of the remote peer."
|
||||
]
|
||||
},
|
||||
"psbt": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Transaction to use for funding (does not need to be signed but must be otherwise complete)."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"channel_id",
|
||||
"commitments_secured"
|
||||
],
|
||||
"properties": {
|
||||
"channel_id": {
|
||||
"type": "hash",
|
||||
"description": [
|
||||
"The channel_id of the resulting channel."
|
||||
]
|
||||
},
|
||||
"commitments_secured": {
|
||||
"type": "boolean",
|
||||
"enum": [
|
||||
true
|
||||
],
|
||||
"description": [
|
||||
"Indication that channel is safe to use."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"errors": [
|
||||
"On error the returned object will contain `code` and `message` properties, with `code` being one of the following:",
|
||||
"",
|
||||
"- -32602: If the given parameters are wrong.",
|
||||
"- -1: Catchall nonspecific error.",
|
||||
"- 305: Peer is not connected.",
|
||||
"- 306: Unknown peer id.",
|
||||
"- 309: PSBT does not have a unique, correct output to fund the channel."
|
||||
],
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:fundchannel_complete#1",
|
||||
"method": "fundchannel_complete",
|
||||
"params": {
|
||||
"id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59",
|
||||
"psbt": "cHNidP8BAIkCAAAAASYd4TeOHEIzrUbbELM2DK0IX09WaXqWsJFlLD455MPPAAAAAAD9////Av///wAAAAAAIgAgW4zTuRTPZ83Y+mJzyTA1PdNkdnNPvZYhAsLfU7kIgM1c8QUpAQAAACJRIH8AZYBKMKON4/oVmJVsVt6zy/+PkBPzziE+LtkuFvWXAAAAAAABAIMCAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////wJRAP////8CAPIFKgEAAAAWABQ5FIjuMd8ar9WFRV9eGNLF+3RMcAAAAAAAAAAAJmokqiGp7eL2HD9x0d79P6mZ36NpU3VcaQaJeZlitIvr2DaXToz5AAAAAAEBHwDyBSoBAAAAFgAUORSI7jHfGq/VhUVfXhjSxft0THAiBgMegIxEPDa2OseVTaV6ANtSwQuoj/j2an7X/Is2EekvWBhhFDNgVAAAgAEAAIAAAACAAAAAAAAAAAAAAAEFIEm9AFgqUlJwbPFtyt3a9dzvb+nAGZiQ3CT1CImhjBFpIQdJvQBYKlJScGzxbcrd2vXc72/pwBmYkNwk9QiJoYwRaRkAYRQzYFYAAIABAACAAAAAgAEAAAAAAAAAAA=="
|
||||
}
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"channel_id": "049217e5035a4a60449c6382c445b5c105bd63588d66137ad0511c57a16db6d9",
|
||||
"commitments_secured": true
|
||||
}
|
||||
],
|
||||
"author": [
|
||||
"Lisa Neigut <<niftynei@gmail.com>> is mainly responsible."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-connect(7)",
|
||||
"lightning-fundchannel(7)",
|
||||
"lightning-multifundchannel(7)",
|
||||
"lightning-fundchannel_start(7)",
|
||||
"lightning-fundchannel_cancel(7)",
|
||||
"lightning-openchannel_init(7)",
|
||||
"lightning-openchannel_update(7)",
|
||||
"lightning-openchannel_signed(7)",
|
||||
"lightning-openchannel_bump(7)",
|
||||
"lightning-openchannel_abort(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
256
doc/schemas/lightning-fundchannel_start.json
Normal file
256
doc/schemas/lightning-fundchannel_start.json
Normal file
|
@ -0,0 +1,256 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"rpc": "fundchannel_start",
|
||||
"title": "Command for initiating channel establishment for a lightning channel",
|
||||
"description": [
|
||||
"`fundchannel_start` is a lower level RPC command. It allows a user to initiate channel establishment with a connected peer.",
|
||||
"",
|
||||
"Note that the funding transaction MUST NOT be broadcast until after channel establishment has been successfully completed by running `fundchannel_complete`, as the commitment transactions for this channel are not secured until the complete command succeeds. Broadcasting transaction before that can lead to unrecoverable loss of funds."
|
||||
],
|
||||
"request": {
|
||||
"required": [
|
||||
"id",
|
||||
"amount"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "pubkey",
|
||||
"description": [
|
||||
"The peer id obtained from connect."
|
||||
]
|
||||
},
|
||||
"amount": {
|
||||
"type": "sat",
|
||||
"description": [
|
||||
"Satoshi value that the channel will be funded at. This value MUST be accurate, otherwise the negotiated commitment transactions will not encompass the correct channel value."
|
||||
]
|
||||
},
|
||||
"feerate": {
|
||||
"type": "feerate",
|
||||
"description": [
|
||||
"Feerate for subsequent commitment transactions: see **fundchannel**. Note that this is ignored for channels with *option_anchors_zero_fee_htlc_tx* (we always use a low commitment fee for these)."
|
||||
]
|
||||
},
|
||||
"announce": {
|
||||
"type": "boolean",
|
||||
"description": [
|
||||
"Whether or not to announce this channel."
|
||||
]
|
||||
},
|
||||
"close_to": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Bitcoin address to which the channel funds should be sent to on close. Only valid if both peers have negotiated `option_upfront_shutdown_script`. Returns `close_to` set to closing script iff is negotiated."
|
||||
]
|
||||
},
|
||||
"push_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"Amount of millisatoshis to push to the channel peer at open. Note that this is a gift to the peer -- these satoshis are added to the initial balance of the peer at channel start and are largely unrecoverable once pushed."
|
||||
]
|
||||
},
|
||||
"mindepth": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"Number of confirmations required before we consider the channel active."
|
||||
]
|
||||
},
|
||||
"reserve": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"The amount we want the peer to maintain on its side."
|
||||
]
|
||||
},
|
||||
"channel_type": {
|
||||
"type": "array",
|
||||
"description": [
|
||||
"Each bit set in this channel_type."
|
||||
],
|
||||
"items": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"Bit number."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"pairedWith": [
|
||||
[
|
||||
"feerate",
|
||||
"announce",
|
||||
"close_to",
|
||||
"push_msat",
|
||||
"channel_type",
|
||||
"mindepth",
|
||||
"reserve"
|
||||
]
|
||||
]
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"funding_address",
|
||||
"scriptpubkey",
|
||||
"warning_usage"
|
||||
],
|
||||
"properties": {
|
||||
"funding_address": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The address to send funding to for the channel. DO NOT SEND COINS TO THIS ADDRESS YET."
|
||||
]
|
||||
},
|
||||
"scriptpubkey": {
|
||||
"type": "hex",
|
||||
"description": [
|
||||
"The raw scriptPubkey for the address."
|
||||
]
|
||||
},
|
||||
"channel_type": {
|
||||
"type": "object",
|
||||
"description": [
|
||||
"Channel_type as negotiated with peer."
|
||||
],
|
||||
"added": "v24.02",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"bits",
|
||||
"names"
|
||||
],
|
||||
"properties": {
|
||||
"bits": {
|
||||
"type": "array",
|
||||
"added": "v24.02",
|
||||
"description": [
|
||||
"Each bit set in this channel_type."
|
||||
],
|
||||
"items": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"Bit number."
|
||||
]
|
||||
}
|
||||
},
|
||||
"names": {
|
||||
"type": "array",
|
||||
"description": [
|
||||
"Feature name for each bit set in this channel_type."
|
||||
],
|
||||
"added": "v24.02",
|
||||
"items": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"static_remotekey/even",
|
||||
"anchor_outputs/even",
|
||||
"anchors_zero_fee_htlc_tx/even",
|
||||
"scid_alias/even",
|
||||
"zeroconf/even"
|
||||
],
|
||||
"description": [
|
||||
"Name of feature bit."
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"close_to": {
|
||||
"type": "hex",
|
||||
"description": [
|
||||
"The raw scriptPubkey which mutual close will go to; only present if *close_to* parameter was specified and peer supports `option_upfront_shutdown_script`."
|
||||
]
|
||||
},
|
||||
"warning_usage": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"A warning not to prematurely broadcast the funding transaction (always present!)."
|
||||
]
|
||||
},
|
||||
"mindepth": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"Number of confirmations before we consider the channel active."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"errors": [
|
||||
"On error the returned object will contain `code` and `message` properties, with `code` being one of the following:",
|
||||
"",
|
||||
"- -32602: If the given parameters are wrong.",
|
||||
"- -1: Catchall nonspecific error.",
|
||||
"- 300: The amount exceeded the maximum configured funding amount.",
|
||||
"- 301: The provided `push_msat` is greater than the provided `amount`.",
|
||||
"- 304: Still syncing with bitcoin network",
|
||||
"- 305: Peer is not connected.",
|
||||
"- 306: Unknown peer id.",
|
||||
"- 312: Peer negotiated `option_dual_fund`, must use `openchannel_init` not `fundchannel_start`. (Only if ``experimental-dual-fund` is enabled)"
|
||||
],
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:fundchannel_start#1",
|
||||
"method": "fundchannel_start",
|
||||
"params": {
|
||||
"id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59",
|
||||
"amount": 16777216,
|
||||
"feerate": null,
|
||||
"announce": true,
|
||||
"close_to": null,
|
||||
"mindepth": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "example:fundchannel_start#2",
|
||||
"method": "fundchannel_start",
|
||||
"params": {
|
||||
"id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59",
|
||||
"amount": "100000sat",
|
||||
"feerate": null,
|
||||
"announce": true,
|
||||
"close_to": null,
|
||||
"mindepth": null,
|
||||
"channel_type": null
|
||||
}
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"funding_address": "bcrt1qtwxd8wg5eanumk86vfeujvp48hfkgannf77evggzct048wggsrxsum2pmm",
|
||||
"scriptpubkey": "00205b8cd3b914cf67cdd8fa6273c930353dd36476734fbd962102c2df53b90880cd",
|
||||
"warning_usage": "The funding transaction MUST NOT be broadcast until after channel establishment has been successfully completed by running `fundchannel_complete`"
|
||||
},
|
||||
{
|
||||
"funding_address": "bcrt1qtwxd8wg5eanumk86vfeujvp48hfkgannf77evggzct048wggsrxsum2pmm",
|
||||
"scriptpubkey": "00205b8cd3b914cf67cdd8fa6273c930353dd36476734fbd962102c2df53b90880cd",
|
||||
"channel_type": {
|
||||
"bits": [
|
||||
12,
|
||||
22
|
||||
],
|
||||
"names": [
|
||||
"static_remotekey/even",
|
||||
"anchors_zero_fee_htlc_tx/even"
|
||||
]
|
||||
},
|
||||
"warning_usage": "The funding transaction MUST NOT be broadcast until after channel establishment has been successfully completed by running `fundchannel_complete`"
|
||||
}
|
||||
],
|
||||
"author": [
|
||||
"Lisa Neigut <<niftynei@gmail.com>> is mainly responsible."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-connect(7)",
|
||||
"lightning-fundchannel(7)",
|
||||
"lightning-multifundchannel(7)",
|
||||
"lightning-fundchannel_complete(7)",
|
||||
"lightning-fundchannel_cancel(7)",
|
||||
"lightning-openchannel_init(7)",
|
||||
"lightning-openchannel_update(7)",
|
||||
"lightning-openchannel_signed(7)",
|
||||
"lightning-openchannel_bump(7)",
|
||||
"lightning-openchannel_abort(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
335
doc/schemas/lightning-funderupdate.json
Normal file
335
doc/schemas/lightning-funderupdate.json
Normal file
|
@ -0,0 +1,335 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"rpc": "funderupdate",
|
||||
"title": "Command for adjusting node funding v2 channels",
|
||||
"description": [
|
||||
"NOTE: Must have --experimental-dual-fund enabled for these settings to take effect.",
|
||||
"",
|
||||
"For channel open requests using dual funding.",
|
||||
"",
|
||||
"Note: to maximize channel leases, best policy setting is (match, 100).",
|
||||
"",
|
||||
"Setting any of the 5 options from *lease_fee_base_msat*, *lease_fee_basis*, *funding_weight*, *channel_fee_max_base_msat* and, *channel_fee_max_proportional_thousandths* will activate channel leases for this node, and advertise these values via the lightning gossip network. If any one is set, the other values will be the default."
|
||||
],
|
||||
"request": {
|
||||
"required": [],
|
||||
"properties": {
|
||||
"policy": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"match",
|
||||
"available",
|
||||
"fixed"
|
||||
],
|
||||
"description": [
|
||||
"Funder plugin will use to decide how much capital to commit to a v2 open channel request.",
|
||||
"There are three policy options, detailed below:",
|
||||
" * `match` -- Contribute *policy_mod* percent of their requested funds. Valid *policy_mod* values are 0 to 200. If this is a channel lease request, we match based on their requested funds. If it is not a channel lease request (and *lease_only* is false), then we match their funding amount. Note: any lease match less than 100 will likely fail, as clients will not accept a lease less than their request.",
|
||||
" * `available` -- Contribute *policy_mod* percent of our available node wallet funds. Valid *policy_mod* values are 0 to 100.",
|
||||
" * `fixed` -- Contributes a fixed *policy_mod* sats to v2 channel open requests."
|
||||
],
|
||||
"default": "fixed"
|
||||
},
|
||||
"policy_mod": {
|
||||
"type": "sat",
|
||||
"description": [
|
||||
"Number or 'modification' to apply to the policy."
|
||||
],
|
||||
"default": "0sats"
|
||||
},
|
||||
"leases_only": {
|
||||
"type": "boolean",
|
||||
"description": [
|
||||
"Only contribute funds to `option_will_fund` requests which pay to lease funds. It will fund any v2 open request using *policy* even if it's they're not seeking to lease funds. Note that `option_will_fund` commits funds for 4032 blocks (~1mo). Must also set *lease_fee_base_msat*, *lease_fee_basis*, *funding_weight*, *channel_fee_max_base_msat*, and *channel_fee_max_proportional_thousandths* to advertise available channel leases."
|
||||
],
|
||||
"default": "False"
|
||||
},
|
||||
"min_their_funding_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"Minimum funding sats that we require in order to activate our contribution policy to the v2 open."
|
||||
],
|
||||
"default": "10k sats"
|
||||
},
|
||||
"max_their_funding_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"Maximum funding sats that we will consider to activate our contribution policy to the v2 open. Any channel open above this will not be funded."
|
||||
],
|
||||
"default": "no max (`UINT_MAX`)"
|
||||
},
|
||||
"per_channel_min_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"Minimum amount that we will contribute to a channel open."
|
||||
],
|
||||
"default": "10k sats"
|
||||
},
|
||||
"per_channel_max_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"Maximum amount that we will contribute to a channel open."
|
||||
],
|
||||
"default": "no max (`UINT_MAX`)"
|
||||
},
|
||||
"reserve_tank_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"Amount of sats to leave available in the node wallet."
|
||||
],
|
||||
"default": "zero sats"
|
||||
},
|
||||
"fuzz_percent": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"A percentage to fuzz the resulting contribution amount by. Valid values are 0 to 100. Note that turning this on with (match, 100) policy will randomly fail `option_will_fund` leases, as most clients expect an exact or greater match of their `requested_funds`."
|
||||
],
|
||||
"default": "0% (no fuzz)"
|
||||
},
|
||||
"fund_probability": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"The percent of v2 channel open requests to apply our policy to. Valid values are integers from 0 (fund 0% of all open requests) to 100 (fund every request). Useful for randomizing opens that receive funds. Useful for randomizing opens that receive funds."
|
||||
],
|
||||
"default": "100"
|
||||
},
|
||||
"lease_fee_base_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"Flat fee for a channel lease. Node will receive this much extra added to their channel balance, paid by the opening node. Note that the minimum is 1sat."
|
||||
],
|
||||
"default": "2k sats"
|
||||
},
|
||||
"lease_fee_basis": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"A basis fee that's calculated as 1/10k of the total requested funds the peer is asking for. Node will receive the total of *lease_fee_basis* times requested funds / 10k satoshis added to their channel balance, paid by the opening node."
|
||||
],
|
||||
"default": "0.65% (65 basis points)"
|
||||
},
|
||||
"funding_weight": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"To calculate the fee the peer will compensate your node for its contributing inputs to the funding transaction. The total fee is calculated as the `open_channel2`.`funding_feerate_perkw` times this *funding_weight* divided by 1000. Node will have this funding fee added to their channel balance, paid by the opening node."
|
||||
],
|
||||
"default": "2 inputs + 1 P2WPKH output"
|
||||
},
|
||||
"channel_fee_max_base_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"A commitment to a maximum `channel_fee_base_msat` that your node will charge for routing payments over this leased channel during the lease duration."
|
||||
],
|
||||
"default": "5k sats"
|
||||
},
|
||||
"channel_fee_max_proportional_thousandths": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"A commitment to a maximum `channel_fee_proportional_millionths` that your node will charge for routing payments over this leased channel during the lease duration. Note that it's denominated in 'thousandths'. A setting of `1` is equal to 1k ppm; `5` is 5k ppm, etc."
|
||||
],
|
||||
"default": "100 (100k ppm)"
|
||||
},
|
||||
"compact_lease": {
|
||||
"type": "hex",
|
||||
"description": [
|
||||
"A compact description of the channel lease params. When opening a channel, passed in to `fundchannel` to indicate the terms we expect from the peer."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"summary",
|
||||
"policy",
|
||||
"policy_mod",
|
||||
"leases_only",
|
||||
"min_their_funding_msat",
|
||||
"max_their_funding_msat",
|
||||
"per_channel_min_msat",
|
||||
"per_channel_max_msat",
|
||||
"reserve_tank_msat",
|
||||
"fuzz_percent",
|
||||
"fund_probability"
|
||||
],
|
||||
"properties": {
|
||||
"summary": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Summary of the current funding policy e.g. (match 100)."
|
||||
]
|
||||
},
|
||||
"policy": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"match",
|
||||
"available",
|
||||
"fixed"
|
||||
],
|
||||
"description": [
|
||||
"Policy funder plugin will use to decide how much capital to commit to a v2 open channel request."
|
||||
]
|
||||
},
|
||||
"policy_mod": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"The *policy_mod* is the number or 'modification' to apply to the policy."
|
||||
]
|
||||
},
|
||||
"leases_only": {
|
||||
"type": "boolean",
|
||||
"description": [
|
||||
"Only contribute funds to `option_will_fund` lease requests."
|
||||
]
|
||||
},
|
||||
"min_their_funding_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"The minimum funding sats that we require from peer to activate our funding policy."
|
||||
]
|
||||
},
|
||||
"max_their_funding_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"The maximum funding sats that we'll allow from peer to activate our funding policy."
|
||||
]
|
||||
},
|
||||
"per_channel_min_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"The minimum amount that we will fund a channel open with."
|
||||
]
|
||||
},
|
||||
"per_channel_max_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"The maximum amount that we will fund a channel open with."
|
||||
]
|
||||
},
|
||||
"reserve_tank_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"Amount of sats to leave available in the node wallet."
|
||||
]
|
||||
},
|
||||
"fuzz_percent": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"Percentage to fuzz our funding amount by."
|
||||
]
|
||||
},
|
||||
"fund_probability": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"Percent of opens to consider funding. 100 means we'll consider funding every requested open channel request."
|
||||
]
|
||||
},
|
||||
"lease_fee_base_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"Flat fee to charge for a channel lease."
|
||||
]
|
||||
},
|
||||
"lease_fee_basis": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"Proportional fee to charge for a channel lease, calculated as 1/10,000th of requested funds."
|
||||
]
|
||||
},
|
||||
"funding_weight": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"Transaction weight the channel opener will pay us for a leased funding transaction."
|
||||
]
|
||||
},
|
||||
"channel_fee_max_base_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"Maximum channel_fee_base_msat we'll charge for routing funds leased on this channel."
|
||||
]
|
||||
},
|
||||
"channel_fee_max_proportional_thousandths": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"Maximum channel_fee_proportional_millitionths we'll charge for routing funds leased on this channel, in thousandths."
|
||||
]
|
||||
},
|
||||
"compact_lease": {
|
||||
"type": "hex",
|
||||
"description": [
|
||||
"Compact description of the channel lease parameters."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"errors": [
|
||||
"The following error code may occur:",
|
||||
"",
|
||||
"- -32602: If the given parameters are invalid."
|
||||
],
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:funderupdate#1",
|
||||
"method": "funderupdate",
|
||||
"params": "{}"
|
||||
},
|
||||
{
|
||||
"id": "example:funderupdate#2",
|
||||
"method": "funderupdate",
|
||||
"params": {
|
||||
"policy": "fixed",
|
||||
"policy_mod": "50000sat",
|
||||
"min_their_funding_msat": 1000,
|
||||
"per_channel_min_msat": "1000sat",
|
||||
"per_channel_max_msat": "500000sat",
|
||||
"fund_probability": 100,
|
||||
"fuzz_percent": 0,
|
||||
"leases_only": false
|
||||
}
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"summary": "match (100%)",
|
||||
"policy": "match",
|
||||
"policy_mod": 100,
|
||||
"leases_only": true,
|
||||
"min_their_funding_msat": 10000000,
|
||||
"max_their_funding_msat": 4294967295000,
|
||||
"per_channel_min_msat": 10000000,
|
||||
"per_channel_max_msat": 4294967295000,
|
||||
"reserve_tank_msat": 0,
|
||||
"fuzz_percent": 0,
|
||||
"fund_probability": 100,
|
||||
"lease_fee_base_msat": 100000,
|
||||
"lease_fee_basis": 100,
|
||||
"funding_weight": 666,
|
||||
"channel_fee_max_base_msat": 5000000,
|
||||
"channel_fee_max_proportional_thousandths": 100,
|
||||
"compact_lease": "029a00640064000000644c4b40"
|
||||
},
|
||||
{
|
||||
"summary": "fixed (50000sat)",
|
||||
"policy": "fixed",
|
||||
"policy_mod": 50000,
|
||||
"leases_only": false,
|
||||
"min_their_funding_msat": 1000,
|
||||
"max_their_funding_msat": 4294967295000,
|
||||
"per_channel_min_msat": 1000000,
|
||||
"per_channel_max_msat": 500000000,
|
||||
"reserve_tank_msat": 0,
|
||||
"fuzz_percent": 0,
|
||||
"fund_probability": 100
|
||||
}
|
||||
],
|
||||
"author": [
|
||||
"Lisa Neigut <<niftynei@gmail.com>> is mainly responsible."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-fundchannel(7)",
|
||||
"lightning-listfunds(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
293
doc/schemas/lightning-fundpsbt.json
Normal file
293
doc/schemas/lightning-fundpsbt.json
Normal file
|
@ -0,0 +1,293 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"rpc": "fundpsbt",
|
||||
"title": "Command to populate PSBT inputs from the wallet",
|
||||
"description": [
|
||||
"`fundpsbt` is a low-level RPC command which creates a PSBT using unreserved inputs in the wallet, optionally reserving them as well."
|
||||
],
|
||||
"request": {
|
||||
"required": [
|
||||
"satoshi",
|
||||
"feerate",
|
||||
"startweight"
|
||||
],
|
||||
"properties": {
|
||||
"satoshi": {
|
||||
"type": "msat_or_all",
|
||||
"description": [
|
||||
"The minimum satoshi value of the output(s) needed (or the string `all` meaning use all unreserved inputs). If a value, it can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*."
|
||||
]
|
||||
},
|
||||
"feerate": {
|
||||
"type": "feerate",
|
||||
"description": [
|
||||
"Used for the transaction as initial feerate."
|
||||
],
|
||||
"default": "*normal*"
|
||||
},
|
||||
"startweight": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"The weight of the transaction before *fundpsbt* has added any inputs."
|
||||
]
|
||||
},
|
||||
"minconf": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"The minimum number of confirmations that used outputs should have."
|
||||
],
|
||||
"default": "1"
|
||||
},
|
||||
"reserve": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"If not zero, then *reserveinputs* is called (successfully, with *exclusive* true) on the returned PSBT for this number of blocks."
|
||||
],
|
||||
"default": "72 blocks"
|
||||
},
|
||||
"locktime": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"The locktime of the transaction. if not set, it is set to a recent block height."
|
||||
]
|
||||
},
|
||||
"min_witness_weight": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"Minimum weight to use for a UTXO's witness. If the actual witness weight is greater than the provided minimum, the actual witness weight will be used."
|
||||
]
|
||||
},
|
||||
"excess_as_change": {
|
||||
"type": "boolean",
|
||||
"description": [
|
||||
"Flag to add a change output for the excess sats."
|
||||
]
|
||||
},
|
||||
"nonwrapped": {
|
||||
"added": "v23.02",
|
||||
"type": "boolean",
|
||||
"description": [
|
||||
"To signal to filter out any p2sh-wrapped inputs from funding this PSBT."
|
||||
]
|
||||
},
|
||||
"opening_anchor_channel": {
|
||||
"added": "v23.08",
|
||||
"type": "boolean",
|
||||
"description": [
|
||||
"To signel that it needs emergency reserve for anchors so that we can lowball our commitment tx fees, and min-emergency-msat for reserving some sats for closing anchor channels."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"psbt",
|
||||
"feerate_per_kw",
|
||||
"estimated_final_weight",
|
||||
"excess_msat"
|
||||
],
|
||||
"properties": {
|
||||
"psbt": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Unsigned PSBT which fulfills the parameters given."
|
||||
]
|
||||
},
|
||||
"feerate_per_kw": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"The feerate used to create the PSBT, in satoshis-per-kiloweight."
|
||||
]
|
||||
},
|
||||
"estimated_final_weight": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"The estimated weight of the transaction once fully signed."
|
||||
]
|
||||
},
|
||||
"excess_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"The amount above *satoshi* which is available. This could be zero, or dust; it will be zero if *change_outnum* is also returned."
|
||||
]
|
||||
},
|
||||
"change_outnum": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"The 0-based output number where change was placed (only if parameter *excess_as_change* was true and there was sufficient funds)."
|
||||
]
|
||||
},
|
||||
"reservations": {
|
||||
"type": "array",
|
||||
"description": [
|
||||
"If *reserve* was true or a non-zero number, just as per lightning- reserveinputs(7)."
|
||||
],
|
||||
"items": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"txid",
|
||||
"vout",
|
||||
"was_reserved",
|
||||
"reserved",
|
||||
"reserved_to_block"
|
||||
],
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"txid": {
|
||||
"type": "txid",
|
||||
"description": [
|
||||
"The txid of the transaction."
|
||||
]
|
||||
},
|
||||
"vout": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"The 0-based output number."
|
||||
]
|
||||
},
|
||||
"was_reserved": {
|
||||
"type": "boolean",
|
||||
"enum": [
|
||||
false
|
||||
],
|
||||
"description": [
|
||||
"Whether this output was previously reserved."
|
||||
]
|
||||
},
|
||||
"reserved": {
|
||||
"type": "boolean",
|
||||
"enum": [
|
||||
true
|
||||
],
|
||||
"description": [
|
||||
"Whether this output is now reserved."
|
||||
]
|
||||
},
|
||||
"reserved_to_block": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"The blockheight the reservation will expire."
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"post_return_value_notes": [
|
||||
"If *excess_as_change* is true and the excess is enough to cover an additional output above the `dust_limit`, then an output is added to the PSBT for the excess amount. The *excess_msat* will be zero. A *change_outnum* will be returned with the index of the change output."
|
||||
]
|
||||
},
|
||||
"example_usage": [
|
||||
"Let's assume the caller is trying to produce a 100,000 satoshi output.",
|
||||
"",
|
||||
"First, the caller estimates the weight of the core (typically 42) and known outputs of the transaction (typically (9 + scriptlen) * 4). For a simple P2WPKH it's a 22 byte scriptpubkey, so that's 124 weight.",
|
||||
"",
|
||||
"It calls \"*fundpsbt* 100000sat slow 166\", which succeeds, and returns the *psbt* and *feerate_per_kw* it used, the *estimated_final_weight* and any *excess_msat*.",
|
||||
"",
|
||||
"If *excess_msat* is greater than the cost of adding a change output, the caller adds a change output randomly to position 0 or 1 in the PSBT. Say *feerate_per_kw* is 253, and the change output is a P2WPKH (weight 124), the cost is around 31 sats. With the dust limit disallowing payments below 546 satoshis, we would only create a change output if *excess_msat* was greater or equal to 31 + 546."
|
||||
],
|
||||
"errors": [
|
||||
"On error the returned object will contain `code` and `message` properties, with `code` being one of the following:",
|
||||
"",
|
||||
"- -32602: If the given parameters are wrong.",
|
||||
"- -1: Catchall nonspecific error.",
|
||||
"- 301: Insufficient UTXOs to meet *satoshi* value."
|
||||
],
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:fundpsbt#1",
|
||||
"method": "fundpsbt",
|
||||
"params": {
|
||||
"satoshi": 16777216,
|
||||
"feerate": "253perkw",
|
||||
"startweight": 250,
|
||||
"minconf": null,
|
||||
"reserve": 0,
|
||||
"locktime": null,
|
||||
"min_witness_weight": null,
|
||||
"excess_as_change": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "example:fundpsbt#2",
|
||||
"method": "fundpsbt",
|
||||
"params": {
|
||||
"satoshi": "all",
|
||||
"feerate": "1000perkw",
|
||||
"startweight": 1000,
|
||||
"minconf": null,
|
||||
"reserve": null,
|
||||
"locktime": null,
|
||||
"min_witness_weight": null,
|
||||
"excess_as_change": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "example:fundpsbt#3",
|
||||
"method": "fundpsbt",
|
||||
"params": {
|
||||
"satoshi": "109000sat",
|
||||
"feerate": "slow",
|
||||
"startweight": 166,
|
||||
"minconf": null,
|
||||
"reserve": null,
|
||||
"locktime": null,
|
||||
"min_witness_weight": null,
|
||||
"excess_as_change": true
|
||||
}
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"psbt": "cHNidP8BADMCAAAAAWzmSFzhTtXBnQewytc32WaMwJSunScwsYndBNdU80JqAAAAAAD9////AGYAAAAAAQDeAgAAAAABAU1MpIJeOOzqAYVkZaytJCmzUadBVltKar8kWtzKSVeYAAAAAAD9////AoCWmAEAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WXzWm0oAQAAABYAFD8W5uBNZAxN6n1jqU62dxWQbyGAAkcwRAIgUK+vMOeWiDPiJM8fpgKCjjwXog4yfWPvtKES1ZZPaM8CIB3cgouGpV6Gc7nEvAu28Mg9tkAWt/Xl5FDOseEyeZqHASECTwjR0I3gLHdSW7jRmnVXdm0+MgJ1hihnqEfXYeFWA/NlAAAAAQEfgJaYAQAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQA=",
|
||||
"feerate_per_kw": 253,
|
||||
"estimated_final_weight": 521,
|
||||
"excess_msat": 9999869000
|
||||
},
|
||||
{
|
||||
"psbt": "cHNidP8BAF4CAAAAAfwbEpvpi6D14YV4VLnuVB47Y0uF41kXEyJRL4IusySSAQAAAAD9////ASICAAAAAAAAIlEgeDY1X9yKgtxMsAp3LFVUFR0GOEpN1l6NP2isCFZrhL5nAAAAAAEA9gIAAAAAAQFEkxvLatohY6mw5gr5qG1aiArSrziFPR2YoqD21Hv+RAAAAAAA/f///wJAQg8AAAAAACIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNrz8PAAAAAAAiUSBj/+5Op9UebK35CG4oaiUnkiqqJbjFOuvzL6MqCmJ/WgJHMEQCIEu1nfVRt9i+rFM219mwhMqdwJsqygWSWTFUS+cemdh6AiBG3Qo8g9J/aAMO2RHDsIBScscj6pTTIwZp7Gw8G3EOKAEhA9dFRFyTYmZfIuDZbp52byc/MmDeo5yKdr+gXdJoTdzPZgAAAAEBK68/DwAAAAAAIlEgY//uTqfVHmyt+QhuKGolJ5IqqiW4xTrr8y+jKgpif1oAAA==",
|
||||
"feerate_per_kw": 1000,
|
||||
"estimated_final_weight": 1443,
|
||||
"excess_msat": 997354000,
|
||||
"change_outnum": 0,
|
||||
"reservations": [
|
||||
{
|
||||
"txid": "9224b32e822f5122131759e3854b633b1e54eeb9547885e1f5a08be99b121bfc",
|
||||
"vout": 1,
|
||||
"was_reserved": false,
|
||||
"reserved": true,
|
||||
"reserved_to_block": 175
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"psbt": "cHNidP8BAF4CAAAAAbEf44mT/BPDxLkUjKy1byWksyLyuM6hbe8shzEbbXhGAQAAAAD9////AU58DQAAAAAAIlEgeDY1X9yKgtxMsAp3LFVUFR0GOEpN1l6NP2isCFZrhL5sAAAAAAEA9gIAAAAAAQEV9Sj1wfHqO/ECZeHp/u7cFL5eRaa1Vu4hXWbwH72pxgEAAAAA/f///wJAQg8AAAAAACIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNAS8PAAAAAAAiUSBj/+5Op9UebK35CG4oaiUnkiqqJbjFOuvzL6MqCmJ/WgJHMEQCIGILT3DrcNn6/WKOhsxxKq7lDWq47dV0IjRhj0bYHs4yAiApzODtmrz7ifK32G81A2XbBxWboFk2vN4T3ng/hYmb1wEhA9dFRFyTYmZfIuDZbp52byc/MmDeo5yKdr+gXdJoTdzPZgAAAAEBKwEvDwAAAAAAIlEgY//uTqfVHmyt+QhuKGolJ5IqqiW4xTrr8y+jKgpif1oAAA==",
|
||||
"feerate_per_kw": 3750,
|
||||
"estimated_final_weight": 609,
|
||||
"excess_msat": 0,
|
||||
"change_outnum": 0,
|
||||
"reservations": [
|
||||
{
|
||||
"txid": "46786d1b31872cef6da1ceb8f222b3a4256fb5ac8c14b9c4c313fc9389e31fb1",
|
||||
"vout": 1,
|
||||
"was_reserved": false,
|
||||
"reserved": true,
|
||||
"reserved_to_block": 180
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"author": [
|
||||
"Rusty Russell <<rusty@rustcorp.com.au>> is mainly responsible."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-utxopsbt(7)",
|
||||
"lightning-reserveinputs(7)",
|
||||
"lightning-unreserveinputs(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
431
doc/schemas/lightning-getinfo.json
Normal file
431
doc/schemas/lightning-getinfo.json
Normal file
|
@ -0,0 +1,431 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"rpc": "getinfo",
|
||||
"title": "Command to receive all information about the Core Lightning node.",
|
||||
"description": [
|
||||
"The **getinfo** gives a summary of the current running node."
|
||||
],
|
||||
"request": {
|
||||
"required": [],
|
||||
"properties": {}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"id",
|
||||
"alias",
|
||||
"color",
|
||||
"num_peers",
|
||||
"num_pending_channels",
|
||||
"num_active_channels",
|
||||
"num_inactive_channels",
|
||||
"version",
|
||||
"blockheight",
|
||||
"network",
|
||||
"fees_collected_msat",
|
||||
"lightning-dir",
|
||||
"address"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "pubkey",
|
||||
"description": [
|
||||
"The public key unique to this node."
|
||||
]
|
||||
},
|
||||
"alias": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The fun alias this node will advertize."
|
||||
],
|
||||
"maxLength": 32
|
||||
},
|
||||
"color": {
|
||||
"type": "hex",
|
||||
"description": [
|
||||
"The favorite RGB color this node will advertize."
|
||||
],
|
||||
"minLength": 6,
|
||||
"maxLength": 6
|
||||
},
|
||||
"num_peers": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"The total count of peers, connected or with channels."
|
||||
]
|
||||
},
|
||||
"num_pending_channels": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"The total count of channels being opened."
|
||||
]
|
||||
},
|
||||
"num_active_channels": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"The total count of channels in normal state."
|
||||
]
|
||||
},
|
||||
"num_inactive_channels": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"The total count of channels waiting for opening or closing transactions to be mined."
|
||||
]
|
||||
},
|
||||
"version": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Identifies what bugs you are running into."
|
||||
]
|
||||
},
|
||||
"lightning-dir": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Identifies where you can find the configuration and other related files."
|
||||
]
|
||||
},
|
||||
"our_features": {
|
||||
"type": "object",
|
||||
"description": [
|
||||
"Our BOLT #9 feature bits (as hexstring) for various contexts."
|
||||
],
|
||||
"additionalProperties": true,
|
||||
"required": [
|
||||
"init",
|
||||
"node",
|
||||
"channel",
|
||||
"invoice"
|
||||
],
|
||||
"properties": {
|
||||
"init": {
|
||||
"type": "hex",
|
||||
"description": [
|
||||
"Features (incl. globalfeatures) in our init message, these also restrict what we offer in open_channel or accept in accept_channel."
|
||||
]
|
||||
},
|
||||
"node": {
|
||||
"type": "hex",
|
||||
"description": [
|
||||
"Features in our node_announcement message."
|
||||
]
|
||||
},
|
||||
"channel": {
|
||||
"type": "hex",
|
||||
"description": [
|
||||
"Negotiated channel features we (as channel initiator) publish in the channel_announcement message."
|
||||
]
|
||||
},
|
||||
"invoice": {
|
||||
"type": "hex",
|
||||
"description": [
|
||||
"Features in our BOLT11 invoices."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"blockheight": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"The highest block height we've learned."
|
||||
]
|
||||
},
|
||||
"network": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Represents the type of network on the node are working (e.g: `bitcoin`, `testnet`, or `regtest`)."
|
||||
]
|
||||
},
|
||||
"fees_collected_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"Total routing fees collected by this node."
|
||||
]
|
||||
},
|
||||
"address": {
|
||||
"type": "array",
|
||||
"description": [
|
||||
"The addresses we announce to the world."
|
||||
],
|
||||
"items": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"type",
|
||||
"port"
|
||||
],
|
||||
"additionalProperties": true,
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"dns",
|
||||
"ipv4",
|
||||
"ipv6",
|
||||
"torv2",
|
||||
"torv3"
|
||||
],
|
||||
"description": [
|
||||
"Type of connection (until 23.08, `websocket` was also allowed)."
|
||||
]
|
||||
},
|
||||
"port": {
|
||||
"type": "u16",
|
||||
"description": [
|
||||
"Port number."
|
||||
]
|
||||
}
|
||||
},
|
||||
"if": {
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"dns",
|
||||
"ipv4",
|
||||
"ipv6",
|
||||
"torv2",
|
||||
"torv3"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"then": {
|
||||
"required": [
|
||||
"type",
|
||||
"address",
|
||||
"port"
|
||||
],
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"type": {},
|
||||
"port": {},
|
||||
"address": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Address in expected format for **type**."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"else": {
|
||||
"required": [
|
||||
"type",
|
||||
"port"
|
||||
],
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"type": {},
|
||||
"port": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"binding": {
|
||||
"type": "array",
|
||||
"description": [
|
||||
"The addresses we are listening on."
|
||||
],
|
||||
"items": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"type"
|
||||
],
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"local socket",
|
||||
"websocket",
|
||||
"ipv4",
|
||||
"ipv6",
|
||||
"torv2",
|
||||
"torv3"
|
||||
],
|
||||
"description": [
|
||||
"Type of connection."
|
||||
]
|
||||
},
|
||||
"address": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Address in expected format for **type**."
|
||||
]
|
||||
},
|
||||
"port": {
|
||||
"type": "u16",
|
||||
"description": [
|
||||
"Port number."
|
||||
]
|
||||
}
|
||||
},
|
||||
"allOf": [
|
||||
{
|
||||
"if": {
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"local socket"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"then": {
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"type",
|
||||
"socket"
|
||||
],
|
||||
"properties": {
|
||||
"type": {},
|
||||
"socket": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Socket filename."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"else": {
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"type",
|
||||
"address",
|
||||
"port"
|
||||
],
|
||||
"properties": {
|
||||
"type": {},
|
||||
"address": {},
|
||||
"port": {},
|
||||
"subtype": {}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"if": {
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"websocket"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"then": {
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"type",
|
||||
"address",
|
||||
"port",
|
||||
"subtype"
|
||||
],
|
||||
"properties": {
|
||||
"type": {},
|
||||
"address": {},
|
||||
"port": {},
|
||||
"subtype": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Type of address."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"else": {
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"type"
|
||||
],
|
||||
"properties": {
|
||||
"type": {},
|
||||
"address": {},
|
||||
"port": {},
|
||||
"socket": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"warning_bitcoind_sync": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Bitcoind is not up-to-date with network."
|
||||
]
|
||||
},
|
||||
"warning_lightningd_sync": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Lightningd is still loading latest blocks from bitcoind."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:getinfo#1",
|
||||
"method": "getinfo",
|
||||
"params": {}
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"id": "02bf811f7571754f0b51e6d41a8885f5561041a7b14fac093e4cffb95749de1a8d",
|
||||
"alias": "SLICKERGOPHER",
|
||||
"color": "02bf81",
|
||||
"num_peers": 0,
|
||||
"num_pending_channels": 0,
|
||||
"num_active_channels": 0,
|
||||
"num_inactive_channels": 0,
|
||||
"address": [
|
||||
{
|
||||
"type": "torv3",
|
||||
"address": "fp463inc4w3lamhhduytrwdwq6q6uzugtaeapylqfc43agrdnnqsheyd.onion",
|
||||
"port": 9736
|
||||
},
|
||||
{
|
||||
"type": "torv3",
|
||||
"address": "ifnntp5ak4homxrti2fp6ckyllaqcike447ilqfrgdw64ayrmkyashid.onion",
|
||||
"port": 9736
|
||||
}
|
||||
],
|
||||
"binding": [
|
||||
{
|
||||
"type": "ipv4",
|
||||
"address": "127.0.0.1",
|
||||
"port": 9736
|
||||
}
|
||||
],
|
||||
"version": "v0.10.2",
|
||||
"blockheight": 724302,
|
||||
"network": "bitcoin",
|
||||
"msatoshi_fees_collected": 0,
|
||||
"fees_collected_msat": "0msat",
|
||||
"lightning-dir": "/media/vincent/Maxtor/C-lightning/node/bitcoin",
|
||||
"our_features": {
|
||||
"init": "8828226aa2",
|
||||
"node": "80008828226aa2",
|
||||
"channel": "",
|
||||
"invoice": "20024200"
|
||||
}
|
||||
}
|
||||
],
|
||||
"errors": [
|
||||
"On failure, one of the following error codes may be returned:",
|
||||
"",
|
||||
"- -32602: Error in given parameters or some error happened during the command process."
|
||||
],
|
||||
"author": [
|
||||
"Vincenzo Palazzo <<vincenzo.palazzo@protonmail.com>> wrote the initial version of this man page,",
|
||||
"but many others did the hard work of actually implementing this rpc command."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-connect(7)",
|
||||
"lightning-fundchannel(7)",
|
||||
"lightning-listconfigs(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
255
doc/schemas/lightning-getlog.json
Normal file
255
doc/schemas/lightning-getlog.json
Normal file
|
@ -0,0 +1,255 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"rpc": "getlog",
|
||||
"title": "Command to show logs.",
|
||||
"description": [
|
||||
"The **getlog** the RPC command to show logs, with optional log *level*."
|
||||
],
|
||||
"request": {
|
||||
"required": [],
|
||||
"properties": {
|
||||
"level": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"broken",
|
||||
"unusual",
|
||||
"info",
|
||||
"debug",
|
||||
"io"
|
||||
],
|
||||
"description": [
|
||||
"A string that represents the log level."
|
||||
],
|
||||
"default": "*info*"
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"created_at",
|
||||
"bytes_used",
|
||||
"bytes_max",
|
||||
"log"
|
||||
],
|
||||
"properties": {
|
||||
"created_at": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"UNIX timestamp with 9 decimal places, when logging was initialized."
|
||||
]
|
||||
},
|
||||
"bytes_used": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"The number of bytes used by logging records."
|
||||
]
|
||||
},
|
||||
"bytes_max": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"The bytes_used values at which records will be trimmed ."
|
||||
]
|
||||
},
|
||||
"log": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"type"
|
||||
],
|
||||
"additionalProperties": true,
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"SKIPPED",
|
||||
"BROKEN",
|
||||
"UNUSUAL",
|
||||
"INFO",
|
||||
"DEBUG",
|
||||
"IO_IN",
|
||||
"IO_OUT"
|
||||
]
|
||||
}
|
||||
},
|
||||
"allOf": [
|
||||
{
|
||||
"if": {
|
||||
"additionalProperties": true,
|
||||
"properties": {
|
||||
"type": {
|
||||
"enum": [
|
||||
"SKIPPED"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"then": {
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"num_skipped"
|
||||
],
|
||||
"properties": {
|
||||
"type": {},
|
||||
"num_skipped": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"Number of unprinted log entries (deleted or below *level* parameter)."
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"if": {
|
||||
"additionalProperties": true,
|
||||
"properties": {
|
||||
"type": {
|
||||
"enum": [
|
||||
"BROKEN",
|
||||
"UNUSUAL",
|
||||
"INFO",
|
||||
"DEBUG"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"then": {
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"time",
|
||||
"source",
|
||||
"log"
|
||||
],
|
||||
"properties": {
|
||||
"type": {},
|
||||
"time": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"UNIX timestamp with 9 decimal places after **created_at**."
|
||||
]
|
||||
},
|
||||
"source": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The particular logbook this was found in."
|
||||
]
|
||||
},
|
||||
"log": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The actual log message."
|
||||
]
|
||||
},
|
||||
"node_id": {
|
||||
"type": "pubkey",
|
||||
"description": [
|
||||
"The peer this is associated with."
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"if": {
|
||||
"additionalProperties": true,
|
||||
"properties": {
|
||||
"type": {
|
||||
"enum": [
|
||||
"IO_IN",
|
||||
"IO_OUT"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"then": {
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"time",
|
||||
"source",
|
||||
"log",
|
||||
"data"
|
||||
],
|
||||
"properties": {
|
||||
"type": {},
|
||||
"time": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Seconds after **created_at**, with 9 decimal places."
|
||||
]
|
||||
},
|
||||
"source": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The particular logbook this was found in."
|
||||
]
|
||||
},
|
||||
"log": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The associated log message."
|
||||
]
|
||||
},
|
||||
"node_id": {
|
||||
"type": "pubkey",
|
||||
"description": [
|
||||
"The peer this is associated with."
|
||||
]
|
||||
},
|
||||
"data": {
|
||||
"type": "hex",
|
||||
"description": [
|
||||
"The IO which occurred."
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:getlog#1",
|
||||
"method": "getlog",
|
||||
"params": {
|
||||
"level": "debug"
|
||||
}
|
||||
}
|
||||
],
|
||||
"errors": [
|
||||
"On failure, one of the following error codes may be returned:",
|
||||
"",
|
||||
"- -32602: Error in given parameters."
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"created_at": "1598192543.820753463",
|
||||
"bytes_used": 89285843,
|
||||
"bytes_max": 104857600,
|
||||
"log": [
|
||||
{
|
||||
"type": "SKIPPED",
|
||||
"num_skipped": 45
|
||||
},
|
||||
{
|
||||
"type": "INFO",
|
||||
"time": "0.453627568",
|
||||
"source": "plugin-autopilot.py",
|
||||
"log": "RPCmethod'autopilot-run-once'doesnothaveadocstring."
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"author": [
|
||||
"Vincenzo Palazzo <<vincenzo.palazzo@protonmail.com>> wrote the initial version of this man page,",
|
||||
"but many others did the hard work of actually implementing this rpc command."
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
440
doc/schemas/lightning-getroute.json
Normal file
440
doc/schemas/lightning-getroute.json
Normal file
|
@ -0,0 +1,440 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"rpc": "getroute",
|
||||
"title": "Command for routing a payment (low-level)",
|
||||
"description": [
|
||||
"The **getroute** RPC command attempts to find the best route for the payment of *amount_msat* to lightning node *id*, such that the payment will arrive at *id* with *cltv*.",
|
||||
"",
|
||||
"There are two considerations for how good a route is: how low the fees are, and how long your payment will get stuck in a delayed output if a node goes down during the process. ."
|
||||
],
|
||||
"request": {
|
||||
"required": [
|
||||
"id",
|
||||
"amount_msat",
|
||||
"riskfactor"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "pubkey",
|
||||
"description": [
|
||||
"Node pubkey to find the best route for the payment."
|
||||
]
|
||||
},
|
||||
"amount_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"Amount to send. It can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*. The 0 value is special: it ignores any *htlc_minimum_msat* setting on channels, and simply returns a possible route (if any) which is useful for simple probing."
|
||||
]
|
||||
},
|
||||
"riskfactor": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"A non-negative floating-point field controls this tradeoff; it is the annual cost of your funds being stuck (as a percentage). For example, if you thought the convenience of keeping your funds liquid (not stuck) was worth 20% per annum interest, *riskfactor* would be 20. If you didn't care about risk, *riskfactor* would be zero."
|
||||
]
|
||||
},
|
||||
"cltv": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"Cltv-blocks to spare."
|
||||
],
|
||||
"default": "9"
|
||||
},
|
||||
"fromid": {
|
||||
"type": "pubkey",
|
||||
"description": [
|
||||
"The node to start the route from."
|
||||
],
|
||||
"default": "this node"
|
||||
},
|
||||
"fuzzpercent": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"Used to distort fees to provide some randomization to the route generated, but it was not properly implemented and is ignored."
|
||||
]
|
||||
},
|
||||
"exclude": {
|
||||
"type": "array",
|
||||
"description": [
|
||||
"A JSON array of short-channel-id/direction (e.g. ['564334x877x1/0', '564195x1292x0/1' ]) or node-id which should be excluded from consideration for routing. Note if the source or destination is excluded, the command result is undefined."
|
||||
],
|
||||
"default": "not to exclude any channels or nodes",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"maxhops": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"The maximum number of channels to return."
|
||||
],
|
||||
"default": "20"
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"route"
|
||||
],
|
||||
"properties": {
|
||||
"route": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"direction",
|
||||
"channel",
|
||||
"amount_msat",
|
||||
"delay",
|
||||
"style"
|
||||
],
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "pubkey",
|
||||
"description": [
|
||||
"The node at the end of this hop."
|
||||
]
|
||||
},
|
||||
"channel": {
|
||||
"type": "short_channel_id",
|
||||
"description": [
|
||||
"The channel joining these nodes."
|
||||
]
|
||||
},
|
||||
"direction": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"0 if this channel is traversed from lesser to greater **id**, otherwise 1."
|
||||
]
|
||||
},
|
||||
"amount_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"The amount expected by the node at the end of this hop."
|
||||
]
|
||||
},
|
||||
"delay": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"The total CLTV expected by the node at the end of this hop."
|
||||
]
|
||||
},
|
||||
"style": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The features understood by the destination node."
|
||||
],
|
||||
"enum": [
|
||||
"tlv"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"post_return_value_notes": [
|
||||
"The final *id* will be the destination *id* given in the input. The difference between the first *amount_msat* minus the *amount_msat* given in the input is the fee (assuming the first hop is free). The first *delay* is the very worst case timeout for the payment failure, in blocks."
|
||||
]
|
||||
},
|
||||
"riskfactor_effect_on_routing": [
|
||||
"The risk factor is treated as if it were an additional fee on the route, for the purposes of comparing routes.",
|
||||
"",
|
||||
"The formula used is the following approximation:",
|
||||
"",
|
||||
" risk-fee = amount x blocks-timeout x per-block-cost",
|
||||
"",
|
||||
"We are given a *riskfactor* expressed as a percentage. There are 52596 blocks per year, thus *per-block-cost* is *riskfactor* divided by 5,259,600.",
|
||||
"",
|
||||
"The final result is:",
|
||||
"",
|
||||
" risk-fee = amount x blocks-timeout x riskfactor / 5259600",
|
||||
"",
|
||||
"Here are the risk fees in millisatoshis, using various parameters. I assume a channel charges the default of 1000 millisatoshis plus 1 part-per-million. Common to_self_delay values on the network at 14 and 144 blocks.",
|
||||
"",
|
||||
"<table>",
|
||||
"<colgroup>",
|
||||
"<col style=\"width: 20%\" />",
|
||||
"<col style=\"width: 20%\" />",
|
||||
"<col style=\"width: 20%\" />",
|
||||
"<col style=\"width: 20%\" />",
|
||||
"<col style=\"width: 20%\" />",
|
||||
"</colgroup>",
|
||||
"<thead>",
|
||||
"<tr class=\"header\">",
|
||||
"<th style=\"text-align: left;\">Amount (msat)</th>",
|
||||
"<th style=\"text-align: left;\">Riskfactor</th>",
|
||||
"<th style=\"text-align: left;\">Delay</th>",
|
||||
"<th style=\"text-align: left;\">Risk Fee</th>",
|
||||
"<th style=\"text-align: left;\">Route fee</th>",
|
||||
"</tr>",
|
||||
"</thead>",
|
||||
"<tbody>",
|
||||
"<tr class=\"odd\">",
|
||||
"<td style=\"text-align: left;\"><p>10,000</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>1</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>14</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>0</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>1001</p></td>",
|
||||
"</tr>",
|
||||
"<tr class=\"even\">",
|
||||
"<td style=\"text-align: left;\"><p>10,000</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>10</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>14</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>0</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>1001</p></td>",
|
||||
"</tr>",
|
||||
"<tr class=\"odd\">",
|
||||
"<td style=\"text-align: left;\"><p>10,000</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>100</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>14</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>2</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>1001</p></td>",
|
||||
"</tr>",
|
||||
"<tr class=\"even\">",
|
||||
"<td style=\"text-align: left;\"><p>10,000</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>1000</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>14</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>26</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>1001</p></td>",
|
||||
"</tr>",
|
||||
"<tr class=\"odd\">",
|
||||
"<td style=\"text-align: left;\"><p>1,000,000</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>1</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>14</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>2</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>1001</p></td>",
|
||||
"</tr>",
|
||||
"<tr class=\"even\">",
|
||||
"<td style=\"text-align: left;\"><p>1,000,000</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>10</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>14</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>26</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>1001</p></td>",
|
||||
"</tr>",
|
||||
"<tr class=\"odd\">",
|
||||
"<td style=\"text-align: left;\"><p>1,000,000</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>100</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>14</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>266</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>1001</p></td>",
|
||||
"</tr>",
|
||||
"<tr class=\"even\">",
|
||||
"<td style=\"text-align: left;\"><p>1,000,000</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>1000</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>14</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>2661</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>1001</p></td>",
|
||||
"</tr>",
|
||||
"<tr class=\"odd\">",
|
||||
"<td style=\"text-align: left;\"><p>100,000,000</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>1</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>14</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>266</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>1100</p></td>",
|
||||
"</tr>",
|
||||
"<tr class=\"even\">",
|
||||
"<td style=\"text-align: left;\"><p>100,000,000</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>10</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>14</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>2661</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>1100</p></td>",
|
||||
"</tr>",
|
||||
"<tr class=\"odd\">",
|
||||
"<td style=\"text-align: left;\"><p>100,000,000</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>100</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>14</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>26617</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>1100</p></td>",
|
||||
"</tr>",
|
||||
"<tr class=\"even\">",
|
||||
"<td style=\"text-align: left;\"><p>100,000,000</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>1000</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>14</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>266179</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>1100</p></td>",
|
||||
"</tr>",
|
||||
"<tr class=\"odd\">",
|
||||
"<td style=\"text-align: left;\"><p>10,000</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>1</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>144</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>0</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>1001</p></td>",
|
||||
"</tr>",
|
||||
"<tr class=\"even\">",
|
||||
"<td style=\"text-align: left;\"><p>10,000</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>10</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>144</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>2</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>1001</p></td>",
|
||||
"</tr>",
|
||||
"<tr class=\"odd\">",
|
||||
"<td style=\"text-align: left;\"><p>10,000</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>100</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>144</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>27</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>1001</p></td>",
|
||||
"</tr>",
|
||||
"<tr class=\"even\">",
|
||||
"<td style=\"text-align: left;\"><p>10,000</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>1000</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>144</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>273</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>1001</p></td>",
|
||||
"</tr>",
|
||||
"<tr class=\"odd\">",
|
||||
"<td style=\"text-align: left;\"><p>1,000,000</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>1</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>144</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>27</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>1001</p></td>",
|
||||
"</tr>",
|
||||
"<tr class=\"even\">",
|
||||
"<td style=\"text-align: left;\"><p>1,000,000</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>10</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>144</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>273</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>1001</p></td>",
|
||||
"</tr>",
|
||||
"<tr class=\"odd\">",
|
||||
"<td style=\"text-align: left;\"><p>1,000,000</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>100</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>144</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>2737</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>1001</p></td>",
|
||||
"</tr>",
|
||||
"<tr class=\"even\">",
|
||||
"<td style=\"text-align: left;\"><p>1,000,000</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>1000</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>144</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>27378</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>1001</p></td>",
|
||||
"</tr>",
|
||||
"<tr class=\"odd\">",
|
||||
"<td style=\"text-align: left;\"><p>100,000,000</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>1</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>144</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>2737</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>1100</p></td>",
|
||||
"</tr>",
|
||||
"<tr class=\"even\">",
|
||||
"<td style=\"text-align: left;\"><p>100,000,000</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>10</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>144</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>27378</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>1100</p></td>",
|
||||
"</tr>",
|
||||
"<tr class=\"odd\">",
|
||||
"<td style=\"text-align: left;\"><p>100,000,000</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>100</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>144</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>273785</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>1100</p></td>",
|
||||
"</tr>",
|
||||
"<tr class=\"even\">",
|
||||
"<td style=\"text-align: left;\"><p>100,000,000</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>1000</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>144</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>2737850</p></td>",
|
||||
"<td style=\"text-align: left;\"><p>1100</p></td>",
|
||||
"</tr>",
|
||||
"</tbody>",
|
||||
"</table>"
|
||||
],
|
||||
"recommended_riskfactor_values": [
|
||||
"The default *fuzz* factor is 5%, so as you can see from the table above, that tends to overwhelm the effect of *riskfactor* less than about 5.",
|
||||
"",
|
||||
"1 is a conservative value for a stable lightning network with very few failures.",
|
||||
"",
|
||||
"1000 is an aggressive value for trying to minimize timeouts at all costs.",
|
||||
"",
|
||||
"The default for lightning-pay(7) is 10, which starts to become a major factor for larger amounts, and is basically ignored for tiny ones."
|
||||
],
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:getroute#1",
|
||||
"method": "getroute",
|
||||
"params": {
|
||||
"id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518",
|
||||
"amount_msat": 50000000,
|
||||
"riskfactor": 1,
|
||||
"cltv": 9,
|
||||
"fromid": null,
|
||||
"fuzzpercent": null,
|
||||
"exclude": null,
|
||||
"maxhops": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "example:getroute#2",
|
||||
"method": "getroute",
|
||||
"params": {
|
||||
"id": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d",
|
||||
"amount_msat": "50000sat",
|
||||
"riskfactor": 10
|
||||
}
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"route": [
|
||||
{
|
||||
"id": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d",
|
||||
"channel": "103x3x0",
|
||||
"direction": 1,
|
||||
"amount_msat": 50001002,
|
||||
"delay": 21,
|
||||
"style": "tlv"
|
||||
},
|
||||
{
|
||||
"id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59",
|
||||
"channel": "103x1x0",
|
||||
"direction": 1,
|
||||
"amount_msat": 50000501,
|
||||
"delay": 15,
|
||||
"style": "tlv"
|
||||
},
|
||||
{
|
||||
"id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518",
|
||||
"channel": "103x2x0",
|
||||
"direction": 0,
|
||||
"amount_msat": 50000000,
|
||||
"delay": 9,
|
||||
"style": "tlv"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"route": [
|
||||
{
|
||||
"id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59",
|
||||
"channel": "103x2x0",
|
||||
"direction": 1,
|
||||
"amount_msat": 50051000,
|
||||
"delay": 15,
|
||||
"style": "tlv"
|
||||
},
|
||||
{
|
||||
"id": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d",
|
||||
"channel": "103x1x0",
|
||||
"direction": 0,
|
||||
"amount_msat": 50000000,
|
||||
"delay": 9,
|
||||
"style": "tlv"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"author": [
|
||||
"Rusty Russell <<rusty@rustcorp.com.au>> is mainly responsible."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-pay(7)",
|
||||
"lightning-sendpay(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
130
doc/schemas/lightning-help.json
Normal file
130
doc/schemas/lightning-help.json
Normal file
|
@ -0,0 +1,130 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"rpc": "help",
|
||||
"title": "Command to return all information about RPC commands.",
|
||||
"description": [
|
||||
"The **help** is a RPC command which is possible consult all information about the RPC commands, or a specific command if *command* is given.",
|
||||
"",
|
||||
"Note that the lightning-cli(1) tool will prefer to list a man page when a specific *command* is specified, and will only return the JSON if the man page is not found."
|
||||
],
|
||||
"request": {
|
||||
"required": [],
|
||||
"properties": {
|
||||
"command": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Command to get information about."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"help"
|
||||
],
|
||||
"properties": {
|
||||
"help": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": true,
|
||||
"required": [
|
||||
"command",
|
||||
"category",
|
||||
"description",
|
||||
"verbose"
|
||||
],
|
||||
"properties": {
|
||||
"command": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The command."
|
||||
]
|
||||
},
|
||||
"category": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The category for this command (useful for grouping)."
|
||||
]
|
||||
},
|
||||
"description": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"A one-line description of the purpose of this command."
|
||||
]
|
||||
},
|
||||
"verbose": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"A full description of this command (including whether it's deprecated)."
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"format-hint": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"simple"
|
||||
],
|
||||
"description": [
|
||||
"Prints the help in human-readable flat form."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:help#1",
|
||||
"method": "help",
|
||||
"params": {
|
||||
"command": "pay"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "example:help#2",
|
||||
"method": "help",
|
||||
"params": {
|
||||
"command": "dev"
|
||||
}
|
||||
}
|
||||
],
|
||||
"errors": [
|
||||
"On failure, one of the following error codes may be returned:",
|
||||
"",
|
||||
"- -32602: Error in given parameters."
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"help": [
|
||||
{
|
||||
"command": "pay bolt11 [amount_msat] [label] [riskfactor] [maxfeepercent] [retry_for] [maxdelay] [exemptfee] [localinvreqid] [exclude] [maxfee] [description] [dev_use_shadow]",
|
||||
"category": "plugin",
|
||||
"description": "Send payment specified by {bolt11}",
|
||||
"verbose": "Attempt to pay the {bolt11} invoice."
|
||||
}
|
||||
],
|
||||
"format-hint": "simple"
|
||||
},
|
||||
{
|
||||
"help": [
|
||||
{
|
||||
"command": "dev subcommand=crash|rhash|slowcmd",
|
||||
"category": "developer",
|
||||
"description": "Developer command test multiplexer",
|
||||
"verbose": "dev rhash {secret}\n\tShow SHA256 of {secret}\ndev crash\n\tCrash lightningd by calling fatal()\ndev slowcmd {msec}\n\tTorture test for slow commands, optional {msec}\n"
|
||||
}
|
||||
],
|
||||
"format-hint": "simple"
|
||||
}
|
||||
],
|
||||
"author": [
|
||||
"Vincenzo Palazzo <<vincenzo.palazzo@protonmail.com>> wrote the initial version of this man page,",
|
||||
"but many others did the hard work of actually implementing this rpc command."
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
254
doc/schemas/lightning-invoice.json
Normal file
254
doc/schemas/lightning-invoice.json
Normal file
|
@ -0,0 +1,254 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"rpc": "invoice",
|
||||
"title": "Command for accepting payments",
|
||||
"description": [
|
||||
"The **invoice** RPC command creates the expectation of a payment of a given amount of milli-satoshi: it returns a unique token which another lightning daemon can use to pay this invoice. This token includes a *route hint* description of an incoming channel with capacity to pay the invoice, if any exists."
|
||||
],
|
||||
"request": {
|
||||
"required": [
|
||||
"amount_msat",
|
||||
"label",
|
||||
"description"
|
||||
],
|
||||
"properties": {
|
||||
"amount_msat": {
|
||||
"type": "msat_or_any",
|
||||
"description": [
|
||||
"The string `any`, which creates an invoice that can be paid with any amount. Otherwise it is a positive value in millisatoshi precision; it can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*."
|
||||
]
|
||||
},
|
||||
"label": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"type": "integer"
|
||||
}
|
||||
],
|
||||
"description": [
|
||||
"A unique string or number (which is treated as a string, so `01` is different from `1`); it is never revealed to other nodes on the lightning network, but it can be used to query the status of this invoice."
|
||||
]
|
||||
},
|
||||
"description": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"A short description of purpose of payment, e.g. *1 cup of coffee*. This value is encoded into the BOLT11 invoice and is viewable by any node you send this invoice to (unless *deschashonly* is true as described below). It must be UTF-8, and cannot use *\\u* JSON escape codes."
|
||||
]
|
||||
},
|
||||
"expiry": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"The time the invoice is valid for, in seconds. If no value is provided the default of 604800 (1 week) is used."
|
||||
]
|
||||
},
|
||||
"fallbacks": {
|
||||
"type": "array",
|
||||
"description": [
|
||||
"One or more fallback addresses to include in the invoice (in order from most- preferred to least): note that these arrays are not currently tracked to fulfill the invoice."
|
||||
],
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"preimage": {
|
||||
"type": "hex",
|
||||
"description": [
|
||||
"A 64-digit hex string to be used as payment preimage for the created invoice. By default, if unspecified, lightningd will generate a secure pseudorandom preimage seeded from an appropriate entropy source on your system. **IMPORTANT**: if you specify the *preimage*, you are responsible, to ensure appropriate care for generating using a secure pseudorandom generator seeded with sufficient entropy, and keeping the preimage secret. This parameter is an advanced feature intended for use with cutting-edge cryptographic protocols and should not be used unless explicitly needed."
|
||||
]
|
||||
},
|
||||
"exposeprivatechannels": {
|
||||
"description": [
|
||||
"If specified, it overrides the default route hint logic, which will use unpublished channels only if there are no published channels."
|
||||
],
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "boolean",
|
||||
"description": [
|
||||
"If *True* unpublished channels are always considered as a route hint candidate; if *False*, never."
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "array",
|
||||
"description": [
|
||||
"Array of short channel ids (or a remote alias), only those specific channels will be considered candidates, even if they are public or dead-ends."
|
||||
],
|
||||
"items": {
|
||||
"type": "short_channel_id"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "short_channel_id",
|
||||
"description": [
|
||||
"If it is a short channel id (e.g. *1x1x3*), only this specific channel will be considered candidate, even if it is public or dead-end."
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"cltv": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"If specified, sets the *min_final_cltv_expiry* for the invoice. Otherwise, it's set to the parameter **cltv-final**."
|
||||
]
|
||||
},
|
||||
"deschashonly": {
|
||||
"type": "boolean",
|
||||
"description": [
|
||||
"If True, then the bolt11 returned contains a hash of the *description*, rather than the *description* itself: this allows much longer descriptions, but they must be communicated via some other mechanism."
|
||||
],
|
||||
"default": "False"
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"payment_hash",
|
||||
"expires_at",
|
||||
"created_index",
|
||||
"bolt11",
|
||||
"payment_secret"
|
||||
],
|
||||
"properties": {
|
||||
"bolt11": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The bolt11 string."
|
||||
]
|
||||
},
|
||||
"payment_hash": {
|
||||
"type": "hash",
|
||||
"description": [
|
||||
"The hash of the *payment_preimage* which will prove payment."
|
||||
]
|
||||
},
|
||||
"payment_secret": {
|
||||
"type": "secret",
|
||||
"description": [
|
||||
"The *payment_secret* to place in the onion."
|
||||
]
|
||||
},
|
||||
"expires_at": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"UNIX timestamp of when invoice expires."
|
||||
]
|
||||
},
|
||||
"created_index": {
|
||||
"type": "u64",
|
||||
"added": "v23.08",
|
||||
"description": [
|
||||
"1-based index indicating order this invoice was created in."
|
||||
]
|
||||
},
|
||||
"warning_capacity": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Even using all possible channels, there's not enough incoming capacity to pay this invoice."
|
||||
]
|
||||
},
|
||||
"warning_offline": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"There would be enough incoming capacity, but some channels are offline, so there isn't."
|
||||
]
|
||||
},
|
||||
"warning_deadends": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"There would be enough incoming capacity, but some channels are dead-ends (no other public channels from those peers), so there isn't."
|
||||
]
|
||||
},
|
||||
"warning_private_unused": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"There would be enough incoming capacity, but some channels are unannounced and *exposeprivatechannels* is *false*, so there isn't."
|
||||
]
|
||||
},
|
||||
"warning_mpp": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"There is sufficient capacity, but not in a single channel, so the payer will have to use multi-part payments."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"errors": [
|
||||
"On failure, an error is returned and no invoice is created. If the",
|
||||
"lightning process fails before responding, the caller should use",
|
||||
"lightning-listinvoices(7) to query whether this invoice was created or",
|
||||
"not.",
|
||||
"",
|
||||
"The following error codes may occur:",
|
||||
"",
|
||||
"- -1: Catchall nonspecific error.",
|
||||
"- 900: An invoice with the given *label* already exists.",
|
||||
"- 901: An invoice with the given *preimage* already exists.",
|
||||
"- 902: None of the specified *exposeprivatechannels* were usable."
|
||||
],
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:invoice#1",
|
||||
"method": "invoice",
|
||||
"params": {
|
||||
"amount_msat": 11000000,
|
||||
"label": "xEoCR94SIz6UIRUEkxum",
|
||||
"description": [
|
||||
"XEoCR94SIz6UIRUEkxum."
|
||||
],
|
||||
"expiry": null,
|
||||
"fallbacks": null,
|
||||
"preimage": null,
|
||||
"exposeprivatechannels": null,
|
||||
"cltv": null,
|
||||
"deschashonly": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "example:invoice#2",
|
||||
"method": "invoice",
|
||||
"params": {
|
||||
"amount_msat": 100,
|
||||
"label": "8",
|
||||
"description": "inv",
|
||||
"expiry": null,
|
||||
"fallbacks": null,
|
||||
"preimage": null,
|
||||
"exposeprivatechannels": null,
|
||||
"cltv": null,
|
||||
"deschashonly": null
|
||||
}
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"payment_hash": "072b1d20f4a7c757a56d5fb10eaed40b58b68849da41fe396cdbd2d81692875a",
|
||||
"expires_at": 1706757730,
|
||||
"bolt11": "lnbcrt110u1pjmr5lzsp5sfjyj3xn7ux592k36hmmt4ax98n6lgct22wvj54yck0upcmep63qpp5qu436g855lr40ftdt7csatk5pdvtdzzfmfqluwtvm0fds95jsadqdpq0pzk7s6j8y69xjt6xe25j5j4g44hsatdxqyjw5qcqp99qxpqysgquwma3zrw4cd8e8j4u9uh4gxukaacckse64kx2l9dqv8rvrysdq5r5dt38t9snqj9u5ar07h2exr4fg56wpudkhkk7gtxlyt72ku5fpqqd4fnlk",
|
||||
"payment_secret": "82644944d3f70d42aad1d5f7b5d7a629e7afa30b529cc952a4c59fc0e3790ea2",
|
||||
"created_index": 1,
|
||||
"warning_deadends": "Insufficient incoming capacity, once dead-end peers were excluded"
|
||||
},
|
||||
{
|
||||
"payment_hash": "f59ae0204dfe8e913207ea36646255b9d2c7c8229e8693d30547fc622eddb6b4",
|
||||
"expires_at": 1709229182,
|
||||
"bolt11": "lnbcrt1n1pja0z07sp5n8fk890nrq7zlcue0lgu7cduaaz765u5rg0kcud4amphuppu8wxspp57kdwqgzdl68fzvs8agmxgcj4h8fv0jpzn6rf85c9gl7xytkak66qdq9d9h8vxqyjw5qcqp99qxpqysgqrneaxh0plvjft457yv3q92rak57a6xw33m6phr0mrsy69sudzgez3adkzdsgwzy32z5usjpxm4rjgcg70h047wf0pgc4l9gyaj2h9ssqcrtv32",
|
||||
"payment_secret": "99d36395f3183c2fe3997fd1cf61bcef45ed53941a1f6c71b5eec37e043c3b8d",
|
||||
"created_index": 9,
|
||||
"warning_capacity": "Insufficient incoming channel capacity to pay invoice"
|
||||
}
|
||||
],
|
||||
"author": [
|
||||
"Rusty Russell <<rusty@rustcorp.com.au>> is mainly responsible."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-listinvoices(7)",
|
||||
"lightning-delinvoice(7)",
|
||||
"lightning-pay(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
145
doc/schemas/lightning-invoicerequest.json
Normal file
145
doc/schemas/lightning-invoicerequest.json
Normal file
|
@ -0,0 +1,145 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"added": "v22.11",
|
||||
"rpc": "invoicerequest",
|
||||
"title": "Command for offering payments",
|
||||
"warning": "experimental-offers only",
|
||||
"description": [
|
||||
"The **invoicerequest** RPC command creates an `invoice_request` to send payments: it automatically enables the processing of an incoming invoice, and payment of it. The reader of the resulting `invoice_request` can use lightning-sendinvoice(7) to collect their payment."
|
||||
],
|
||||
"request": {
|
||||
"required": [
|
||||
"amount",
|
||||
"description"
|
||||
],
|
||||
"properties": {
|
||||
"amount": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"A positive value in millisatoshi precision; it can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*."
|
||||
]
|
||||
},
|
||||
"description": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"A short description of purpose of the payment, e.g. *ATM withdrawl*. This value is encoded into the resulting `invoice_request` and is viewable by anyone you expose it to. It must be UTF-8, and cannot use *\\u* JSON escape codes."
|
||||
]
|
||||
},
|
||||
"issuer": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Who is issuing it (i.e. you) if appropriate."
|
||||
]
|
||||
},
|
||||
"label": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"An internal-use name for the offer, which can be any UTF-8 string."
|
||||
]
|
||||
},
|
||||
"absolute_expiry": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"The time the offer is valid until, in seconds since the first day of 1970 UTC. If not set, the `invoice_request` remains valid (though it can be deactivated by the issuer of course). This is encoded in the `invoice_request`."
|
||||
]
|
||||
},
|
||||
"single_use": {
|
||||
"type": "boolean",
|
||||
"description": [
|
||||
"Indicates that the `invoice_request` is only valid once; we may attempt multiple payments, but as soon as one is successful no more invoices are accepted (i.e. only one person can take the money)."
|
||||
],
|
||||
"default": "True"
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"invreq_id",
|
||||
"single_use",
|
||||
"active",
|
||||
"bolt12",
|
||||
"used"
|
||||
],
|
||||
"properties": {
|
||||
"invreq_id": {
|
||||
"type": "hash",
|
||||
"description": [
|
||||
"The SHA256 hash of all invoice_request fields less than 160."
|
||||
]
|
||||
},
|
||||
"active": {
|
||||
"type": "boolean",
|
||||
"enum": [
|
||||
true
|
||||
],
|
||||
"description": [
|
||||
"Whether the invoice_request is currently active."
|
||||
]
|
||||
},
|
||||
"single_use": {
|
||||
"type": "boolean",
|
||||
"description": [
|
||||
"Whether the invoice_request will become inactive after we pay an invoice for it."
|
||||
]
|
||||
},
|
||||
"bolt12": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The bolt12 string starting with lnr."
|
||||
]
|
||||
},
|
||||
"used": {
|
||||
"type": "boolean",
|
||||
"enum": [
|
||||
false
|
||||
],
|
||||
"description": [
|
||||
"Whether the invoice_request has already been used."
|
||||
]
|
||||
},
|
||||
"label": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The label provided when creating the invoice_request."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:invoicerequest#1",
|
||||
"method": "invoicerequest",
|
||||
"params": {
|
||||
"amount": "10000sat",
|
||||
"description": "simple test",
|
||||
"issuer": "clightning test suite"
|
||||
}
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"invreq_id": "715484ead84bcdae5b33e3015c686fa1bdd4ae9ade3c4729b58257a98cfcd9b5",
|
||||
"active": true,
|
||||
"single_use": true,
|
||||
"bolt12": "lnr1qqgteyhfyp40c79a5y3gfe33nxfs6zstwd5k6urvv5s8getnwsfp2cmvd9nksarwd9hxwgr5v4ehggrnw45hge2syqrzymjxzydqkkw24ufxqslttwlj3s608f0rx2slc7etw0833zgs75srnztgqkppqfnwgkvdr57yzh6h92zg3qctvrm7w38djg67kzcm4yeg8vc4cq633uzq99smfawuu6pz0zh9jl6dl8v25u3kzes975x2j9tr0qp0ux0tlzcxjrgehxh9luz5vwjpk92tys9f9zlm038krcz4uqfxgelwf43tgfc",
|
||||
"used": false
|
||||
}
|
||||
],
|
||||
"errors": [
|
||||
"On failure, an error is returned and no `invoice_request` is created. If the lightning process fails before responding, the caller should use lightning-listinvoicerequests(7) to query whether it was created or not.",
|
||||
"",
|
||||
"- -1: Catchall nonspecific error."
|
||||
],
|
||||
"author": [
|
||||
"Rusty Russell <<rusty@rustcorp.com.au>> is mainly responsible."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-listinvoicerequests(7)",
|
||||
"lightning-disableinvoicerequest(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
319
doc/schemas/lightning-keysend.json
Normal file
319
doc/schemas/lightning-keysend.json
Normal file
|
@ -0,0 +1,319 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"rpc": "keysend",
|
||||
"title": "Send funds to a node without an invoice",
|
||||
"description": [
|
||||
"The **keysend** RPC command attempts to find a route to the given destination, and send the specified amount to it. Unlike the `pay` RPC command the `keysend` command does not require an invoice, instead it uses the `destination` node ID, and `amount` to find a route to the specified node.",
|
||||
"",
|
||||
"In order for the destination to be able to claim the payment, the `payment_key` is randomly generated by the sender and included in the encrypted payload for the destination. As a consequence there is not proof-of-payment, like there is with an invoice where the `payment_key` is generated on the destination, and the only way sender could have it is by sending a payment. Please ensure that this matches your use-case when using `keysend`.",
|
||||
"",
|
||||
"When using *lightning-cli*, you may skip optional parameters by using *null*. Alternatively, use **-k** option to provide parameters by name."
|
||||
],
|
||||
"request": {
|
||||
"required": [
|
||||
"destination",
|
||||
"amount_msat"
|
||||
],
|
||||
"properties": {
|
||||
"destination": {
|
||||
"type": "pubkey",
|
||||
"description": [
|
||||
"The 33 byte, hex-encoded, node ID of the node that the payment should go to."
|
||||
]
|
||||
},
|
||||
"amount_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"A whole number, or a whole number with suffix `msat` or `sat`, or a three decimal point number with suffix `sat`, or an 1 to 11 decimal point number suffixed by `btc`."
|
||||
]
|
||||
},
|
||||
"label": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Used to attach a label to payments, and is returned in lightning-listpays(7) and lightning-listsendpays(7)."
|
||||
]
|
||||
},
|
||||
"maxfeepercent": {
|
||||
"type": "number",
|
||||
"description": [
|
||||
"Limits the money paid in fees as percentage of the total amount that is to be transferred."
|
||||
],
|
||||
"default": "0.5"
|
||||
},
|
||||
"retry_for": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"Until *retry_for* seconds passes, the command will keep finding routes and retrying the payment. However, a payment may be delayed for up to `maxdelay` blocks by another node; clients should be prepared for this worst case."
|
||||
],
|
||||
"default": "60 seconds"
|
||||
},
|
||||
"maxdelay": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"Number of blocks the payment may be delayed."
|
||||
]
|
||||
},
|
||||
"exemptfee": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"Used for tiny payments which would be dominated by the fee leveraged by forwarding nodes. Setting `exemptfee` allows the `maxfeepercent` check to be skipped on fees that are smaller than *exemptfee*."
|
||||
],
|
||||
"default": "5000 millisatoshi"
|
||||
},
|
||||
"routehints": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"id",
|
||||
"scid",
|
||||
"feebase",
|
||||
"feeprop",
|
||||
"expirydelta"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "pubkey"
|
||||
},
|
||||
"scid": {
|
||||
"type": "short_channel_id"
|
||||
},
|
||||
"feebase": {
|
||||
"type": "msat"
|
||||
},
|
||||
"feeprop": {
|
||||
"type": "u32"
|
||||
},
|
||||
"expirydelta": {
|
||||
"type": "u16"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"extratlvs": {
|
||||
"type": "object",
|
||||
"additionalProperties": true,
|
||||
"required": [],
|
||||
"description": [
|
||||
"Dictionary of additional fields to insert into the final tlv. The format is 'fieldnumber': 'hexstring'."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"payment_preimage",
|
||||
"payment_hash",
|
||||
"created_at",
|
||||
"parts",
|
||||
"amount_msat",
|
||||
"amount_sent_msat",
|
||||
"status"
|
||||
],
|
||||
"properties": {
|
||||
"payment_preimage": {
|
||||
"type": "secret",
|
||||
"description": [
|
||||
"The proof of payment: SHA256 of this **payment_hash**."
|
||||
]
|
||||
},
|
||||
"destination": {
|
||||
"type": "pubkey",
|
||||
"description": [
|
||||
"The final destination of the payment."
|
||||
]
|
||||
},
|
||||
"payment_hash": {
|
||||
"type": "hash",
|
||||
"description": [
|
||||
"The hash of the *payment_preimage* which will prove payment."
|
||||
]
|
||||
},
|
||||
"created_at": {
|
||||
"type": "number",
|
||||
"description": [
|
||||
"The UNIX timestamp showing when this payment was initiated."
|
||||
]
|
||||
},
|
||||
"parts": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"How many attempts this took."
|
||||
]
|
||||
},
|
||||
"amount_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"Amount the recipient received."
|
||||
]
|
||||
},
|
||||
"amount_sent_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"Total amount we sent (including fees)."
|
||||
]
|
||||
},
|
||||
"warning_partial_completion": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Not all parts of a multi-part payment have completed."
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"complete"
|
||||
],
|
||||
"description": [
|
||||
"Status of payment."
|
||||
]
|
||||
}
|
||||
},
|
||||
"post_return_value_notes": [
|
||||
"You can monitor the progress and retries of a payment using the lightning-paystatus(7) command."
|
||||
]
|
||||
},
|
||||
"randomization": [
|
||||
"To protect user privacy, the payment algorithm performs some randomization.",
|
||||
"",
|
||||
"1: Route Randomization",
|
||||
"",
|
||||
"Route randomization means the payment algorithm does not always use the lowest-fee or shortest route. This prevents some highly-connected node from learning all of the user payments by reducing their fees below the network average.",
|
||||
"",
|
||||
"2: Shadow Route",
|
||||
"",
|
||||
"Shadow route means the payment algorithm will virtually extend the route by adding delays and fees along it, making it appear to intermediate nodes that the route is longer than it actually is. This prevents intermediate nodes from reliably guessing their distance from the payee.",
|
||||
"",
|
||||
"Route randomization will never exceed *maxfeepercent* of the payment. Route randomization and shadow routing will not take routes that would exceed *maxdelay*."
|
||||
],
|
||||
"errors": [
|
||||
"The following error codes may occur:",
|
||||
"",
|
||||
"- -1: Catchall nonspecific error.",
|
||||
"- 203: Permanent failure at destination. The *data* field of the error will be routing failure object.",
|
||||
"- 205: Unable to find a route.",
|
||||
"- 206: Route too expensive. Either the fee or the needed total locktime for the route exceeds your *maxfeepercent* or *maxdelay* settings, respectively. The *data* field of the error will indicate the actual *fee* as well as the *feepercent* percentage that the fee has of the destination payment amount. It will also indicate the actual *delay* along the route.",
|
||||
"- 210: Payment timed out without a payment in progress.",
|
||||
"",
|
||||
"A routing failure object has the fields below:",
|
||||
"",
|
||||
"*erring_index*: The index of the node along the route that reported the error. 0 for the local node, 1 for the first hop, and so on.",
|
||||
"*erring_node*: The hex string of the pubkey id of the node that reported the error.",
|
||||
"*erring_channel*: The short channel ID of the channel that has the error, or *0:0:0* if the destination node raised the error.",
|
||||
"*failcode*: The failure code, as per BOLT #4.",
|
||||
"*channel_update*: The hex string of the *channel_update* message received from the remote node. Only present if error is from the remote node and the *failcode* has the `UPDATE` bit set, as per BOLT #4."
|
||||
],
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:keysend#1",
|
||||
"method": "keysend",
|
||||
"params": {
|
||||
"destination": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d",
|
||||
"amount_msat": 10000,
|
||||
"label": null,
|
||||
"maxfeepercent": null,
|
||||
"retry_for": null,
|
||||
"maxdelay": null,
|
||||
"exemptfee": null,
|
||||
"extratlvs": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "example:keysend#2",
|
||||
"method": "keysend",
|
||||
"params": {
|
||||
"destination": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518",
|
||||
"amount_msat": 10000000,
|
||||
"label": null,
|
||||
"maxfeepercent": null,
|
||||
"retry_for": null,
|
||||
"maxdelay": null,
|
||||
"exemptfee": null,
|
||||
"extratlvs": {
|
||||
"133773310": "68656c6c6f776f726c64",
|
||||
"133773312": "66696c7465726d65"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "example:keysend#3",
|
||||
"method": "keysend",
|
||||
"params": {
|
||||
"destination": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d",
|
||||
"amount_msat": 10000,
|
||||
"routehints": [
|
||||
[
|
||||
{
|
||||
"scid": "4615051x2233541x57738",
|
||||
"id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59",
|
||||
"feebase": 1,
|
||||
"feeprop": 10,
|
||||
"expirydelta": 9
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"scid": "1x2x3",
|
||||
"id": "020202020202020202020202020202020202020202020202020202020202020202",
|
||||
"feebase": 1,
|
||||
"feeprop": 1,
|
||||
"expirydelta": 9
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"destination": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d",
|
||||
"payment_hash": "b6f88603008a9f7dd84b1b94c7b972c8efbaf0b86c8d3c04512955992da9028e",
|
||||
"created_at": 1706315742.6861734,
|
||||
"parts": 1,
|
||||
"amount_msat": 10000,
|
||||
"amount_sent_msat": 10001,
|
||||
"payment_preimage": "7178cf708e34dce816fc35aa692a65e1f85b92ae03bbc8ae6543302511823174",
|
||||
"status": "complete"
|
||||
},
|
||||
{
|
||||
"destination": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518",
|
||||
"payment_hash": "e8474eea8d5673e8407ef5f4924e58479b51a68afd136384683d5d6a97c9520d",
|
||||
"created_at": 1708640424.1810749,
|
||||
"parts": 1,
|
||||
"amount_msat": 10000000,
|
||||
"amount_sent_msat": 10000000,
|
||||
"payment_preimage": "40e47272ea7da20c57a2381d81a5513ec03bd8ead9d51fbd2a91ec76d3f4bcbf",
|
||||
"status": "complete"
|
||||
},
|
||||
{
|
||||
"destination": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d",
|
||||
"payment_hash": "56e12e6f45120bef7385c9bf307319eaa6a1b9160cdb3e62a3f492abf5bfa4bc",
|
||||
"created_at": 1708640437.2895157,
|
||||
"parts": 1,
|
||||
"amount_msat": 10000,
|
||||
"amount_sent_msat": 10001,
|
||||
"payment_preimage": "682870b8f96e2aed1c86694dbb2c3e64cd396b9bba9fafd824d90eb0bd371b85",
|
||||
"status": "complete"
|
||||
}
|
||||
],
|
||||
"author": [
|
||||
"Christian Decker <<decker@blockstream.com>> is mainly responsible."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-listpays(7)",
|
||||
"lightning-decodepay(7)",
|
||||
"lightning-listinvoice(7)",
|
||||
"lightning-delinvoice(7)",
|
||||
"lightning-getroute(7)",
|
||||
"lightning-invoice(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
249
doc/schemas/lightning-listchannels.json
Normal file
249
doc/schemas/lightning-listchannels.json
Normal file
|
@ -0,0 +1,249 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"rpc": "listchannels",
|
||||
"title": "Command to query active lightning channels in the entire network",
|
||||
"description": [
|
||||
"The **listchannels** RPC command returns data on channels that are known to the node. Because channels may be bidirectional, up to 2 objects will be returned for each channel (one for each direction).",
|
||||
"",
|
||||
"Only one of *short_channel_id*, *source* or *destination* can be supplied. If nothing is supplied, data on all lightning channels known to this node, are returned. These can be local channels or public channels broadcast on the gossip network."
|
||||
],
|
||||
"request": {
|
||||
"required": [],
|
||||
"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."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"channels"
|
||||
],
|
||||
"properties": {
|
||||
"channels": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"source",
|
||||
"destination",
|
||||
"short_channel_id",
|
||||
"direction",
|
||||
"public",
|
||||
"amount_msat",
|
||||
"message_flags",
|
||||
"channel_flags",
|
||||
"active",
|
||||
"last_update",
|
||||
"base_fee_millisatoshi",
|
||||
"fee_per_millionth",
|
||||
"delay",
|
||||
"htlc_minimum_msat",
|
||||
"features"
|
||||
],
|
||||
"properties": {
|
||||
"source": {
|
||||
"type": "pubkey",
|
||||
"description": [
|
||||
"The source node."
|
||||
]
|
||||
},
|
||||
"destination": {
|
||||
"type": "pubkey",
|
||||
"description": [
|
||||
"The destination node."
|
||||
]
|
||||
},
|
||||
"short_channel_id": {
|
||||
"type": "short_channel_id",
|
||||
"description": [
|
||||
"Short channel id of channel."
|
||||
]
|
||||
},
|
||||
"direction": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"Direction (0 if source < destination, 1 otherwise)."
|
||||
]
|
||||
},
|
||||
"public": {
|
||||
"type": "boolean",
|
||||
"description": [
|
||||
"True if this is announced (from *v24.02*, being false is deprecated)."
|
||||
]
|
||||
},
|
||||
"amount_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"The total capacity of this channel (always a whole number of satoshis)."
|
||||
]
|
||||
},
|
||||
"message_flags": {
|
||||
"type": "u8",
|
||||
"description": [
|
||||
"As defined by BOLT #7."
|
||||
]
|
||||
},
|
||||
"channel_flags": {
|
||||
"type": "u8",
|
||||
"description": [
|
||||
"As defined by BOLT #7."
|
||||
]
|
||||
},
|
||||
"active": {
|
||||
"type": "boolean",
|
||||
"description": [
|
||||
"True unless source has disabled it (or (deprecated in *v24.02*) it's a local channel and the peer is disconnected or it's still opening or closing)."
|
||||
]
|
||||
},
|
||||
"last_update": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"UNIX timestamp on the last channel_update from *source*."
|
||||
]
|
||||
},
|
||||
"base_fee_millisatoshi": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"Base fee changed by *source* to use this channel."
|
||||
]
|
||||
},
|
||||
"fee_per_millionth": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"Proportional fee changed by *source* to use this channel, in parts-per-million."
|
||||
]
|
||||
},
|
||||
"delay": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"The number of blocks delay required by *source* to use this channel."
|
||||
]
|
||||
},
|
||||
"htlc_minimum_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"The smallest payment *source* will allow via this channel."
|
||||
]
|
||||
},
|
||||
"htlc_maximum_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"The largest payment *source* will allow via this channel."
|
||||
]
|
||||
},
|
||||
"features": {
|
||||
"type": "hex",
|
||||
"description": [
|
||||
"BOLT #9 features bitmap for this channel."
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"post_return_value_notes": [
|
||||
"If one of *short_channel_id*, *source* or *destination* is supplied and no matching channels are found, a 'channels' object with an empty list is returned."
|
||||
]
|
||||
},
|
||||
"errors": [
|
||||
"On error the returned object will contain `code` and `message` properties, with `code` being one of the following:",
|
||||
"",
|
||||
"- -32602: If the given parameters are wrong."
|
||||
],
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:listchannels#1",
|
||||
"method": "listchannels",
|
||||
"params": {
|
||||
"short_channel_id": "103x1x0",
|
||||
"source": null,
|
||||
"destination": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "example:listchannels#2",
|
||||
"method": "listchannels",
|
||||
"params": {
|
||||
"short_channel_id": null,
|
||||
"source": null,
|
||||
"destination": null
|
||||
}
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"channels": []
|
||||
},
|
||||
{
|
||||
"channels": [
|
||||
{
|
||||
"source": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59",
|
||||
"destination": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518",
|
||||
"short_channel_id": "103x1x0",
|
||||
"direction": 0,
|
||||
"public": true,
|
||||
"amount_msat": 1000000000,
|
||||
"message_flags": 1,
|
||||
"channel_flags": 0,
|
||||
"active": true,
|
||||
"last_update": 1706153393,
|
||||
"base_fee_millisatoshi": 1,
|
||||
"fee_per_millionth": 10,
|
||||
"delay": 6,
|
||||
"htlc_minimum_msat": 0,
|
||||
"htlc_maximum_msat": 990000000,
|
||||
"features": ""
|
||||
},
|
||||
{
|
||||
"source": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518",
|
||||
"destination": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59",
|
||||
"short_channel_id": "103x1x0",
|
||||
"direction": 1,
|
||||
"public": true,
|
||||
"amount_msat": 1000000000,
|
||||
"message_flags": 1,
|
||||
"channel_flags": 1,
|
||||
"active": true,
|
||||
"last_update": 1706153393,
|
||||
"base_fee_millisatoshi": 1,
|
||||
"fee_per_millionth": 10,
|
||||
"delay": 6,
|
||||
"htlc_minimum_msat": 0,
|
||||
"htlc_maximum_msat": 990000000,
|
||||
"features": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"author": [
|
||||
"Michael Hawkins <<michael.hawkins@protonmail.com>>."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-fundchannel(7)",
|
||||
"lightning-listnodes(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>",
|
||||
"",
|
||||
"BOLT #7: <https://github.com/lightning/bolts/blob/master/07-routing-gossip.md>"
|
||||
]
|
||||
}
|
285
doc/schemas/lightning-listclosedchannels.json
Normal file
285
doc/schemas/lightning-listclosedchannels.json
Normal file
|
@ -0,0 +1,285 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"added": "v23.05",
|
||||
"rpc": "listclosedchannels",
|
||||
"title": "Get data on our closed historical channels",
|
||||
"description": [
|
||||
"The **listclosedchannels** RPC command returns data on channels which are otherwise forgotten (more than 100 blocks after they're completely resolved onchain)."
|
||||
],
|
||||
"request": {
|
||||
"required": [],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "pubkey",
|
||||
"description": [
|
||||
"If no *id* is supplied, then channel data on all historical channels are given. Supplying *id* will filter the results to only match channels to that peer. Note that prior to v23.05, old peers were forgotten."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"closedchannels"
|
||||
],
|
||||
"properties": {
|
||||
"closedchannels": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": true,
|
||||
"required": [
|
||||
"channel_id",
|
||||
"opener",
|
||||
"private",
|
||||
"total_msat",
|
||||
"total_local_commitments",
|
||||
"total_remote_commitments",
|
||||
"total_htlcs_sent",
|
||||
"funding_txid",
|
||||
"funding_outnum",
|
||||
"leased",
|
||||
"final_to_us_msat",
|
||||
"min_to_us_msat",
|
||||
"max_to_us_msat",
|
||||
"close_cause"
|
||||
],
|
||||
"properties": {
|
||||
"peer_id": {
|
||||
"type": "pubkey",
|
||||
"description": [
|
||||
"Peer public key (can be missing with pre-v23.05 closes!)."
|
||||
]
|
||||
},
|
||||
"channel_id": {
|
||||
"type": "hash",
|
||||
"description": [
|
||||
"The full channel_id (funding txid Xored with output number)."
|
||||
]
|
||||
},
|
||||
"short_channel_id": {
|
||||
"type": "short_channel_id",
|
||||
"description": [
|
||||
"The short_channel_id."
|
||||
]
|
||||
},
|
||||
"alias": {
|
||||
"type": "object",
|
||||
"required": [],
|
||||
"properties": {
|
||||
"local": {
|
||||
"type": "short_channel_id",
|
||||
"description": [
|
||||
"An alias assigned by this node to this channel, used for outgoing payments."
|
||||
]
|
||||
},
|
||||
"remote": {
|
||||
"type": "short_channel_id",
|
||||
"description": [
|
||||
"An alias assigned by the remote node to this channel, usable in routehints and invoices."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"opener": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"local",
|
||||
"remote"
|
||||
],
|
||||
"description": [
|
||||
"Who initiated the channel."
|
||||
]
|
||||
},
|
||||
"closer": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"local",
|
||||
"remote"
|
||||
],
|
||||
"description": [
|
||||
"Who initiated the channel close (only present if closing)."
|
||||
]
|
||||
},
|
||||
"private": {
|
||||
"type": "boolean",
|
||||
"description": [
|
||||
"If True, we will not announce this channel."
|
||||
]
|
||||
},
|
||||
"channel_type": {
|
||||
"type": "object",
|
||||
"description": [
|
||||
"Channel_type as negotiated with peer."
|
||||
],
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"bits",
|
||||
"names"
|
||||
],
|
||||
"properties": {
|
||||
"bits": {
|
||||
"type": "array",
|
||||
"description": [
|
||||
"Each bit set in this channel_type."
|
||||
],
|
||||
"items": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"Bit number."
|
||||
]
|
||||
}
|
||||
},
|
||||
"names": {
|
||||
"type": "array",
|
||||
"description": [
|
||||
"Feature name for each bit set in this channel_type."
|
||||
],
|
||||
"items": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"static_remotekey/even",
|
||||
"anchor_outputs/even",
|
||||
"anchors_zero_fee_htlc_tx/even",
|
||||
"scid_alias/even",
|
||||
"zeroconf/even"
|
||||
],
|
||||
"description": [
|
||||
"Name of feature bit."
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"total_local_commitments": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"Number of commitment transaction we made."
|
||||
]
|
||||
},
|
||||
"total_remote_commitments": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"Number of commitment transaction they made."
|
||||
]
|
||||
},
|
||||
"total_htlcs_sent": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"Number of HTLCs we ever sent."
|
||||
]
|
||||
},
|
||||
"funding_txid": {
|
||||
"type": "txid",
|
||||
"description": [
|
||||
"ID of the funding transaction."
|
||||
]
|
||||
},
|
||||
"funding_outnum": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"The 0-based output number of the funding transaction which opens the channel."
|
||||
]
|
||||
},
|
||||
"leased": {
|
||||
"type": "boolean",
|
||||
"description": [
|
||||
"Whether this channel was leased from `opener`."
|
||||
]
|
||||
},
|
||||
"funding_fee_paid_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"How much we paid to lease the channel (iff `leased` is true and `opener` is local)."
|
||||
]
|
||||
},
|
||||
"funding_fee_rcvd_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"How much they paid to lease the channel (iff `leased` is true and `opener` is remote)."
|
||||
]
|
||||
},
|
||||
"funding_pushed_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"How much `opener` pushed immediate (if non-zero)."
|
||||
]
|
||||
},
|
||||
"total_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"Total amount in the channel."
|
||||
]
|
||||
},
|
||||
"final_to_us_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"Our balance in final commitment transaction."
|
||||
]
|
||||
},
|
||||
"min_to_us_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"Least amount owed to us ever. If the peer were to successfully steal from us, this is the amount we would still retain."
|
||||
]
|
||||
},
|
||||
"max_to_us_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"Most amount owed to us ever. If we were to successfully steal from the peer, this is the amount we could potentially get."
|
||||
]
|
||||
},
|
||||
"last_commitment_txid": {
|
||||
"type": "hash",
|
||||
"description": [
|
||||
"The final commitment tx's txid (or mutual close, if we accepted it). Not present for some very old, small channels pre-0.7.0."
|
||||
]
|
||||
},
|
||||
"last_commitment_fee_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"The fee on `last_commitment_txid`."
|
||||
]
|
||||
},
|
||||
"close_cause": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"unknown",
|
||||
"local",
|
||||
"user",
|
||||
"remote",
|
||||
"protocol",
|
||||
"onchain"
|
||||
],
|
||||
"description": [
|
||||
"What caused the channel to close."
|
||||
]
|
||||
},
|
||||
"last_stable_connection": {
|
||||
"type": "u64",
|
||||
"added": "v24.02",
|
||||
"description": [
|
||||
"Last time we reestablished the open channel and stayed connected for 1 minute."
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"errors": [
|
||||
"On error the returned object will contain `code` and `message` properties, with `code` being one of the following:",
|
||||
"",
|
||||
"- -32602: If the given parameters are wrong."
|
||||
],
|
||||
"author": [
|
||||
"Rusty Russell <<rusty@blockstream.com>>."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-listpeerchannels(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
2938
doc/schemas/lightning-listconfigs.json
Normal file
2938
doc/schemas/lightning-listconfigs.json
Normal file
File diff suppressed because it is too large
Load diff
130
doc/schemas/lightning-listdatastore.json
Normal file
130
doc/schemas/lightning-listdatastore.json
Normal file
|
@ -0,0 +1,130 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"rpc": "listdatastore",
|
||||
"title": "Command for listing (plugin) data",
|
||||
"description": [
|
||||
"The **listdatastore** RPC command allows plugins to fetch data which was stored in the Core Lightning database."
|
||||
],
|
||||
"request": {
|
||||
"required": [],
|
||||
"properties": {
|
||||
"key": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "array",
|
||||
"description": [
|
||||
"All immediate children of the *key* (or root children) are returned.",
|
||||
" Using the first element of the key as the plugin name (e.g. `[ 'summary' ]`) is recommended.",
|
||||
" An array of values to form a hierarchy (though a single value is treated as a one-element array)."
|
||||
],
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"datastore"
|
||||
],
|
||||
"properties": {
|
||||
"datastore": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"key"
|
||||
],
|
||||
"properties": {
|
||||
"key": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Part of the key added to the datastore."
|
||||
]
|
||||
}
|
||||
},
|
||||
"generation": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"The number of times this has been updated."
|
||||
]
|
||||
},
|
||||
"hex": {
|
||||
"type": "hex",
|
||||
"description": [
|
||||
"The hex data from the datastore."
|
||||
]
|
||||
},
|
||||
"string": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The data as a string, if it's valid utf-8."
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"errors": [
|
||||
"The following error codes may occur:",
|
||||
"",
|
||||
"- -32602: invalid parameters."
|
||||
],
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:listdatastore#1",
|
||||
"method": "listdatastore",
|
||||
"params": {
|
||||
"key": [
|
||||
"commando"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "example:listdatastore#2",
|
||||
"method": "listdatastore",
|
||||
"params": {
|
||||
"key": "otherkey"
|
||||
}
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"datastore": []
|
||||
},
|
||||
{
|
||||
"datastore": [
|
||||
{
|
||||
"key": [
|
||||
"otherkey"
|
||||
],
|
||||
"generation": 0,
|
||||
"hex": "6f7468657264617461",
|
||||
"string": "otherdata"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"author": [
|
||||
"Rusty Russell <<rusty@rustcorp.com.au>> is mainly responsible."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-datastore(7)",
|
||||
"lightning-deldatastore(7)",
|
||||
"lightning-datastoreusage(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
453
doc/schemas/lightning-listforwards.json
Normal file
453
doc/schemas/lightning-listforwards.json
Normal file
|
@ -0,0 +1,453 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"rpc": "listforwards",
|
||||
"title": "Command showing all htlcs and their information",
|
||||
"description": [
|
||||
"The **listforwards** RPC command displays all htlcs that have been attempted to be forwarded by the Core Lightning node."
|
||||
],
|
||||
"request": {
|
||||
"required": [],
|
||||
"properties": {
|
||||
"status": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"If specified, then only the forwards with the given status are returned."
|
||||
],
|
||||
"enum": [
|
||||
"offered",
|
||||
"settled",
|
||||
"local_failed",
|
||||
"failed"
|
||||
]
|
||||
},
|
||||
"in_channel": {
|
||||
"type": "short_channel_id",
|
||||
"description": [
|
||||
"Only the matching forwards on the given inbound channel are returned."
|
||||
]
|
||||
},
|
||||
"out_channel": {
|
||||
"type": "short_channel_id",
|
||||
"description": [
|
||||
"Only the matching forwards on the given outbount channel are returned."
|
||||
]
|
||||
},
|
||||
"index": {
|
||||
"type": "string",
|
||||
"added": "v23.11",
|
||||
"enum": [
|
||||
"created",
|
||||
"updated"
|
||||
],
|
||||
"description": [
|
||||
"If neither *in_channel* nor *out_channel* is specified, it controls ordering."
|
||||
],
|
||||
"default": "`created`"
|
||||
},
|
||||
"start": {
|
||||
"type": "u64",
|
||||
"added": "v23.11",
|
||||
"description": [
|
||||
"If `index` is specified, `start` may be specified to start from that value, which is generally returned from lightning-wait(7)."
|
||||
]
|
||||
},
|
||||
"limit": {
|
||||
"type": "u32",
|
||||
"added": "v23.11",
|
||||
"description": [
|
||||
"If `index` is specified, `limit` can be used to specify the maximum number of entries to return."
|
||||
]
|
||||
}
|
||||
},
|
||||
"dependentUpon": {
|
||||
"index": [
|
||||
"start",
|
||||
"limit"
|
||||
]
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"forwards"
|
||||
],
|
||||
"properties": {
|
||||
"forwards": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": true,
|
||||
"required": [
|
||||
"created_index",
|
||||
"in_channel",
|
||||
"in_msat",
|
||||
"status",
|
||||
"received_time"
|
||||
],
|
||||
"properties": {
|
||||
"created_index": {
|
||||
"added": "v23.11",
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"1-based index indicating order this forward was created in."
|
||||
]
|
||||
},
|
||||
"in_channel": {
|
||||
"type": "short_channel_id",
|
||||
"description": [
|
||||
"The channel that received the HTLC."
|
||||
]
|
||||
},
|
||||
"in_htlc_id": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"The unique HTLC id the sender gave this (not present if incoming channel was closed before upgrade to v22.11)."
|
||||
]
|
||||
},
|
||||
"in_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"The value of the incoming HTLC."
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"offered",
|
||||
"settled",
|
||||
"local_failed",
|
||||
"failed"
|
||||
],
|
||||
"description": [
|
||||
"Still ongoing, completed, failed locally, or failed after forwarding."
|
||||
]
|
||||
},
|
||||
"received_time": {
|
||||
"type": "number",
|
||||
"description": [
|
||||
"The UNIX timestamp when this was received."
|
||||
]
|
||||
},
|
||||
"out_channel": {
|
||||
"type": "short_channel_id",
|
||||
"description": [
|
||||
"The channel that the HTLC (trying to) forward to."
|
||||
]
|
||||
},
|
||||
"out_htlc_id": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"The unique HTLC id we gave this when sending (may be missing even if out_channel is present, for old forwards before v22.11)."
|
||||
]
|
||||
},
|
||||
"updated_index": {
|
||||
"added": "v23.11",
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"1-based index indicating order this forward was changed (only present if it has changed since creation)."
|
||||
]
|
||||
},
|
||||
"style": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"legacy",
|
||||
"tlv"
|
||||
],
|
||||
"description": [
|
||||
"Either a legacy onion format or a modern tlv format."
|
||||
]
|
||||
}
|
||||
},
|
||||
"allOf": [
|
||||
{
|
||||
"if": {
|
||||
"required": [
|
||||
"out_msat"
|
||||
]
|
||||
},
|
||||
"then": {
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"fee_msat",
|
||||
"out_msat",
|
||||
"out_channel"
|
||||
],
|
||||
"properties": {
|
||||
"created_index": {},
|
||||
"updated_index": {},
|
||||
"in_channel": {},
|
||||
"in_htlc_id": {},
|
||||
"in_msatoshi": {},
|
||||
"in_msat": {},
|
||||
"status": {},
|
||||
"style": {},
|
||||
"received_time": {},
|
||||
"resolved_time": {},
|
||||
"out_channel": {},
|
||||
"out_htlc_id": {},
|
||||
"failcode": {},
|
||||
"failreason": {},
|
||||
"fee_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"The amount this paid in fees."
|
||||
]
|
||||
},
|
||||
"out_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"The amount we sent out the *out_channel*."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"else": {
|
||||
"additionalProperties": false,
|
||||
"required": [],
|
||||
"properties": {
|
||||
"created_index": {},
|
||||
"updated_index": {},
|
||||
"in_channel": {},
|
||||
"in_htlc_id": {},
|
||||
"in_msatoshi": {},
|
||||
"in_msat": {},
|
||||
"status": {},
|
||||
"style": {},
|
||||
"received_time": {},
|
||||
"resolved_time": {},
|
||||
"failcode": {},
|
||||
"failreason": {},
|
||||
"out_channel": {}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"if": {
|
||||
"properties": {
|
||||
"status": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"settled",
|
||||
"failed"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"then": {
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"resolved_time"
|
||||
],
|
||||
"properties": {
|
||||
"created_index": {},
|
||||
"updated_index": {},
|
||||
"in_channel": {},
|
||||
"in_htlc_id": {},
|
||||
"in_msatoshi": {},
|
||||
"in_msat": {},
|
||||
"status": {},
|
||||
"style": {},
|
||||
"received_time": {},
|
||||
"out_channel": {},
|
||||
"out_htlc_id": {},
|
||||
"fee": {},
|
||||
"fee_msat": {},
|
||||
"out_msatoshi": {},
|
||||
"out_msat": {},
|
||||
"failcode": {},
|
||||
"failreason": {},
|
||||
"resolved_time": {
|
||||
"type": "number",
|
||||
"description": [
|
||||
"The UNIX timestamp when this was resolved."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"else": {
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"created_index": {},
|
||||
"updated_index": {},
|
||||
"in_channel": {},
|
||||
"in_htlc_id": {},
|
||||
"in_msatoshi": {},
|
||||
"in_msat": {},
|
||||
"status": {},
|
||||
"style": {},
|
||||
"received_time": {},
|
||||
"out_channel": {},
|
||||
"out_htlc_id": {},
|
||||
"fee": {},
|
||||
"fee_msat": {},
|
||||
"failcode": {},
|
||||
"failreason": {},
|
||||
"out_msatoshi": {},
|
||||
"out_msat": {}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"if": {
|
||||
"properties": {
|
||||
"status": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"local_failed",
|
||||
"failed"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"then": {
|
||||
"additionalProperties": false,
|
||||
"required": [],
|
||||
"properties": {
|
||||
"created_index": {},
|
||||
"updated_index": {},
|
||||
"in_channel": {},
|
||||
"in_htlc_id": {},
|
||||
"in_msatoshi": {},
|
||||
"in_msat": {},
|
||||
"status": {},
|
||||
"style": {},
|
||||
"received_time": {},
|
||||
"out_channel": {},
|
||||
"out_htlc_id": {},
|
||||
"fee": {},
|
||||
"fee_msat": {},
|
||||
"out_msatoshi": {},
|
||||
"out_msat": {},
|
||||
"resolved_time": {},
|
||||
"failcode": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"The numeric onion code returned."
|
||||
]
|
||||
},
|
||||
"failreason": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The name of the onion code returned."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"else": {
|
||||
"additionalProperties": false,
|
||||
"required": [],
|
||||
"properties": {
|
||||
"created_index": {},
|
||||
"updated_index": {},
|
||||
"in_channel": {},
|
||||
"in_htlc_id": {},
|
||||
"in_msatoshi": {},
|
||||
"in_msat": {},
|
||||
"status": {},
|
||||
"style": {},
|
||||
"received_time": {},
|
||||
"out_channel": {},
|
||||
"out_htlc_id": {},
|
||||
"fee": {},
|
||||
"fee_msat": {},
|
||||
"out_msatoshi": {},
|
||||
"out_msat": {},
|
||||
"resolved_time": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:listforwards#1",
|
||||
"method": "listforwards",
|
||||
"params": {
|
||||
"status": null,
|
||||
"in_channel": null,
|
||||
"out_channel": null,
|
||||
"index": null,
|
||||
"start": null,
|
||||
"limit": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "example:listforwards#2",
|
||||
"method": "listforwards",
|
||||
"params": {
|
||||
"in_channel": "0x1x2",
|
||||
"out_channel": "0x2x3",
|
||||
"status": "settled"
|
||||
}
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"forwards": [
|
||||
{
|
||||
"created_index": 1,
|
||||
"updated_index": 1,
|
||||
"in_channel": "103x1x0",
|
||||
"in_htlc_id": 0,
|
||||
"out_channel": "104x1x0",
|
||||
"out_htlc_id": 0,
|
||||
"in_msat": 100001001,
|
||||
"out_msat": 100000000,
|
||||
"fee_msat": 1001,
|
||||
"status": "settled",
|
||||
"style": "tlv",
|
||||
"received_time": 1706229285.5934534,
|
||||
"resolved_time": 1706229288.830004
|
||||
},
|
||||
{
|
||||
"created_index": 2,
|
||||
"updated_index": 2,
|
||||
"in_channel": "103x1x0",
|
||||
"in_htlc_id": 1,
|
||||
"out_channel": "105x1x0",
|
||||
"out_htlc_id": 0,
|
||||
"in_msat": 100001001,
|
||||
"out_msat": 100000000,
|
||||
"fee_msat": 1001,
|
||||
"status": "failed",
|
||||
"style": "tlv",
|
||||
"received_time": 1706229290.0289993,
|
||||
"resolved_time": 1706229292.9487684
|
||||
},
|
||||
{
|
||||
"created_index": 3,
|
||||
"updated_index": 3,
|
||||
"in_channel": "103x1x0",
|
||||
"in_htlc_id": 2,
|
||||
"out_channel": "106x1x0",
|
||||
"out_htlc_id": 0,
|
||||
"in_msat": 100001000,
|
||||
"out_msat": 99999999,
|
||||
"fee_msat": 1001,
|
||||
"status": "local_failed",
|
||||
"failcode": 16392,
|
||||
"failreason": "WIRE_PERMANENT_CHANNEL_FAILURE",
|
||||
"style": "tlv",
|
||||
"received_time": 1706229295.3175724
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"forwards": []
|
||||
}
|
||||
],
|
||||
"author": [
|
||||
"Rene Pickhardt <<r.pickhardt@gmail.com>> is mainly responsible."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-autoclean-status(7)",
|
||||
"lightning-getinfo(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
380
doc/schemas/lightning-listfunds.json
Normal file
380
doc/schemas/lightning-listfunds.json
Normal file
|
@ -0,0 +1,380 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"rpc": "listfunds",
|
||||
"title": "Command showing all funds currently managed by the Core Lightning node",
|
||||
"description": [
|
||||
"The **listfunds** RPC command displays all funds available, either in unspent outputs (UTXOs) in the internal wallet or funds locked in currently open channels."
|
||||
],
|
||||
"request": {
|
||||
"required": [],
|
||||
"properties": {
|
||||
"spent": {
|
||||
"type": "boolean",
|
||||
"description": [
|
||||
"If True, then the *outputs* will include spent outputs in addition to the unspent ones."
|
||||
],
|
||||
"default": "False"
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"outputs",
|
||||
"channels"
|
||||
],
|
||||
"properties": {
|
||||
"outputs": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": true,
|
||||
"required": [
|
||||
"txid",
|
||||
"output",
|
||||
"amount_msat",
|
||||
"scriptpubkey",
|
||||
"status",
|
||||
"reserved"
|
||||
],
|
||||
"properties": {
|
||||
"txid": {
|
||||
"type": "txid",
|
||||
"description": [
|
||||
"The ID of the spendable transaction."
|
||||
]
|
||||
},
|
||||
"output": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"The index within *txid*."
|
||||
]
|
||||
},
|
||||
"amount_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"The amount of the output."
|
||||
]
|
||||
},
|
||||
"scriptpubkey": {
|
||||
"type": "hex",
|
||||
"description": [
|
||||
"The scriptPubkey of the output."
|
||||
]
|
||||
},
|
||||
"address": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The bitcoin address of the output."
|
||||
]
|
||||
},
|
||||
"redeemscript": {
|
||||
"type": "hex",
|
||||
"description": [
|
||||
"The redeemscript, only if it's p2sh-wrapped."
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"unconfirmed",
|
||||
"confirmed",
|
||||
"spent",
|
||||
"immature"
|
||||
]
|
||||
},
|
||||
"reserved": {
|
||||
"type": "boolean",
|
||||
"description": [
|
||||
"Whether this UTXO is currently reserved for an in-flight tx."
|
||||
]
|
||||
}
|
||||
},
|
||||
"allOf": [
|
||||
{
|
||||
"if": {
|
||||
"properties": {
|
||||
"status": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"confirmed"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"then": {
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"blockheight"
|
||||
],
|
||||
"properties": {
|
||||
"txid": {},
|
||||
"output": {},
|
||||
"amount_msat": {},
|
||||
"scriptpubkey": {},
|
||||
"address": {},
|
||||
"value": {},
|
||||
"redeemscript": {},
|
||||
"status": {},
|
||||
"reserved": {},
|
||||
"reserved_to_block": {},
|
||||
"blockheight": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"Block height where it was confirmed."
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"if": {
|
||||
"properties": {
|
||||
"reserved": {
|
||||
"type": "boolean",
|
||||
"enum": [
|
||||
"true"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"then": {
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"reserved_to_block"
|
||||
],
|
||||
"properties": {
|
||||
"txid": {},
|
||||
"output": {},
|
||||
"amount_msat": {},
|
||||
"scriptpubkey": {},
|
||||
"address": {},
|
||||
"value": {},
|
||||
"redeemscript": {},
|
||||
"status": {},
|
||||
"blockheight": {},
|
||||
"reserved": {},
|
||||
"reserved_to_block": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"Block height where reservation will expire."
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"channels": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": true,
|
||||
"required": [
|
||||
"peer_id",
|
||||
"our_amount_msat",
|
||||
"amount_msat",
|
||||
"funding_txid",
|
||||
"funding_output",
|
||||
"connected",
|
||||
"state",
|
||||
"channel_id"
|
||||
],
|
||||
"properties": {
|
||||
"peer_id": {
|
||||
"type": "pubkey",
|
||||
"description": [
|
||||
"The peer with which the channel is opened."
|
||||
]
|
||||
},
|
||||
"our_amount_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"Available satoshis on our node's end of the channel."
|
||||
]
|
||||
},
|
||||
"amount_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"Total channel value."
|
||||
]
|
||||
},
|
||||
"funding_txid": {
|
||||
"type": "txid",
|
||||
"description": [
|
||||
"Funding transaction id."
|
||||
]
|
||||
},
|
||||
"funding_output": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"The 0-based index of the output in the funding transaction."
|
||||
]
|
||||
},
|
||||
"connected": {
|
||||
"type": "boolean",
|
||||
"description": [
|
||||
"Whether the channel peer is connected."
|
||||
]
|
||||
},
|
||||
"state": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"OPENINGD",
|
||||
"CHANNELD_AWAITING_LOCKIN",
|
||||
"CHANNELD_NORMAL",
|
||||
"CHANNELD_SHUTTING_DOWN",
|
||||
"CLOSINGD_SIGEXCHANGE",
|
||||
"CLOSINGD_COMPLETE",
|
||||
"AWAITING_UNILATERAL",
|
||||
"FUNDING_SPEND_SEEN",
|
||||
"ONCHAIN",
|
||||
"DUALOPEND_OPEN_INIT",
|
||||
"DUALOPEND_AWAITING_LOCKIN",
|
||||
"DUALOPEND_OPEN_COMMITTED",
|
||||
"DUALOPEND_OPEN_COMMIT_READY"
|
||||
],
|
||||
"description": [
|
||||
"The channel state, in particular `CHANNELD_NORMAL` means the channel can be used normally."
|
||||
]
|
||||
},
|
||||
"channel_id": {
|
||||
"type": "hash",
|
||||
"description": [
|
||||
"The full channel_id (funding txid Xored with output number)."
|
||||
],
|
||||
"added": "v23.05"
|
||||
}
|
||||
},
|
||||
"allOf": [
|
||||
{
|
||||
"if": {
|
||||
"properties": {
|
||||
"state": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"CHANNELD_NORMAL"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"then": {
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"short_channel_id"
|
||||
],
|
||||
"properties": {
|
||||
"peer_id": {},
|
||||
"our_amount_msat": {},
|
||||
"channel_sat": {},
|
||||
"amount_msat": {},
|
||||
"channel_total_sat": {},
|
||||
"funding_txid": {},
|
||||
"funding_output": {},
|
||||
"connected": {},
|
||||
"state": {},
|
||||
"channel_id": {},
|
||||
"short_channel_id": {
|
||||
"type": "short_channel_id",
|
||||
"description": [
|
||||
"Short channel id of channel."
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"if": {
|
||||
"properties": {
|
||||
"state": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"CHANNELD_SHUTTING_DOWN",
|
||||
"CLOSINGD_SIGEXCHANGE",
|
||||
"CLOSINGD_COMPLETE",
|
||||
"AWAITING_UNILATERAL",
|
||||
"FUNDING_SPEND_SEEN",
|
||||
"ONCHAIN"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"then": {
|
||||
"additionalProperties": false,
|
||||
"required": [],
|
||||
"properties": {
|
||||
"peer_id": {},
|
||||
"our_amount_msat": {},
|
||||
"channel_sat": {},
|
||||
"amount_msat": {},
|
||||
"channel_total_sat": {},
|
||||
"funding_txid": {},
|
||||
"funding_output": {},
|
||||
"connected": {},
|
||||
"state": {},
|
||||
"channel_id": {},
|
||||
"short_channel_id": {
|
||||
"type": "short_channel_id",
|
||||
"description": [
|
||||
"Short channel id of channel (only if funding reached lockin depth before closing)."
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:listfunds#1",
|
||||
"method": "listfunds",
|
||||
"params": {
|
||||
"spent": null
|
||||
}
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"outputs": [
|
||||
{
|
||||
"txid": "0f184b101569bf777af3449fa266948a9d55768f97867e48416a2c92858dd1bc",
|
||||
"output": 1,
|
||||
"amount_msat": 1111111000,
|
||||
"scriptpubkey": "001401fad90abcd66697e2592164722de4a95ebee165",
|
||||
"address": "bcrt1qq8adjz4u6enf0cjey9j8yt0y490tact93fzgsf",
|
||||
"status": "confirmed",
|
||||
"blockheight": 102,
|
||||
"reserved": false
|
||||
},
|
||||
{
|
||||
"txid": "4bee7dc3a28f2434e9bb3e9aaab418dd276485a8705b0f787bf741d3f979ec3b",
|
||||
"output": 1,
|
||||
"amount_msat": 1111111000,
|
||||
"scriptpubkey": "001401fad90abcd66697e2592164722de4a95ebee165",
|
||||
"address": "bcrt1qq8adjz4u6enf0cjey9j8yt0y490tact93fzgsf",
|
||||
"status": "confirmed",
|
||||
"blockheight": 102,
|
||||
"reserved": false
|
||||
}
|
||||
],
|
||||
"channels": []
|
||||
}
|
||||
],
|
||||
"author": [
|
||||
"Felix <<fixone@gmail.com>> is mainly responsible."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-newaddr(7)",
|
||||
"lightning-fundchannel(7)",
|
||||
"lightning-withdraw(7)",
|
||||
"lightning-listtransactions(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
257
doc/schemas/lightning-listhtlcs.json
Normal file
257
doc/schemas/lightning-listhtlcs.json
Normal file
|
@ -0,0 +1,257 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"rpc": "listhtlcs",
|
||||
"title": "Command for querying HTLCs",
|
||||
"description": [
|
||||
"The **listhtlcs** RPC command gets all HTLCs (which, generally, we remember for as long as a channel is open, even if they've completed long ago)."
|
||||
],
|
||||
"request": {
|
||||
"required": [],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"A short channel id (e.g. 1x2x3) or full 64-byte hex channel id, it will only list htlcs for that channel (which must be known)."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"htlcs"
|
||||
],
|
||||
"properties": {
|
||||
"htlcs": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"short_channel_id",
|
||||
"id",
|
||||
"expiry",
|
||||
"direction",
|
||||
"amount_msat",
|
||||
"payment_hash",
|
||||
"state"
|
||||
],
|
||||
"properties": {
|
||||
"short_channel_id": {
|
||||
"type": "short_channel_id",
|
||||
"description": [
|
||||
"The channel that contains/contained the HTLC."
|
||||
]
|
||||
},
|
||||
"id": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"The unique, incrementing HTLC id the creator gave this."
|
||||
]
|
||||
},
|
||||
"expiry": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"The block number where this HTLC expires/expired."
|
||||
]
|
||||
},
|
||||
"amount_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"The value of the HTLC."
|
||||
]
|
||||
},
|
||||
"direction": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"out",
|
||||
"in"
|
||||
],
|
||||
"description": [
|
||||
"Out if we offered this to the peer, in if they offered it."
|
||||
]
|
||||
},
|
||||
"payment_hash": {
|
||||
"type": "hash",
|
||||
"description": [
|
||||
"Payment hash sought by HTLC."
|
||||
]
|
||||
},
|
||||
"state": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"SENT_ADD_HTLC",
|
||||
"SENT_ADD_COMMIT",
|
||||
"RCVD_ADD_REVOCATION",
|
||||
"RCVD_ADD_ACK_COMMIT",
|
||||
"SENT_ADD_ACK_REVOCATION",
|
||||
"RCVD_REMOVE_HTLC",
|
||||
"RCVD_REMOVE_COMMIT",
|
||||
"SENT_REMOVE_REVOCATION",
|
||||
"SENT_REMOVE_ACK_COMMIT",
|
||||
"RCVD_REMOVE_ACK_REVOCATION",
|
||||
"RCVD_ADD_HTLC",
|
||||
"RCVD_ADD_COMMIT",
|
||||
"SENT_ADD_REVOCATION",
|
||||
"SENT_ADD_ACK_COMMIT",
|
||||
"RCVD_ADD_ACK_REVOCATION",
|
||||
"SENT_REMOVE_HTLC",
|
||||
"SENT_REMOVE_COMMIT",
|
||||
"RCVD_REMOVE_REVOCATION",
|
||||
"RCVD_REMOVE_ACK_COMMIT",
|
||||
"SENT_REMOVE_ACK_REVOCATION"
|
||||
],
|
||||
"description": [
|
||||
"The first 10 states are for `in`, the next 10 are for `out`."
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:listhtlcs#1",
|
||||
"method": "listhtlcs",
|
||||
"params": "{}"
|
||||
},
|
||||
{
|
||||
"id": "example:listhtlcs#2",
|
||||
"method": "listhtlcs",
|
||||
"params": [
|
||||
"103x2x0"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "example:listhtlcs#3",
|
||||
"method": "listhtlcs",
|
||||
"params": [
|
||||
"436c2658eb4f4689b42ff11b8b05f31ba09860d0df7168085e0796cdf40f85e0"
|
||||
]
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"htlcs": [
|
||||
{
|
||||
"short_channel_id": "103x1x0",
|
||||
"id": 0,
|
||||
"expiry": 117,
|
||||
"direction": "out",
|
||||
"amount_msat": 100001001,
|
||||
"payment_hash": "d2668e77c5a2220496e813de36f1fc09ba804b16af4c6bb38299d8a6eb8a5f10",
|
||||
"state": "RCVD_REMOVE_ACK_REVOCATION"
|
||||
},
|
||||
{
|
||||
"short_channel_id": "103x1x0",
|
||||
"id": 1,
|
||||
"expiry": 117,
|
||||
"direction": "out",
|
||||
"amount_msat": 100001001,
|
||||
"payment_hash": "286e08ac8f575f10508d751fcfc93871b4344271967c7b9e5eacb3f3573b8307",
|
||||
"state": "RCVD_REMOVE_ACK_REVOCATION"
|
||||
},
|
||||
{
|
||||
"short_channel_id": "103x1x0",
|
||||
"id": 2,
|
||||
"expiry": 135,
|
||||
"direction": "out",
|
||||
"amount_msat": 100001001,
|
||||
"payment_hash": "3e4baa750ee3dfb934578f041ccb40b87432bf37ec65c9d7bce5ff28fecbd95f",
|
||||
"state": "RCVD_REMOVE_ACK_REVOCATION"
|
||||
},
|
||||
{
|
||||
"short_channel_id": "103x1x0",
|
||||
"id": 3,
|
||||
"expiry": 135,
|
||||
"direction": "out",
|
||||
"amount_msat": 100001001,
|
||||
"payment_hash": "4c3ce32565dc10ef2bd230c32802ce2fe8b007208c0a90757aa289f75c994d49",
|
||||
"state": "SENT_REMOVE_REVOCATION"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"htlcs": [
|
||||
{
|
||||
"short_channel_id": "103x2x0",
|
||||
"id": 0,
|
||||
"expiry": 117,
|
||||
"direction": "out",
|
||||
"amount_msat": 100001001,
|
||||
"payment_hash": "12bb14b1d119e1ae0759e5ff6f1f6653e3fd8f71ea59411500d2871404a47a98",
|
||||
"state": "RCVD_REMOVE_ACK_REVOCATION"
|
||||
},
|
||||
{
|
||||
"short_channel_id": "103x2x0",
|
||||
"id": 1,
|
||||
"expiry": 117,
|
||||
"direction": "out",
|
||||
"amount_msat": 100001001,
|
||||
"payment_hash": "57d950209cc0b4fcc5e3027569232f96cf83ef85314c6b139a5713848d811a66",
|
||||
"state": "RCVD_REMOVE_ACK_REVOCATION"
|
||||
},
|
||||
{
|
||||
"short_channel_id": "103x2x0",
|
||||
"id": 2,
|
||||
"expiry": 135,
|
||||
"direction": "out",
|
||||
"amount_msat": 100001001,
|
||||
"payment_hash": "45ad4654715411a07a0ad6ec3f4bfaa918c90e3d1934b10b1c1c5846523ddd7f",
|
||||
"state": "RCVD_REMOVE_ACK_REVOCATION"
|
||||
},
|
||||
{
|
||||
"short_channel_id": "103x2x0",
|
||||
"id": 3,
|
||||
"expiry": 135,
|
||||
"direction": "out",
|
||||
"amount_msat": 100001001,
|
||||
"payment_hash": "cc0dcd214aa71c62bfba711a0746da821f2cdba1770b11c225920bdde12c931e",
|
||||
"state": "RCVD_REMOVE_ACK_REVOCATION"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"htlcs": [
|
||||
{
|
||||
"short_channel_id": "103x1x0",
|
||||
"id": 0,
|
||||
"expiry": 124,
|
||||
"direction": "out",
|
||||
"amount_msat": 1001,
|
||||
"payment_hash": "2ab653668c8017ff2f36ac36678a8da04e11380bd9580a2926b170523b0c6e3b",
|
||||
"state": "RCVD_REMOVE_ACK_REVOCATION"
|
||||
},
|
||||
{
|
||||
"short_channel_id": "103x1x0",
|
||||
"id": 1,
|
||||
"expiry": 124,
|
||||
"direction": "out",
|
||||
"amount_msat": 2001,
|
||||
"payment_hash": "92f889cb2e48aa28e1e577228b907cdbcc371a2c018e9c8f60fa7036e232cf1d",
|
||||
"state": "RCVD_REMOVE_ACK_REVOCATION"
|
||||
},
|
||||
{
|
||||
"short_channel_id": "103x1x0",
|
||||
"id": 2,
|
||||
"expiry": 128,
|
||||
"direction": "out",
|
||||
"amount_msat": 4001,
|
||||
"payment_hash": "14ef01c9fb12d7dcac288f48ce87b19a7d5c3d5779aaed1e4adcb5c5d0e9fa45",
|
||||
"state": "RCVD_REMOVE_ACK_REVOCATION"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"author": [
|
||||
"Rusty Russell <<rusty@rustcorp.com.au>> is mainly responsible."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-listforwards(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
120
doc/schemas/lightning-listinvoicerequests.json
Normal file
120
doc/schemas/lightning-listinvoicerequests.json
Normal file
|
@ -0,0 +1,120 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"added": "v22.11",
|
||||
"rpc": "listinvoicerequests",
|
||||
"title": "Command for querying invoice_request status",
|
||||
"description": [
|
||||
"The **listinvoicerequests** RPC command gets the status of a specific `invoice_request`, if it exists, or the status of all `invoice_requests` if given no argument."
|
||||
],
|
||||
"request": {
|
||||
"required": [],
|
||||
"properties": {
|
||||
"invreq_id": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"A specific invoice can be queried by providing the `invreq_id`, which is presented by lightning-invoicerequest(7), or can be calculated from a bolt12 invoice."
|
||||
]
|
||||
},
|
||||
"active_only": {
|
||||
"type": "boolean",
|
||||
"description": [
|
||||
"If it is *True* then only active invoice requests are returned."
|
||||
],
|
||||
"default": "*False*"
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"invoicerequests"
|
||||
],
|
||||
"properties": {
|
||||
"invoicerequests": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": true,
|
||||
"required": [
|
||||
"invreq_id",
|
||||
"single_use",
|
||||
"active",
|
||||
"bolt12",
|
||||
"used"
|
||||
],
|
||||
"properties": {
|
||||
"invreq_id": {
|
||||
"type": "hash",
|
||||
"description": [
|
||||
"The SHA256 hash of all invoice_request fields less than 160."
|
||||
]
|
||||
},
|
||||
"active": {
|
||||
"type": "boolean",
|
||||
"description": [
|
||||
"Whether the invoice_request is currently active."
|
||||
]
|
||||
},
|
||||
"single_use": {
|
||||
"type": "boolean",
|
||||
"description": [
|
||||
"Whether the invoice_request will become inactive after we pay an invoice for it."
|
||||
]
|
||||
},
|
||||
"bolt12": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The bolt12 string starting with lnr."
|
||||
]
|
||||
},
|
||||
"used": {
|
||||
"type": "boolean",
|
||||
"description": [
|
||||
"Whether the invoice_request has already been used."
|
||||
]
|
||||
},
|
||||
"label": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The label provided when creating the invoice_request."
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:listinvoicerequests#1",
|
||||
"method": "listinvoicerequests",
|
||||
"params": [
|
||||
"cf0b41d4eb248d975909deb9accf9722b1c86839de80ee8815ce907bbb700a1d"
|
||||
]
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"invoicerequests": [
|
||||
{
|
||||
"invreq_id": "cf0b41d4eb248d975909deb9accf9722b1c86839de80ee8815ce907bbb700a1d",
|
||||
"active": true,
|
||||
"single_use": true,
|
||||
"bolt12": "lnr1qqgx9ag7nmtns87htndlgcfndlq0wzstwd5k6urvv5s8getnw3gzqp3zderpzxstt8927ynqg044h0egcd8n5h3n9g0u0v4h8ncc3yg02gzqta0pqpvzzqnxu3vc68fug904w25y3zpskc8huazwmy34av93h2fjswe3tsp4rrcyps5sf5jwnn2tr3ghn32mdta8jvax62pwzhna8sktmaezl3f4s3zy35gx6dfay7r8zn299uwr7ugpze74zft4m8q3fnk2sr0ljqpve3jq",
|
||||
"used": false
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"author": [
|
||||
"Rusty Russell <<rusty@rustcorp.com.au>> is mainly responsible."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-invoicerequests(7)",
|
||||
"lightning-disableinvoicerequest(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
334
doc/schemas/lightning-listinvoices.json
Normal file
334
doc/schemas/lightning-listinvoices.json
Normal file
|
@ -0,0 +1,334 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"rpc": "listinvoices",
|
||||
"title": "Command for querying invoice status",
|
||||
"description": [
|
||||
"The **listinvoices** RPC command gets the status of a specific invoice, if it exists, or the status of all invoices if given no argument.",
|
||||
"",
|
||||
"Only one of the query parameters can be used from *label*, *invstring*, *payment_hash*, or *offer_id*."
|
||||
],
|
||||
"request": {
|
||||
"required": [],
|
||||
"properties": {
|
||||
"label": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"type": "integer"
|
||||
}
|
||||
],
|
||||
"description": [
|
||||
"A label used a the creation of the invoice to get a specific invoice."
|
||||
]
|
||||
},
|
||||
"invstring": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The string value to query a specific invoice."
|
||||
]
|
||||
},
|
||||
"payment_hash": {
|
||||
"type": "hex",
|
||||
"description": [
|
||||
"A payment_hash of the invoice to get the details of a specific invoice."
|
||||
]
|
||||
},
|
||||
"offer_id": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"A local `offer_id` the invoice was issued for a specific invoice details."
|
||||
]
|
||||
},
|
||||
"index": {
|
||||
"type": "string",
|
||||
"added": "v23.08",
|
||||
"enum": [
|
||||
"created",
|
||||
"updated"
|
||||
],
|
||||
"description": [
|
||||
"If neither *in_channel* nor *out_channel* is specified, it controls ordering."
|
||||
],
|
||||
"default": "`created`"
|
||||
},
|
||||
"start": {
|
||||
"type": "u64",
|
||||
"added": "v23.08",
|
||||
"description": [
|
||||
"If `index` is specified, `start` may be specified to start from that value, which is generally returned from lightning-wait(7)."
|
||||
]
|
||||
},
|
||||
"limit": {
|
||||
"type": "u32",
|
||||
"added": "v23.08",
|
||||
"description": [
|
||||
"If `index` is specified, `limit` can be used to specify the maximum number of entries to return."
|
||||
]
|
||||
}
|
||||
},
|
||||
"dependentUpon": {
|
||||
"index": [
|
||||
"start",
|
||||
"limit"
|
||||
]
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"invoices"
|
||||
],
|
||||
"properties": {
|
||||
"invoices": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": true,
|
||||
"required": [
|
||||
"label",
|
||||
"created_index",
|
||||
"payment_hash",
|
||||
"status",
|
||||
"expires_at"
|
||||
],
|
||||
"properties": {
|
||||
"label": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Unique label supplied at invoice creation."
|
||||
]
|
||||
},
|
||||
"description": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Description used in the invoice."
|
||||
]
|
||||
},
|
||||
"payment_hash": {
|
||||
"type": "hash",
|
||||
"description": [
|
||||
"The hash of the *payment_preimage* which will prove payment."
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"unpaid",
|
||||
"paid",
|
||||
"expired"
|
||||
],
|
||||
"description": [
|
||||
"Whether it's paid, unpaid or unpayable."
|
||||
]
|
||||
},
|
||||
"expires_at": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"UNIX timestamp of when it will become / became unpayable."
|
||||
]
|
||||
},
|
||||
"amount_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"The amount required to pay this invoice."
|
||||
]
|
||||
},
|
||||
"bolt11": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The BOLT11 string (always present unless *bolt12* is)."
|
||||
]
|
||||
},
|
||||
"bolt12": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The BOLT12 string (always present unless *bolt11* is)."
|
||||
]
|
||||
},
|
||||
"local_offer_id": {
|
||||
"type": "hash",
|
||||
"description": [
|
||||
"The *id* of our offer which created this invoice (**experimental-offers** only)."
|
||||
]
|
||||
},
|
||||
"invreq_payer_note": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The optional *invreq_payer_note* from invoice_request which created this invoice (**experimental-offers** only)."
|
||||
]
|
||||
},
|
||||
"created_index": {
|
||||
"type": "u64",
|
||||
"added": "v23.08",
|
||||
"description": [
|
||||
"1-based index indicating order this invoice was created in."
|
||||
]
|
||||
},
|
||||
"updated_index": {
|
||||
"type": "u64",
|
||||
"added": "v23.08",
|
||||
"description": [
|
||||
"1-based index indicating order this invoice was changed (only present if it has changed since creation)."
|
||||
]
|
||||
}
|
||||
},
|
||||
"allOf": [
|
||||
{
|
||||
"if": {
|
||||
"properties": {
|
||||
"status": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"paid"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"then": {
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"pay_index",
|
||||
"amount_received_msat",
|
||||
"paid_at",
|
||||
"payment_preimage"
|
||||
],
|
||||
"properties": {
|
||||
"label": {},
|
||||
"description": {},
|
||||
"payment_hash": {},
|
||||
"status": {},
|
||||
"msatoshi": {},
|
||||
"amount_msat": {},
|
||||
"bolt11": {},
|
||||
"bolt12": {},
|
||||
"local_offer_id": {},
|
||||
"invreq_payer_note": {},
|
||||
"expires_at": {},
|
||||
"created_index": {},
|
||||
"updated_index": {},
|
||||
"pay_index": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"Unique incrementing index for this payment."
|
||||
]
|
||||
},
|
||||
"amount_received_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"The amount actually received (could be slightly greater than *amount_msat*, since clients may overpay)."
|
||||
]
|
||||
},
|
||||
"paid_at": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"UNIX timestamp of when it was paid."
|
||||
]
|
||||
},
|
||||
"paid_outpoint": {
|
||||
"type": "object",
|
||||
"description": [
|
||||
"Outpoint this invoice was paid with."
|
||||
],
|
||||
"added": "v23.11",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"txid",
|
||||
"outnum"
|
||||
],
|
||||
"properties": {
|
||||
"txid": {
|
||||
"added": "v23.11",
|
||||
"type": "txid",
|
||||
"description": [
|
||||
"ID of the transaction that paid the invoice."
|
||||
]
|
||||
},
|
||||
"outnum": {
|
||||
"added": "v23.11",
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"The 0-based output number of the transaction that paid the invoice."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"payment_preimage": {
|
||||
"type": "secret",
|
||||
"description": [
|
||||
"Proof of payment."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"else": {
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"label": {},
|
||||
"description": {},
|
||||
"payment_hash": {},
|
||||
"status": {},
|
||||
"msatoshi": {},
|
||||
"amount_msat": {},
|
||||
"bolt11": {},
|
||||
"bolt12": {},
|
||||
"local_offer_id": {},
|
||||
"invreq_payer_note": {},
|
||||
"created_index": {},
|
||||
"updated_index": {},
|
||||
"expires_at": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:listinvoices#1",
|
||||
"method": "listinvoices",
|
||||
"params": {
|
||||
"label": "xEoCR94SIz6UIRUEkxum",
|
||||
"payment_hash": null,
|
||||
"invstring": null,
|
||||
"offer_id": null,
|
||||
"index": null,
|
||||
"start": null,
|
||||
"limit": null
|
||||
}
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"invoices": [
|
||||
{
|
||||
"label": "xEoCR94SIz6UIRUEkxum",
|
||||
"bolt11": "lnbcrt110u1pjmr5lzsp5sfjyj3xn7ux592k36hmmt4ax98n6lgct22wvj54yck0upcmep63qpp5qu436g855lr40ftdt7csatk5pdvtdzzfmfqluwtvm0fds95jsadqdpq0pzk7s6j8y69xjt6xe25j5j4g44hsatdxqyjw5qcqp99qxpqysgquwma3zrw4cd8e8j4u9uh4gxukaacckse64kx2l9dqv8rvrysdq5r5dt38t9snqj9u5ar07h2exr4fg56wpudkhkk7gtxlyt72ku5fpqqd4fnlk",
|
||||
"payment_hash": "072b1d20f4a7c757a56d5fb10eaed40b58b68849da41fe396cdbd2d81692875a",
|
||||
"amount_msat": 11000000,
|
||||
"status": "unpaid",
|
||||
"description": [
|
||||
"XEoCR94SIz6UIRUEkxum."
|
||||
],
|
||||
"expires_at": 1706757730,
|
||||
"created_index": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"author": [
|
||||
"Rusty Russell <<rusty@rustcorp.com.au>> is mainly responsible."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-waitinvoice(7)",
|
||||
"lightning-delinvoice(7)",
|
||||
"lightning-invoice(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
334
doc/schemas/lightning-listnodes.json
Normal file
334
doc/schemas/lightning-listnodes.json
Normal file
|
@ -0,0 +1,334 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"rpc": "listnodes",
|
||||
"title": "Command to get the list of nodes in the known network.",
|
||||
"description": [
|
||||
"The **listnodes** command returns nodes the node has learned about via gossip messages, or a single one if the node *id* was specified."
|
||||
],
|
||||
"request": {
|
||||
"required": [],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "pubkey",
|
||||
"description": [
|
||||
"The public key of the node to list."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"nodes"
|
||||
],
|
||||
"properties": {
|
||||
"nodes": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": true,
|
||||
"required": [
|
||||
"nodeid"
|
||||
],
|
||||
"properties": {
|
||||
"nodeid": {
|
||||
"type": "pubkey",
|
||||
"description": [
|
||||
"The public key of the node."
|
||||
]
|
||||
},
|
||||
"last_timestamp": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"A node_announcement has been received for this node (UNIX timestamp)."
|
||||
]
|
||||
}
|
||||
},
|
||||
"allOf": [
|
||||
{
|
||||
"if": {
|
||||
"required": [
|
||||
"last_timestamp"
|
||||
]
|
||||
},
|
||||
"then": {
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"nodeid",
|
||||
"last_timestamp",
|
||||
"alias",
|
||||
"color",
|
||||
"features",
|
||||
"addresses"
|
||||
],
|
||||
"properties": {
|
||||
"nodeid": {},
|
||||
"last_timestamp": {},
|
||||
"option_will_fund": {},
|
||||
"alias": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The fun alias this node advertized."
|
||||
],
|
||||
"maxLength": 32
|
||||
},
|
||||
"color": {
|
||||
"type": "hex",
|
||||
"description": [
|
||||
"The favorite RGB color this node advertized."
|
||||
],
|
||||
"minLength": 6,
|
||||
"maxLength": 6
|
||||
},
|
||||
"features": {
|
||||
"type": "hex",
|
||||
"description": [
|
||||
"BOLT #9 features bitmap this node advertized."
|
||||
]
|
||||
},
|
||||
"addresses": {
|
||||
"type": "array",
|
||||
"description": [
|
||||
"The addresses this node advertized."
|
||||
],
|
||||
"items": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"type",
|
||||
"port"
|
||||
],
|
||||
"additionalProperties": true,
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"dns",
|
||||
"ipv4",
|
||||
"ipv6",
|
||||
"torv2",
|
||||
"torv3"
|
||||
],
|
||||
"description": [
|
||||
"Type of connection (until 23.08, `websocket` was also allowed)."
|
||||
]
|
||||
},
|
||||
"port": {
|
||||
"type": "u16",
|
||||
"description": [
|
||||
"Port number."
|
||||
]
|
||||
}
|
||||
},
|
||||
"if": {
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"dns",
|
||||
"ipv4",
|
||||
"ipv6",
|
||||
"torv2",
|
||||
"torv3"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"then": {
|
||||
"required": [
|
||||
"type",
|
||||
"address",
|
||||
"port"
|
||||
],
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"type": {},
|
||||
"port": {},
|
||||
"address": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Address in expected format for **type**."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"else": {
|
||||
"required": [
|
||||
"type",
|
||||
"port"
|
||||
],
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"type": {},
|
||||
"port": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"else": {
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"nodeid": {}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"if": {
|
||||
"required": [
|
||||
"option_will_fund"
|
||||
]
|
||||
},
|
||||
"then": {
|
||||
"additionalProperties": true,
|
||||
"required": [
|
||||
"option_will_fund"
|
||||
],
|
||||
"properties": {
|
||||
"option_will_fund": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"lease_fee_base_msat",
|
||||
"lease_fee_basis",
|
||||
"funding_weight",
|
||||
"channel_fee_max_base_msat",
|
||||
"channel_fee_max_proportional_thousandths",
|
||||
"compact_lease"
|
||||
],
|
||||
"properties": {
|
||||
"lease_fee_base_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"The fixed fee for a lease (whole number of satoshis)."
|
||||
]
|
||||
},
|
||||
"lease_fee_basis": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"The proportional fee in basis points (parts per 10,000) for a lease."
|
||||
]
|
||||
},
|
||||
"funding_weight": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"The onchain weight you'll have to pay for a lease."
|
||||
]
|
||||
},
|
||||
"channel_fee_max_base_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"The maximum base routing fee this node will charge during the lease."
|
||||
]
|
||||
},
|
||||
"channel_fee_max_proportional_thousandths": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"The maximum proportional routing fee this node will charge during the lease (in thousandths, not millionths like channel_update)."
|
||||
]
|
||||
},
|
||||
"compact_lease": {
|
||||
"type": "hex",
|
||||
"description": [
|
||||
"The lease as represented in the node_announcement."
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:listnodes#1",
|
||||
"method": "listnodes",
|
||||
"params": {
|
||||
"id": "02e29856dab8ddd9044c18486e4cab79ec717b490447af2d4831e290e48d57638a"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "example:listnodes#2",
|
||||
"method": "listnodes",
|
||||
"params": {
|
||||
"id": null
|
||||
}
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"nodeid": "02e29856dab8ddd9044c14586e4cab79ec717b490447af2d4831e290e48d58638a",
|
||||
"alias": "some_alias",
|
||||
"color": "68f442",
|
||||
"last_timestamp": 1597213741,
|
||||
"features": "02a2a1",
|
||||
"addresses": [
|
||||
{
|
||||
"type": "ipv4",
|
||||
"address": "zzz.yy.xx.xx",
|
||||
"port": 9735
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"nodeid": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59",
|
||||
"alias": "SILENTARTIST-v23.11-415-gd120eba",
|
||||
"color": "022d22",
|
||||
"last_timestamp": 1708624765,
|
||||
"features": "88a0000a8a5961",
|
||||
"addresses": []
|
||||
},
|
||||
{
|
||||
"nodeid": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518",
|
||||
"alias": "JUNIORBEAM-v23.11-415-gd120eba",
|
||||
"color": "0266e4",
|
||||
"last_timestamp": 1708624765,
|
||||
"features": "88a0000a8a5961",
|
||||
"addresses": []
|
||||
},
|
||||
{
|
||||
"nodeid": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d",
|
||||
"alias": "HOPPINGFIRE-v23.11-415-gd120eba",
|
||||
"color": "035d2b",
|
||||
"last_timestamp": 1708624765,
|
||||
"features": "88a0000a8a5961",
|
||||
"addresses": []
|
||||
},
|
||||
{
|
||||
"nodeid": "0382ce59ebf18be7d84677c2e35f23294b9992ceca95491fcf8a56c6cb2d9de199",
|
||||
"alias": "JUNIORFELONY-v23.11-415-gd120eba",
|
||||
"color": "0382ce",
|
||||
"last_timestamp": 1708624766,
|
||||
"features": "88a0000a8a5961",
|
||||
"addresses": []
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"errors": [
|
||||
"On failure, one of the following error codes may be returned:",
|
||||
"",
|
||||
"- -32602: Error in given parameters."
|
||||
],
|
||||
"author": [
|
||||
"Vincenzo Palazzo <<vincenzo.palazzo@protonmail.com>> wrote the initial version of this man page,",
|
||||
"but many others did the hard work of actually implementing this rpc command."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-listchannels(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
144
doc/schemas/lightning-listoffers.json
Normal file
144
doc/schemas/lightning-listoffers.json
Normal file
|
@ -0,0 +1,144 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"rpc": "listoffers",
|
||||
"title": "Command for listing offers",
|
||||
"warning": "experimental-offers only",
|
||||
"description": [
|
||||
"The **listoffers** RPC command list all offers, or with `offer_id`, only the offer with that offer_id (if it exists)."
|
||||
],
|
||||
"request": {
|
||||
"required": [],
|
||||
"properties": {
|
||||
"offer_id": {
|
||||
"type": "hash",
|
||||
"description": [
|
||||
"Offer_id to get details for (if it exists)."
|
||||
]
|
||||
},
|
||||
"active_only": {
|
||||
"type": "boolean",
|
||||
"description": [
|
||||
"If set and is true, only offers with `active` true are returned."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"offers"
|
||||
],
|
||||
"properties": {
|
||||
"offers": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"offer_id",
|
||||
"active",
|
||||
"single_use",
|
||||
"bolt12",
|
||||
"used"
|
||||
],
|
||||
"properties": {
|
||||
"offer_id": {
|
||||
"type": "hash",
|
||||
"description": [
|
||||
"The id of this offer (merkle hash of non-signature fields)."
|
||||
]
|
||||
},
|
||||
"active": {
|
||||
"type": "boolean",
|
||||
"description": [
|
||||
"Whether this can still be used."
|
||||
]
|
||||
},
|
||||
"single_use": {
|
||||
"type": "boolean",
|
||||
"description": [
|
||||
"Whether this expires as soon as it's paid."
|
||||
]
|
||||
},
|
||||
"bolt12": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The bolt12 encoding of the offer."
|
||||
]
|
||||
},
|
||||
"used": {
|
||||
"type": "boolean",
|
||||
"description": [
|
||||
"True if an associated invoice has been paid."
|
||||
]
|
||||
},
|
||||
"label": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The (optional) user-specified label."
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:listoffers#1",
|
||||
"method": "listoffers",
|
||||
"params": {
|
||||
"active_only": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "example:listoffers#2",
|
||||
"method": "listoffers",
|
||||
"params": [
|
||||
"f61cca153d1948dade19349792d9bcdc9cef687fd27db0b553a67979f55aae48"
|
||||
]
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"offers": [
|
||||
{
|
||||
"offer_id": "053a5c566fbea2681a5ff9c05a913da23e45b95d09ef5bd25d7d408f23da7084",
|
||||
"active": true,
|
||||
"single_use": false,
|
||||
"bolt12": "lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcgqvqcdgq2z9pk7enxv4jjqen0wgs8yatnw3ujz83qkc6rvp4j28rt3dtrn32zkvdy7efhnlrpr5rp5geqxs783wtlj550qs8czzku4nk3pqp6m593qxgunzuqcwkmgqkmp6ty0wyvjcqdguv3pnpukedwn6cr87m89t74h3auyaeg89xkvgzpac70z3m9rn5xzu28c",
|
||||
"used": false
|
||||
},
|
||||
{
|
||||
"offer_id": "3247d3597fec19e362ca683416a48a0f76a44c1600725a7ee1936548feadacca",
|
||||
"active": true,
|
||||
"single_use": false,
|
||||
"bolt12": "lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcxqd24x3qgqgqlgzs3gdhkven9v5sxvmmjype82um50ys3ug9kxsmqdvj3c6ut2cuu2s4nrf8k2dulccgaqcdzxgp583utjlu49rcyqt8hc3s797umxn3r9367rdqc577rma7key58fywkajxnuzyapge86hj2pg80rjrma40xdqrxnsnva5l3ce7hz4ua8wf755dees4y9vnq",
|
||||
"used": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"offers": [
|
||||
{
|
||||
"offer_id": "f61cca153d1948dade19349792d9bcdc9cef687fd27db0b553a67979f55aae48",
|
||||
"active": true,
|
||||
"single_use": false,
|
||||
"bolt12": "lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcgqyqs5rn5v4ehggrxdaezqvtdwdshg93pqfnwgkvdr57yzh6h92zg3qctvrm7w38djg67kzcm4yeg8vc4cq63s",
|
||||
"used": false
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"author": [
|
||||
"Rusty Russell <<rusty@rustcorp.com.au>> is mainly responsible."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-offer(7)",
|
||||
"lightning-listoffers(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
272
doc/schemas/lightning-listpays.json
Normal file
272
doc/schemas/lightning-listpays.json
Normal file
|
@ -0,0 +1,272 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"rpc": "listpays",
|
||||
"title": "Command for querying payment status",
|
||||
"description": [
|
||||
"The **listpay** RPC command gets the status of all *pay* commands, or a single one if either *bolt11* or *payment_hash* was specified."
|
||||
],
|
||||
"request": {
|
||||
"required": [],
|
||||
"properties": {
|
||||
"bolt11": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Bolt11 string to get the payment details."
|
||||
]
|
||||
},
|
||||
"payment_hash": {
|
||||
"type": "hash",
|
||||
"description": [
|
||||
"Payment hash to get the payment details."
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"To filter the payment by status."
|
||||
],
|
||||
"enum": [
|
||||
"pending",
|
||||
"complete",
|
||||
"failed"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"pays"
|
||||
],
|
||||
"properties": {
|
||||
"pays": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": true,
|
||||
"required": [
|
||||
"payment_hash",
|
||||
"status",
|
||||
"created_at"
|
||||
],
|
||||
"properties": {
|
||||
"payment_hash": {
|
||||
"type": "hash",
|
||||
"description": [
|
||||
"The hash of the *payment_preimage* which will prove payment."
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"pending",
|
||||
"failed",
|
||||
"complete"
|
||||
],
|
||||
"description": [
|
||||
"Status of the payment."
|
||||
]
|
||||
},
|
||||
"destination": {
|
||||
"type": "pubkey",
|
||||
"description": [
|
||||
"The final destination of the payment if known."
|
||||
]
|
||||
},
|
||||
"created_at": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"The UNIX timestamp showing when this payment was initiated."
|
||||
]
|
||||
},
|
||||
"completed_at": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"The UNIX timestamp showing when this payment was completed."
|
||||
]
|
||||
},
|
||||
"label": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The label, if given to sendpay."
|
||||
]
|
||||
},
|
||||
"bolt11": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The bolt11 string (if pay supplied one)."
|
||||
]
|
||||
},
|
||||
"description": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The description matching the bolt11 description hash (if pay supplied one)."
|
||||
]
|
||||
},
|
||||
"bolt12": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The bolt12 string (if supplied for pay: **experimental-offers** only)."
|
||||
]
|
||||
}
|
||||
},
|
||||
"allOf": [
|
||||
{
|
||||
"if": {
|
||||
"properties": {
|
||||
"status": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"complete"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"then": {
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"amount_sent_msat",
|
||||
"preimage"
|
||||
],
|
||||
"properties": {
|
||||
"payment_hash": {},
|
||||
"status": {},
|
||||
"destination": {},
|
||||
"created_at": {},
|
||||
"completed_at": {},
|
||||
"label": {},
|
||||
"bolt11": {},
|
||||
"description": {},
|
||||
"bolt12": {},
|
||||
"amount_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"The amount of millisatoshi we intended to send to the destination."
|
||||
]
|
||||
},
|
||||
"amount_sent_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"The amount of millisatoshi we sent in order to pay (may include fees and not match amount_msat)."
|
||||
]
|
||||
},
|
||||
"preimage": {
|
||||
"type": "secret",
|
||||
"description": [
|
||||
"Proof of payment."
|
||||
]
|
||||
},
|
||||
"number_of_parts": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"The number of parts for a successful payment (only if more than one)."
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"if": {
|
||||
"properties": {
|
||||
"status": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"failed"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"then": {
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"amount_sent_msat"
|
||||
],
|
||||
"properties": {
|
||||
"payment_hash": {},
|
||||
"status": {},
|
||||
"destination": {},
|
||||
"created_at": {},
|
||||
"label": {},
|
||||
"bolt11": {},
|
||||
"description": {},
|
||||
"bolt12": {},
|
||||
"amount_sent_msat": {},
|
||||
"erroronion": {
|
||||
"type": "hex",
|
||||
"description": [
|
||||
"The error onion returned on failure, if any."
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"post_return_value_notes": [
|
||||
"The returned array is ordered by increasing **created_at** fields."
|
||||
]
|
||||
},
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:listpays#1",
|
||||
"method": "listpays",
|
||||
"params": {
|
||||
"bolt11": "lnbcrt123n1pjmxp7qsp5hxu7u28y0nx4v689u3hwzdzse2w9yaylhheavf9dxvwtdup7pvespp5ha66gxse68j4n6755v7299dnmq4w34gp0znxu0xzahdc43zrg40qdq5v3jhxcmjd9c8g6t0dc6sxqrp7scqp9rzjqgkjyd3q5dv6gllh77kygly9c3kfy0d9xwyjyxsq2nq3c83u5vw4jqqqvuqqqqsqqqqqqqqpqqqqqzsqqc9qxpqysgqk74dvqlvr92ayy5s7x0r0u9xywez6wu4h8pfta386cw6x7cdrvn8pz87kyg5c930aent423gm9ylpaw5p35k72f02hg0s9dulg4d8fqpgj7gpm",
|
||||
"payment_hash": null,
|
||||
"status": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "example:listpays#2",
|
||||
"method": "listpays",
|
||||
"params": {
|
||||
"bolt11": "lnbcrt123n1pjmxp7qsp5u84368dz7yhzcqm955h96wdqch7uarasun45cr0vs5d8t0cv5avqpp5r9p0dp92guaatrmhf302m0dyj4n79gk93qu2l5tagfxq3dedgfqsdq5v3jhxcmjd9c8g6t0dc6qxqrp7scqp9rzjqgkjyd3q5dv6gllh77kygly9c3kfy0d9xwyjyxsq2nq3c83u5vw4jqqqvuqqqqsqqqqqqqqpqqqqqzsqqc9qxpqysgq46wu0fznfx27rcnyzhcttf8yqx3lwqs482yxlead0fyt8mefrrrj5m379fa5qukgquf9tnwsuj3nnfmwkzkfg6pyhzq6w8gauuh6m5cqgur64n",
|
||||
"payment_hash": null,
|
||||
"status": null
|
||||
}
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"pays": [
|
||||
{
|
||||
"bolt11": "lnbcrt123n1pjmxp7qsp5hxu7u28y0nx4v689u3hwzdzse2w9yaylhheavf9dxvwtdup7pvespp5ha66gxse68j4n6755v7299dnmq4w34gp0znxu0xzahdc43zrg40qdq5v3jhxcmjd9c8g6t0dc6sxqrp7scqp9rzjqgkjyd3q5dv6gllh77kygly9c3kfy0d9xwyjyxsq2nq3c83u5vw4jqqqvuqqqqsqqqqqqqqpqqqqqzsqqc9qxpqysgqk74dvqlvr92ayy5s7x0r0u9xywez6wu4h8pfta386cw6x7cdrvn8pz87kyg5c930aent423gm9ylpaw5p35k72f02hg0s9dulg4d8fqpgj7gpm",
|
||||
"destination": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d",
|
||||
"payment_hash": "bf75a41a19d1e559ebd4a33ca295b3d82ae8d50178a66e3cc2eddb8ac443455e",
|
||||
"status": "failed",
|
||||
"created_at": 1706231854,
|
||||
"amount_sent_msat": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"pays": [
|
||||
{
|
||||
"bolt11": "lnbcrt123n1pjmxp7qsp5u84368dz7yhzcqm955h96wdqch7uarasun45cr0vs5d8t0cv5avqpp5r9p0dp92guaatrmhf302m0dyj4n79gk93qu2l5tagfxq3dedgfqsdq5v3jhxcmjd9c8g6t0dc6qxqrp7scqp9rzjqgkjyd3q5dv6gllh77kygly9c3kfy0d9xwyjyxsq2nq3c83u5vw4jqqqvuqqqqsqqqqqqqqpqqqqqzsqqc9qxpqysgq46wu0fznfx27rcnyzhcttf8yqx3lwqs482yxlead0fyt8mefrrrj5m379fa5qukgquf9tnwsuj3nnfmwkzkfg6pyhzq6w8gauuh6m5cqgur64n",
|
||||
"destination": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d",
|
||||
"payment_hash": "1942f684aa473bd58f774c5eadbda49567e2a2c58838afd17d424c08b72d4241",
|
||||
"status": "complete",
|
||||
"created_at": 1706231849,
|
||||
"completed_at": 1706231854,
|
||||
"preimage": "89ce412a2089cbcb72a73ce755337cf693859ea58f21ef0d1caf286a9b0f2a7c",
|
||||
"amount_msat": 12300,
|
||||
"amount_sent_msat": 12301
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"author": [
|
||||
"Rusty Russell <<rusty@rustcorp.com.au>> is mainly responsible."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-pay(7)",
|
||||
"lightning-paystatus(7)",
|
||||
"lightning-listsendpays(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
1605
doc/schemas/lightning-listpeerchannels.json
Normal file
1605
doc/schemas/lightning-listpeerchannels.json
Normal file
File diff suppressed because it is too large
Load diff
1448
doc/schemas/lightning-listpeers.json
Normal file
1448
doc/schemas/lightning-listpeers.json
Normal file
File diff suppressed because it is too large
Load diff
411
doc/schemas/lightning-listsendpays.json
Normal file
411
doc/schemas/lightning-listsendpays.json
Normal file
|
@ -0,0 +1,411 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"rpc": "listsendpays",
|
||||
"title": "Low-level command for querying sendpay status",
|
||||
"description": [
|
||||
"The **listsendpays** RPC command gets the status of all *sendpay* commands (which is also used by the *pay* command), or with *bolt11* or *payment_hash* limits results to that specific payment. You cannot specify both. It is possible to filter the payments also by *status*.",
|
||||
"",
|
||||
"Note that there may be more than one concurrent *sendpay* command per *pay*, so this command should be used with caution."
|
||||
],
|
||||
"request": {
|
||||
"required": [],
|
||||
"properties": {
|
||||
"bolt11": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Bolt11 invoice."
|
||||
]
|
||||
},
|
||||
"payment_hash": {
|
||||
"type": "hash",
|
||||
"description": [
|
||||
"The hash of the payment_preimage."
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"pending",
|
||||
"complete",
|
||||
"failed"
|
||||
],
|
||||
"description": [
|
||||
"Whether the invoice has been paid, pending, or failed."
|
||||
]
|
||||
},
|
||||
"index": {
|
||||
"type": "string",
|
||||
"added": "v23.11",
|
||||
"enum": [
|
||||
"created",
|
||||
"updated"
|
||||
],
|
||||
"description": [
|
||||
"If neither bolt11 or payment_hash is specified, `index` controls ordering, by `created` (default) or `updated`."
|
||||
]
|
||||
},
|
||||
"start": {
|
||||
"type": "u64",
|
||||
"added": "v23.11",
|
||||
"description": [
|
||||
"If `index` is specified, `start` may be specified to start from that value, which is generally returned from lightning-wait(7)."
|
||||
]
|
||||
},
|
||||
"limit": {
|
||||
"type": "u32",
|
||||
"added": "v23.11",
|
||||
"description": [
|
||||
"If `index` is specified, `limit` can be used to specify the maximum number of entries to return."
|
||||
]
|
||||
}
|
||||
},
|
||||
"dependentUpon": {
|
||||
"index": [
|
||||
"start",
|
||||
"limit"
|
||||
]
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"payments"
|
||||
],
|
||||
"properties": {
|
||||
"payments": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": true,
|
||||
"required": [
|
||||
"id",
|
||||
"created_index",
|
||||
"payment_hash",
|
||||
"status",
|
||||
"groupid",
|
||||
"created_at",
|
||||
"amount_sent_msat"
|
||||
],
|
||||
"properties": {
|
||||
"created_index": {
|
||||
"added": "v23.11",
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"1-based index indicating order this payment was created in."
|
||||
]
|
||||
},
|
||||
"id": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"Old synonym for created_index."
|
||||
]
|
||||
},
|
||||
"groupid": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"Grouping key to disambiguate multiple attempts to pay an invoice or the same payment_hash."
|
||||
]
|
||||
},
|
||||
"partid": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"Part number (for multiple parts to a single payment)."
|
||||
]
|
||||
},
|
||||
"payment_hash": {
|
||||
"type": "hash",
|
||||
"description": [
|
||||
"The hash of the *payment_preimage* which will prove payment."
|
||||
]
|
||||
},
|
||||
"updated_index": {
|
||||
"added": "v23.11",
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"1-based index indicating order this payment was changed (only present if it has changed since creation)."
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"pending",
|
||||
"failed",
|
||||
"complete"
|
||||
],
|
||||
"description": [
|
||||
"Status of the payment."
|
||||
]
|
||||
},
|
||||
"amount_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"The amount delivered to destination (if known)."
|
||||
]
|
||||
},
|
||||
"destination": {
|
||||
"type": "pubkey",
|
||||
"description": [
|
||||
"The final destination of the payment if known."
|
||||
]
|
||||
},
|
||||
"created_at": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"The UNIX timestamp showing when this payment was initiated."
|
||||
]
|
||||
},
|
||||
"amount_sent_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"The amount sent."
|
||||
]
|
||||
},
|
||||
"label": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The label, if given to sendpay."
|
||||
]
|
||||
},
|
||||
"bolt11": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The bolt11 string (if pay supplied one)."
|
||||
]
|
||||
},
|
||||
"description": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The description matching the bolt11 description hash (if pay supplied one)."
|
||||
]
|
||||
},
|
||||
"bolt12": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The bolt12 string (if supplied for pay: **experimental-offers** only)."
|
||||
]
|
||||
}
|
||||
},
|
||||
"allOf": [
|
||||
{
|
||||
"if": {
|
||||
"properties": {
|
||||
"status": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"complete"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"then": {
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"payment_preimage"
|
||||
],
|
||||
"properties": {
|
||||
"id": {},
|
||||
"created_index": {},
|
||||
"updated_index": {},
|
||||
"partid": {},
|
||||
"groupid": {},
|
||||
"payment_hash": {},
|
||||
"status": {},
|
||||
"msatoshi": {},
|
||||
"amount_msat": {},
|
||||
"destination": {},
|
||||
"created_at": {},
|
||||
"msatoshi_sent": {},
|
||||
"amount_sent_msat": {},
|
||||
"label": {},
|
||||
"bolt11": {},
|
||||
"description": {},
|
||||
"bolt12": {},
|
||||
"completed_at": {
|
||||
"type": "u64",
|
||||
"added": "pre-v0.10.1",
|
||||
"description": [
|
||||
"The UNIX timestamp showing when this payment was completed."
|
||||
]
|
||||
},
|
||||
"payment_preimage": {
|
||||
"type": "secret",
|
||||
"description": [
|
||||
"The proof of payment: SHA256 of this **payment_hash**."
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"if": {
|
||||
"properties": {
|
||||
"status": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"failed"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"then": {
|
||||
"additionalProperties": false,
|
||||
"required": [],
|
||||
"properties": {
|
||||
"id": {},
|
||||
"created_index": {},
|
||||
"updated_index": {},
|
||||
"partid": {},
|
||||
"groupid": {},
|
||||
"payment_hash": {},
|
||||
"status": {},
|
||||
"msatoshi": {},
|
||||
"amount_msat": {},
|
||||
"destination": {},
|
||||
"created_at": {},
|
||||
"completed_at": {},
|
||||
"msatoshi_sent": {},
|
||||
"amount_sent_msat": {},
|
||||
"label": {},
|
||||
"bolt11": {},
|
||||
"description": {},
|
||||
"bolt12": {},
|
||||
"erroronion": {
|
||||
"type": "hex",
|
||||
"description": [
|
||||
"The onion message returned."
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"if": {
|
||||
"properties": {
|
||||
"status": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"pending"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"then": {
|
||||
"additionalProperties": false,
|
||||
"required": [],
|
||||
"properties": {
|
||||
"id": {},
|
||||
"created_index": {},
|
||||
"updated_index": {},
|
||||
"partid": {},
|
||||
"groupid": {},
|
||||
"payment_hash": {},
|
||||
"status": {},
|
||||
"msatoshi": {},
|
||||
"amount_msat": {},
|
||||
"destination": {},
|
||||
"created_at": {},
|
||||
"msatoshi_sent": {},
|
||||
"amount_sent_msat": {},
|
||||
"label": {},
|
||||
"bolt11": {},
|
||||
"description": {},
|
||||
"bolt12": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"pre_return_value_notes": [
|
||||
"Note that the returned array is ordered by increasing *id*."
|
||||
]
|
||||
},
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:listsendpays#1",
|
||||
"method": "listsendpays",
|
||||
"params": {
|
||||
"bolt11": null,
|
||||
"payment_hash": null,
|
||||
"status": null,
|
||||
"index": null,
|
||||
"start": null,
|
||||
"limit": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "example:listsendpays#2",
|
||||
"method": "listsendpays",
|
||||
"params": {
|
||||
"bolt11": "lnbcrt1230n1pja03q9sp5xu9aypccf3n6vld2waxcysy47ct2wl5x5adtm7k8u30knqes22lspp5duw2v8csh0zh4xg9ql3amem98avlkc2ecre99tgmr2340amf9kmsdqjv3jhxcmjd9c8g6t0dcxqyjw5qcqp99qxpqysgqwh78s8wqg0kepspw0epcxmxteh5wu8n6ddlwdnyj758fqxpqk8ejf597x8ju3r32xqgae3yzjjz9e5s6l2vs5zxvkayhmemmx74wvyqqyqf8c9",
|
||||
"payment_hash": null,
|
||||
"status": null,
|
||||
"index": null,
|
||||
"start": null,
|
||||
"limit": null
|
||||
}
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"payments": [
|
||||
{
|
||||
"created_index": 1,
|
||||
"id": 1,
|
||||
"payment_hash": "e3b43574acd074b0c4ba1b13b5155ff5f9c76742e643ed003e17301c5a2db149",
|
||||
"groupid": 1,
|
||||
"destination": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59",
|
||||
"amount_msat": 20000,
|
||||
"amount_sent_msat": 20000,
|
||||
"created_at": 1706225269,
|
||||
"status": "pending",
|
||||
"bolt11": "lnbcrt200n1pjm9mn5sp5gq84lgga959m6gg4g0kj29ypwjaxxnm4cu5csymq8p6nqxv800mspp5uw6r2a9v6p6tp396rvfm292l7huuwe6zuep76qp7zucpck3dk9ysdpqf9grgmt62fmk5stswefh23n2tpykvcmzxqyjw5qcqp99qxpqysgqz8s496zmwed278jvp075zlhrnj0ncg45kcfw5s2lkhtxd3wc39f8wflp5gmd827dk470xpasfpx0azsfu0k8ttwae7620h8d050w28cqan776g"
|
||||
},
|
||||
{
|
||||
"created_index": 2,
|
||||
"id": 2,
|
||||
"payment_hash": "f55d92cfe019b5a015f5e5956e9255053cda14786171d5002feb12ae5254e5a5",
|
||||
"groupid": 1,
|
||||
"destination": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59",
|
||||
"amount_msat": 30000,
|
||||
"amount_sent_msat": 30000,
|
||||
"created_at": 1706225269,
|
||||
"status": "pending",
|
||||
"bolt11": "lnbcrt300n1pjm9mn5sp5zqfkr93rp92mdyj6m8lzpcu90rfefcaqff8fxdd2sc5mace23ujspp574we9nlqrx66q904uk2kayj4q57d59rcv9ca2qp0avf2u5j5ukjsdpq29j55nfcgfcnsvzw2er57knhwcmhzwt0xqyjw5qcqp99qxpqysgq76p2jpnegtzlxmn0aqt6d3f89q4p6y5v3v2qz7t2mm6xt90nt324cq400tl82k28562aux8jxs57d603g7s0q4g3dapu9a7vln94j7spsut799"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"payments": [
|
||||
{
|
||||
"created_index": 1,
|
||||
"id": 1,
|
||||
"payment_hash": "6f1ca61f10bbc57a990507e3dde7653f59fb6159c0f252ad1b1aa357f7692db7",
|
||||
"groupid": 1,
|
||||
"updated_index": 1,
|
||||
"destination": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59",
|
||||
"amount_msat": 123000,
|
||||
"amount_sent_msat": 123000,
|
||||
"created_at": 1708639237,
|
||||
"completed_at": 1708639238,
|
||||
"status": "complete",
|
||||
"payment_preimage": "91f8366681fdfd309c048082fcde81a79116f85a7b2dd09aef1e34f5f7c3397b",
|
||||
"bolt11": "lnbcrt1230n1pja03q9sp5xu9aypccf3n6vld2waxcysy47ct2wl5x5adtm7k8u30knqes22lspp5duw2v8csh0zh4xg9ql3amem98avlkc2ecre99tgmr2340amf9kmsdqjv3jhxcmjd9c8g6t0dcxqyjw5qcqp99qxpqysgqwh78s8wqg0kepspw0epcxmxteh5wu8n6ddlwdnyj758fqxpqk8ejf597x8ju3r32xqgae3yzjjz9e5s6l2vs5zxvkayhmemmx74wvyqqyqf8c9"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"author": [
|
||||
"Christian Decker <<decker.christian@gmail.com>> is mainly responsible."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-listpays(7)",
|
||||
"lightning-sendpay(7)",
|
||||
"lightning-listinvoice(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
277
doc/schemas/lightning-listsqlschemas.json
Normal file
277
doc/schemas/lightning-listsqlschemas.json
Normal file
|
@ -0,0 +1,277 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"added": "v23.02",
|
||||
"rpc": "listsqlschemas",
|
||||
"title": "Command to example lightning-sql schemas",
|
||||
"description": [
|
||||
"This allows you to examine the schemas at runtime; while they are fully documented for the current release in lightning-sql(7), as fields are added or deprecated, you can use this command to determine what fields are present.",
|
||||
"",
|
||||
"If *table* is given, only that table is in the resulting list, otherwise all tables are listed."
|
||||
],
|
||||
"request": {
|
||||
"required": [],
|
||||
"properties": {
|
||||
"table": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"schemas"
|
||||
],
|
||||
"properties": {
|
||||
"schemas": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"tablename",
|
||||
"columns"
|
||||
],
|
||||
"properties": {
|
||||
"tablename": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The name of the table."
|
||||
]
|
||||
},
|
||||
"columns": {
|
||||
"type": "array",
|
||||
"description": [
|
||||
"The columns, in database order."
|
||||
],
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"name",
|
||||
"type"
|
||||
],
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The name of the column."
|
||||
]
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"INTEGER",
|
||||
"BLOB",
|
||||
"TEXT",
|
||||
"REAL"
|
||||
],
|
||||
"description": [
|
||||
"The SQL type of the column."
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"indices": {
|
||||
"type": "array",
|
||||
"description": [
|
||||
"Any index we created to speed lookups."
|
||||
],
|
||||
"items": {
|
||||
"type": "array",
|
||||
"description": [
|
||||
"The columns for this index."
|
||||
],
|
||||
"items": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The column name."
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:listsqlschemas#1",
|
||||
"method": "listsqlschemas",
|
||||
"params": {
|
||||
"table": "offers"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "example:listsqlschemas#2",
|
||||
"method": "listsqlschemas",
|
||||
"params": [
|
||||
"closedchannels"
|
||||
]
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"schemas": [
|
||||
{
|
||||
"tablename": "offers",
|
||||
"columns": [
|
||||
{
|
||||
"name": "offer_id",
|
||||
"type": "BLOB"
|
||||
},
|
||||
{
|
||||
"name": "active",
|
||||
"type": "INTEGER"
|
||||
},
|
||||
{
|
||||
"name": "single_use",
|
||||
"type": "INTEGER"
|
||||
},
|
||||
{
|
||||
"name": "bolt12",
|
||||
"type": "TEXT"
|
||||
},
|
||||
{
|
||||
"name": "bolt12_unsigned",
|
||||
"type": "TEXT"
|
||||
},
|
||||
{
|
||||
"name": "used",
|
||||
"type": "INTEGER"
|
||||
},
|
||||
{
|
||||
"name": "label",
|
||||
"type": "TEXT"
|
||||
}
|
||||
],
|
||||
"indices": [
|
||||
[
|
||||
"offer_id"
|
||||
]
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"schemas": [
|
||||
{
|
||||
"tablename": "closedchannels",
|
||||
"columns": [
|
||||
{
|
||||
"name": "rowid",
|
||||
"type": "INTEGER"
|
||||
},
|
||||
{
|
||||
"name": "peer_id",
|
||||
"type": "BLOB"
|
||||
},
|
||||
{
|
||||
"name": "channel_id",
|
||||
"type": "BLOB"
|
||||
},
|
||||
{
|
||||
"name": "short_channel_id",
|
||||
"type": "TEXT"
|
||||
},
|
||||
{
|
||||
"name": "alias_local",
|
||||
"type": "TEXT"
|
||||
},
|
||||
{
|
||||
"name": "alias_remote",
|
||||
"type": "TEXT"
|
||||
},
|
||||
{
|
||||
"name": "opener",
|
||||
"type": "TEXT"
|
||||
},
|
||||
{
|
||||
"name": "closer",
|
||||
"type": "TEXT"
|
||||
},
|
||||
{
|
||||
"name": "private",
|
||||
"type": "INTEGER"
|
||||
},
|
||||
{
|
||||
"name": "total_local_commitments",
|
||||
"type": "INTEGER"
|
||||
},
|
||||
{
|
||||
"name": "total_remote_commitments",
|
||||
"type": "INTEGER"
|
||||
},
|
||||
{
|
||||
"name": "total_htlcs_sent",
|
||||
"type": "INTEGER"
|
||||
},
|
||||
{
|
||||
"name": "funding_txid",
|
||||
"type": "BLOB"
|
||||
},
|
||||
{
|
||||
"name": "funding_outnum",
|
||||
"type": "INTEGER"
|
||||
},
|
||||
{
|
||||
"name": "leased",
|
||||
"type": "INTEGER"
|
||||
},
|
||||
{
|
||||
"name": "funding_fee_paid_msat",
|
||||
"type": "INTEGER"
|
||||
},
|
||||
{
|
||||
"name": "funding_fee_rcvd_msat",
|
||||
"type": "INTEGER"
|
||||
},
|
||||
{
|
||||
"name": "funding_pushed_msat",
|
||||
"type": "INTEGER"
|
||||
},
|
||||
{
|
||||
"name": "total_msat",
|
||||
"type": "INTEGER"
|
||||
},
|
||||
{
|
||||
"name": "final_to_us_msat",
|
||||
"type": "INTEGER"
|
||||
},
|
||||
{
|
||||
"name": "min_to_us_msat",
|
||||
"type": "INTEGER"
|
||||
},
|
||||
{
|
||||
"name": "max_to_us_msat",
|
||||
"type": "INTEGER"
|
||||
},
|
||||
{
|
||||
"name": "last_commitment_txid",
|
||||
"type": "BLOB"
|
||||
},
|
||||
{
|
||||
"name": "last_commitment_fee_msat",
|
||||
"type": "INTEGER"
|
||||
},
|
||||
{
|
||||
"name": "close_cause",
|
||||
"type": "TEXT"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"author": [
|
||||
"Rusty Russell <<rusty@rustcorp.com.au>> is mainly responsible."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-sql(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
202
doc/schemas/lightning-listtransactions.json
Normal file
202
doc/schemas/lightning-listtransactions.json
Normal file
|
@ -0,0 +1,202 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"rpc": "listtransactions",
|
||||
"title": "Command to get the list of transactions that was stored in the wallet.",
|
||||
"description": [
|
||||
"The **listtransactions** command returns transactions tracked in the wallet. This includes deposits, withdrawals and transactions related to channels. A transaction may have multiple types, e.g., a transaction may both be a close and a deposit if it closes the channel and returns funds to the wallet."
|
||||
],
|
||||
"request": {
|
||||
"required": [],
|
||||
"properties": {}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"transactions"
|
||||
],
|
||||
"properties": {
|
||||
"transactions": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"hash",
|
||||
"rawtx",
|
||||
"blockheight",
|
||||
"txindex",
|
||||
"locktime",
|
||||
"version",
|
||||
"inputs",
|
||||
"outputs"
|
||||
],
|
||||
"properties": {
|
||||
"hash": {
|
||||
"type": "txid",
|
||||
"description": [
|
||||
"The transaction id."
|
||||
]
|
||||
},
|
||||
"rawtx": {
|
||||
"type": "hex",
|
||||
"description": [
|
||||
"The raw transaction."
|
||||
]
|
||||
},
|
||||
"blockheight": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"The block height of this tx."
|
||||
]
|
||||
},
|
||||
"txindex": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"The transaction number within the block."
|
||||
]
|
||||
},
|
||||
"locktime": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"The nLocktime for this tx."
|
||||
]
|
||||
},
|
||||
"version": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"The nVersion for this tx."
|
||||
]
|
||||
},
|
||||
"inputs": {
|
||||
"type": "array",
|
||||
"description": [
|
||||
"Each input, in order."
|
||||
],
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"txid",
|
||||
"index",
|
||||
"sequence"
|
||||
],
|
||||
"properties": {
|
||||
"txid": {
|
||||
"type": "txid",
|
||||
"description": [
|
||||
"The transaction id spent."
|
||||
]
|
||||
},
|
||||
"index": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"The output spent."
|
||||
]
|
||||
},
|
||||
"sequence": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"The nSequence value."
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"outputs": {
|
||||
"type": "array",
|
||||
"description": [
|
||||
"Each output, in order."
|
||||
],
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"index",
|
||||
"amount_msat",
|
||||
"scriptPubKey"
|
||||
],
|
||||
"properties": {
|
||||
"index": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"The 0-based output number."
|
||||
]
|
||||
},
|
||||
"amount_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"The amount of the output."
|
||||
]
|
||||
},
|
||||
"scriptPubKey": {
|
||||
"type": "hex",
|
||||
"description": [
|
||||
"The scriptPubKey."
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:listtransactions#1",
|
||||
"method": "listtransactions",
|
||||
"params": {}
|
||||
}
|
||||
],
|
||||
"errors": [
|
||||
"On failure, one of the following error codes may be returned:",
|
||||
"",
|
||||
"- -32602: Error in given parameters."
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"transactions": [
|
||||
{
|
||||
"hash": "05985072bbe20747325e69a159fe08176cc1bbc96d25e8848edad2dddc1165d0",
|
||||
"rawtx": "02000000027032912651fc25a3e0893acd5f9640598707e2dfef92143bb5a4020e335442800100000017160014a5f48b9aa3cb8ca6cc1040c11e386745bb4dc932ffffffffd229a4b4f78638ebcac10a68b0561585a5d6e4d3b769ad0a909e9b9afaeae24e00000000171600145c83da9b685f9142016c6f5eb5f98a45cfa6f686ffffffff01915a01000000000017a9143a4dfd59e781f9c3018e7d0a9b7a26d58f8d22bf8700000000",
|
||||
"blockheight": 0,
|
||||
"txindex": 0,
|
||||
"locktime": 0,
|
||||
"version": 2,
|
||||
"inputs": [
|
||||
{
|
||||
"txid": "804254330e02a4b53b1492efdfe207875940965fcd3a89e0a325fc5126913270",
|
||||
"index": 1,
|
||||
"sequence": 4294967295
|
||||
},
|
||||
{
|
||||
"txid": "4ee2eafa9a9b9e900aad69b7d3e4d6a5851556b0680ac1caeb3886f7b4a429d2",
|
||||
"index": 0,
|
||||
"sequence": 4294967295
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"index": 0,
|
||||
"satoshis": "88721000msat",
|
||||
"scriptPubKey": "a9143a4dfd59e781f9c3018e7d0a9b7a26d58f8d22bf87"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"author": [
|
||||
"Vincenzo Palazzo <<vincenzo.palazzo@protonmail.com>> wrote the initial version of this man page,",
|
||||
"but many others did the hard work of actually implementing this rpc command."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-newaddr(7)",
|
||||
"lightning-listfunds(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
76
doc/schemas/lightning-makesecret.json
Normal file
76
doc/schemas/lightning-makesecret.json
Normal file
|
@ -0,0 +1,76 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"rpc": "makesecret",
|
||||
"title": "Command for deriving pseudorandom key from HSM",
|
||||
"description": [
|
||||
"The **makesecret** RPC command derives a secret key from the HSM_secret."
|
||||
],
|
||||
"request": {
|
||||
"required": [],
|
||||
"properties": {
|
||||
"hex": {
|
||||
"type": "hex",
|
||||
"description": [
|
||||
"One of `hex` or `string` must be specified: `hex` can be any hex data."
|
||||
]
|
||||
},
|
||||
"string": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"One of `hex` or `string` must be specified: `string` is a UTF-8 string interpreted literally."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"secret"
|
||||
],
|
||||
"properties": {
|
||||
"secret": {
|
||||
"type": "secret",
|
||||
"description": [
|
||||
"The pseudorandom key derived from HSM_secret."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"errors": [
|
||||
"The following error codes may occur:",
|
||||
"",
|
||||
"- -1: Catchall nonspecific error."
|
||||
],
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:makesecret#1",
|
||||
"method": "makesecret",
|
||||
"params": [
|
||||
"73636220736563726574"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "example:makesecret#2",
|
||||
"method": "makesecret",
|
||||
"params": [
|
||||
null,
|
||||
"scb secret"
|
||||
]
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"secret": "a9a2e742405c28f059349132923a99337ae7f71168b7485496e3365f5bc664ed"
|
||||
},
|
||||
{
|
||||
"secret": "a9a2e742405c28f059349132923a99337ae7f71168b7485496e3365f5bc664ed"
|
||||
}
|
||||
],
|
||||
"author": [
|
||||
"Aditya <<aditya.sharma20111@gmail.com>> is mainly responsible."
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
465
doc/schemas/lightning-multifundchannel.json
Normal file
465
doc/schemas/lightning-multifundchannel.json
Normal file
|
@ -0,0 +1,465 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"rpc": "multifundchannel",
|
||||
"title": "Command for establishing many lightning channels",
|
||||
"description": [
|
||||
"The **multifundchannel** RPC command opens multiple payment channels with nodes by committing a single funding transaction to the blockchain that is shared by all channels.",
|
||||
"",
|
||||
"If not already connected, **multifundchannel** will automatically attempt to connect; you may provide a *@host:port* hint appended to the node ID so that Core Lightning can learn how to connect to the node; see lightning-connect(7).",
|
||||
"",
|
||||
"Once the transaction is confirmed, normal channel operations may begin. Readiness is indicated by **listpeers** reporting a *state* of `CHANNELD_NORMAL` for the channel."
|
||||
],
|
||||
"request": {
|
||||
"required": [
|
||||
"destinations"
|
||||
],
|
||||
"properties": {
|
||||
"destinations": {
|
||||
"type": "array",
|
||||
"description": [
|
||||
"There must be at least one entry in *destinations*; it cannot be an empty array."
|
||||
],
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"id",
|
||||
"amount"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Node ID, with an optional *@host:port* appended to it in a manner understood by **connect**; see lightning-connect(7). Each entry in the *destinations* array must have a unique node *id*. If not already connected, **multifundchannel** will automatically attempt to connect to the node."
|
||||
]
|
||||
},
|
||||
"amount": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"Amount in satoshis taken from the internal wallet to fund the channel (but if we have any anchor channels, this will always leave at least `min-emergency-msat` as change). The string *all* can be used to specify all available funds (or 16,777,215 satoshi if more is available and large channels were not negotiated with the peer). Otherwise it is in satoshi precision; it can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*. The value cannot be less than the dust limit, currently 546 satoshi as of this writing, nor more than 16,777,215 satoshi (unless large channels were negotiated with the peer)."
|
||||
]
|
||||
},
|
||||
"announce": {
|
||||
"type": "boolean",
|
||||
"description": [
|
||||
"Flag that indicates whether to announce the channel with this. If set to `False`, the channel is unpublished."
|
||||
],
|
||||
"default": "`True`"
|
||||
},
|
||||
"push_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"Amount of millisatoshis to outright give to the node. This is a gift to the peer, and you do not get a proof-of-payment out of this."
|
||||
]
|
||||
},
|
||||
"close_to": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Bitcoin address to which the channel funds should be sent to on close. Only valid if both peers have negotiated `option_upfront_shutdown_script` Returns `close_to` set to closing script iff is negotiated."
|
||||
]
|
||||
},
|
||||
"request_amt": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"Amount of liquidity you'd like to lease from peer. If peer supports `option_will_fund`, indicates to them to include this much liquidity into the channel. Must also pass in *compact_lease*."
|
||||
]
|
||||
},
|
||||
"compact_lease": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Compact representation of the peer's expected channel lease terms. If the peer's terms don't match this set, we will fail to open the channel to this destination."
|
||||
]
|
||||
},
|
||||
"mindepth": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"Number of confirmations before we consider the channel active."
|
||||
]
|
||||
},
|
||||
"reserve": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"Amount we want the peer to maintain on its side of the channel. It can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*."
|
||||
],
|
||||
"default": "1% of the funding amount"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"feerate": {
|
||||
"type": "feerate",
|
||||
"description": [
|
||||
"Feerate used for the opening transaction, and if *commitment_feerate* is not set, as initial feerate for commitment and HTLC transactions. See NOTES in lightning-feerates(7) for possible values."
|
||||
],
|
||||
"default": "*normal*"
|
||||
},
|
||||
"minconf": {
|
||||
"type": "integer",
|
||||
"description": [
|
||||
"Minimum number of confirmations that used outputs should have."
|
||||
],
|
||||
"default": 1
|
||||
},
|
||||
"utxos": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "outpoint",
|
||||
"description": [
|
||||
"Utxos to be used to fund the channel, as an array of `txid:vout`."
|
||||
]
|
||||
}
|
||||
},
|
||||
"minchannels": {
|
||||
"type": "integer",
|
||||
"description": [
|
||||
"Re-attempt funding as long as at least this many peers remain (must not be zero). The **multifundchannel** command will only fail if too many peers fail the funding process."
|
||||
]
|
||||
},
|
||||
"commitment_feerate": {
|
||||
"type": "feerate",
|
||||
"description": [
|
||||
"Initial feerate for commitment and HTLC transactions. See *feerate* for valid values."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"tx",
|
||||
"txid",
|
||||
"channel_ids"
|
||||
],
|
||||
"properties": {
|
||||
"tx": {
|
||||
"type": "hex",
|
||||
"description": [
|
||||
"The raw transaction which funded the channel."
|
||||
]
|
||||
},
|
||||
"txid": {
|
||||
"type": "txid",
|
||||
"description": [
|
||||
"The txid of the transaction which funded the channel."
|
||||
]
|
||||
},
|
||||
"channel_ids": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"id",
|
||||
"channel_id",
|
||||
"channel_type",
|
||||
"outnum"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "pubkey",
|
||||
"description": [
|
||||
"The peer we opened the channel with."
|
||||
]
|
||||
},
|
||||
"outnum": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"The 0-based output index showing which output funded the channel."
|
||||
]
|
||||
},
|
||||
"channel_id": {
|
||||
"type": "hash",
|
||||
"description": [
|
||||
"The channel_id of the resulting channel."
|
||||
]
|
||||
},
|
||||
"channel_type": {
|
||||
"type": "object",
|
||||
"description": [
|
||||
"Channel_type as negotiated with peer."
|
||||
],
|
||||
"added": "v24.02",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"bits",
|
||||
"names"
|
||||
],
|
||||
"properties": {
|
||||
"bits": {
|
||||
"type": "array",
|
||||
"description": [
|
||||
"Each bit set in this channel_type."
|
||||
],
|
||||
"added": "v24.02",
|
||||
"items": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"Bit number."
|
||||
]
|
||||
}
|
||||
},
|
||||
"names": {
|
||||
"type": "array",
|
||||
"description": [
|
||||
"Feature name for each bit set in this channel_type."
|
||||
],
|
||||
"added": "v24.02",
|
||||
"items": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"static_remotekey/even",
|
||||
"anchor_outputs/even",
|
||||
"anchors_zero_fee_htlc_tx/even",
|
||||
"scid_alias/even",
|
||||
"zeroconf/even"
|
||||
],
|
||||
"description": [
|
||||
"Name of feature bit."
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"close_to": {
|
||||
"type": "hex",
|
||||
"description": [
|
||||
"The raw scriptPubkey which mutual close will go to; only present if *close_to* parameter was specified and peer supports `option_upfront_shutdown_script`."
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"failed": {
|
||||
"type": "array",
|
||||
"description": [
|
||||
"Any peers we failed to open with (if *minchannels* was specified less than the number of destinations)."
|
||||
],
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"id",
|
||||
"method",
|
||||
"error"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "pubkey",
|
||||
"description": [
|
||||
"The peer we failed to open the channel with."
|
||||
]
|
||||
},
|
||||
"method": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"connect",
|
||||
"openchannel_init",
|
||||
"fundchannel_start",
|
||||
"fundchannel_complete"
|
||||
],
|
||||
"description": [
|
||||
"What stage we failed at."
|
||||
]
|
||||
},
|
||||
"error": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"code",
|
||||
"message"
|
||||
],
|
||||
"properties": {
|
||||
"code": {
|
||||
"type": "integer",
|
||||
"description": [
|
||||
"JSON error code from failing stage."
|
||||
]
|
||||
},
|
||||
"message": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Message from stage."
|
||||
]
|
||||
},
|
||||
"data": {
|
||||
"untyped": true,
|
||||
"description": [
|
||||
"Additional error data."
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"pre_return_value_notes": [
|
||||
"This command opens multiple channels with a single large transaction, thus only one transaction is returned.",
|
||||
"",
|
||||
"If *minchannels* was specified and is less than the number of destinations, then it is possible that one or more of the destinations do not have a channel even if **multifundchannel** succeeded."
|
||||
],
|
||||
"post_return_value_notes": [
|
||||
"On failure, none of the channels are created."
|
||||
]
|
||||
},
|
||||
"errors": [
|
||||
"The following error codes may occur:",
|
||||
"",
|
||||
"- -1: Catchall nonspecific error.",
|
||||
"- 300: The maximum allowed funding amount is exceeded.",
|
||||
"- 301: There are not enough funds in the internal wallet (including fees) to create the transaction.",
|
||||
"- 302: The output amount is too small, and would be considered dust.",
|
||||
"- 303: Broadcasting of the funding transaction failed, the internal call to bitcoin-cli returned with an error.",
|
||||
"- 313: The `min-emergency-msat` reserve not be preserved (and we have or are opening anchor channels).",
|
||||
"",
|
||||
"Failure may also occur if **lightningd** and the peer cannot agree on channel parameters (funding limits, channel reserves, fees, etc.). See lightning-fundchannel_start(7) and lightning-fundchannel_complete(7).",
|
||||
"",
|
||||
"There may be rare edge cases where a communications failure later in the channel funding process will cancel the funding locally, but the peer thinks the channel is already waiting for funding lockin. In that case, the next time we connect to the peer, our node will tell the peer to forget the channel, but some nodes (in particular, Core Lightning nodes) will disconnect when our node tells them to forget the channel. If you immediately **multifundchannel** with that peer, it could trigger this connect-forget-disconnect behavior, causing the second **multifundchannel** to fail as well due to disconnection. Doing a **connect** with the peers separately, and waiting for a few seconds, should help clear this hurdle; running **multifundchannel** a third time would also clear this."
|
||||
],
|
||||
"example_usage": [
|
||||
"This example opens three channels at once, with amounts 200,000 sats, 3,000,000 sats and the final channel using all remaining funds (actually, capped at 16,777,215 sats because large-channels is not enabled):",
|
||||
"",
|
||||
"```shell",
|
||||
"$ lightning-cli multifundchannel '[{\"id\":\"0201f42e167959c74d396ac57652fcea63c63940f78e8239cce5720df4d85ef857@127.0.0.1:7272\", \"amount\":\"200000sat\"}, {\"id\":\"0304a2468065535f9459567686e0f02b40f06e341d3eb2a62ec6763bcf2ccfd207@127.0.0.1:7373\", \"amount\":\"0.03btc\"}, {\"id\":\"0391f4c475050bb15871da5a72b1f3a1798de3d2e5fb4ffa262899b8d8e1f0b764@127.0.0.1:7474\", \"amount\":\"all\"}]'",
|
||||
"{",
|
||||
" \"tx\": \"02000000000101fbe3c68db87b72f82c3f5447b0bc032469c78e71f229ac99c230807ff378a9d80000000000fdffffff04400d0300000000002200202e9897ed5f9b237aa27fd5d02d24157cd452b0d3f0a5bb03d38ff73f9f8f384bffffff0000000000220020439d797ada249e1e12f8d27cabb7330de3c8de0456fb54892deb7b9c72b0ff7c1dc9b50400000000225120046e3966a2d5e43c1f1e0676161905782e1e7c00811485c618f5144f328f4e2bc0c62d0000000000220020e36fd5c03c3586c3763d8b4c9d8650f396ff1c8a460137fb09b60ee82536a3b20140ea4d564e91c919b50a2d32886f1d414de773491119beb1364b92f15d6d03e1810e5ddea89c265e42f2e96bb028dfb3aa0b5b30072ddcc78daad727503c53e37fa9010000\",",
|
||||
" \"txid\": \"90dc53922b70628fc9e7804ad0b8cd0fb41f050d94ffa2db3b16e918c96c022a\",",
|
||||
" \"channel_ids\": [",
|
||||
" {",
|
||||
" \"id\": \"0201f42e167959c74d396ac57652fcea63c63940f78e8239cce5720df4d85ef857\",",
|
||||
" \"channel_id\": \"25c8253e66a860d17916cc0c21386e310eba9900030a68ec6ff6f59a8401a872\",",
|
||||
" \"outnum\": 0",
|
||||
" },",
|
||||
" {",
|
||||
" \"id\": \"0304a2468065535f9459567686e0f02b40f06e341d3eb2a62ec6763bcf2ccfd207\",",
|
||||
" \"channel_id\": \"51749d724892a406896f6bf2e2f8c0b03399d0436691f294839897fa167e6521\",",
|
||||
" \"outnum\": 3",
|
||||
" },",
|
||||
" {",
|
||||
" \"id\": \"0391f4c475050bb15871da5a72b1f3a1798de3d2e5fb4ffa262899b8d8e1f0b764\",",
|
||||
" \"channel_id\": \"7e1414e72c081f0754fa18c1657cedabe696aa9ffeaf0b936bfbe3a28f2829d1\",",
|
||||
" \"outnum\": 1",
|
||||
" }",
|
||||
" ],",
|
||||
" \"failed\": []",
|
||||
"}",
|
||||
"```"
|
||||
],
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:multifundchannel#1",
|
||||
"method": "multifundchannel",
|
||||
"params": {
|
||||
"destinations": [
|
||||
{
|
||||
"id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59@localhost:41939",
|
||||
"amount": 50000
|
||||
}
|
||||
],
|
||||
"feerate": "10000perkw",
|
||||
"minconf": null,
|
||||
"utxos": null,
|
||||
"minchannels": null,
|
||||
"commitment_feerate": "2000perkw"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "example:multifundchannel#2",
|
||||
"method": "multifundchannel",
|
||||
"params": {
|
||||
"destinations": [
|
||||
{
|
||||
"id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59@localhost:44663",
|
||||
"amount": 50000
|
||||
},
|
||||
{
|
||||
"id": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d@localhost:34631",
|
||||
"amount": 50000
|
||||
},
|
||||
{
|
||||
"id": "0382ce59ebf18be7d84677c2e35f23294b9992ceca95491fcf8a56c6cb2d9de199@localhost:34617",
|
||||
"amount": 50000
|
||||
}
|
||||
],
|
||||
"feerate": null,
|
||||
"minconf": null,
|
||||
"utxos": null,
|
||||
"minchannels": 1
|
||||
}
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"tx": "0200000000010100a8ceb6f76c49c8c0c809ca359461540708a9a5ac56e56e6a7aaafb35f4d3850000000000fdffffff0250c30000000000002200205b8cd3b914cf67cdd8fa6273c930353dd36476734fbd962102c2df53b90880cd0623ff030000000022512063ffee4ea7d51e6cadf9086e286a2527922aaa25b8c53aebf32fa32a0a627f5a02473044022064763837f2cc84507eb1fc28c9e95d51174e1da4b8755da8e67fe21e37d0a8b402206295d0f19625f014819361a20572b936d81f6c5ba419e56997e882f3a7be094a012103d745445c9362665f22e0d96e9e766f273f3260dea39c8a76bfa05dd2684ddccf66000000",
|
||||
"txid": "ecba36e93bcf40542d43a05ef550bb0e4be51d766aa2ec8c5640a0d431ab0d06",
|
||||
"channel_ids": [
|
||||
{
|
||||
"id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59",
|
||||
"channel_id": "060dab31d4a040568ceca26a761de54b0ebb50f55ea0432d5440cf3be936baec",
|
||||
"channel_type": {
|
||||
"bits": [
|
||||
12
|
||||
],
|
||||
"names": [
|
||||
"static_remotekey/even"
|
||||
]
|
||||
},
|
||||
"outnum": 0
|
||||
}
|
||||
],
|
||||
"failed": []
|
||||
},
|
||||
{
|
||||
"tx": "020000000001023041611dac05004825ab64781b4a33bf622380bf90196fae689196b1850a1f8f0000000000fdffffff5646519c565466c9588a88400ec71a39a2c0b6988beadb32491a13d9b89f85360100000000fdffffff0250c3000000000000220020181492c29a989f099fd2cf412c74b192dd095e81f4e4f6bec45bd1fbfdd2cfd983720000000000002251203e8a03f678bb7ca048baecc39788530560ea049816d604f72925e425288446c80140caa3b93c6667e4fe0026417cc87ae9dfd16d80018e7c6dcd6dfcee4d6cab7c7e84181baeb95ba25934ad1aa6b57f83c8287bf1b727123350b35549a3abe15b060140b3c6626b9b57081cc7eb5e4f518669764d265fb84316d8fb610e19ede13c5a370c1072861b909ec923acec980adb4a3e488ee3c6f9c49164bd4596945b52f62678000000",
|
||||
"txid": "1fcc6d46200443ad21e3a1a1628b862bafd0d75c0b4454f5494957097bc7930d",
|
||||
"channel_ids": [
|
||||
{
|
||||
"id": "0382ce59ebf18be7d84677c2e35f23294b9992ceca95491fcf8a56c6cb2d9de199",
|
||||
"channel_id": "0d93c77b09574949f554440b5cd7d0af2b868b62a1a1e321ad430420466dcc1f",
|
||||
"channel_type": {
|
||||
"bits": [
|
||||
12,
|
||||
22
|
||||
],
|
||||
"names": [
|
||||
"static_remotekey/even",
|
||||
"anchors_zero_fee_htlc_tx/even"
|
||||
]
|
||||
},
|
||||
"outnum": 0
|
||||
}
|
||||
],
|
||||
"failed": [
|
||||
{
|
||||
"id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59",
|
||||
"method": "connect",
|
||||
"error": {
|
||||
"code": 401,
|
||||
"message": "All addresses failed: 127.0.0.1:44663: Connection establishment: Connection refused. "
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d",
|
||||
"method": "connect",
|
||||
"error": {
|
||||
"code": 401,
|
||||
"message": "All addresses failed: 127.0.0.1:34631: Connection establishment: Connection refused. "
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"author": [
|
||||
"ZmnSCPxj <<ZmnSCPxj@protonmail.com>> is mainly responsible."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-connect(7)",
|
||||
"lightning-listfunds()",
|
||||
"lightning-listpeers(7)",
|
||||
"lightning-fundchannel(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
153
doc/schemas/lightning-multiwithdraw.json
Normal file
153
doc/schemas/lightning-multiwithdraw.json
Normal file
|
@ -0,0 +1,153 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"rpc": "multiwithdraw",
|
||||
"title": "Command for withdrawing to multiple addresses",
|
||||
"description": [
|
||||
"The **multiwithdraw** RPC command sends funds from Core Lightning's internal wallet to the addresses specified in *outputs*."
|
||||
],
|
||||
"request": {
|
||||
"required": [
|
||||
"outputs"
|
||||
],
|
||||
"properties": {
|
||||
"outputs": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "outputdesc"
|
||||
},
|
||||
"description": [
|
||||
"An array containing objects of the form `{address: amount}`. The `amount` may be the string *all*, indicating that all onchain funds be sent to the specified address. Otherwise, it is in satoshi precision; it can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*."
|
||||
]
|
||||
},
|
||||
"feerate": {
|
||||
"type": "feerate",
|
||||
"description": [
|
||||
"Feerate used for the withdrawals. See NOTES in lightning-feerates(7) for possible values."
|
||||
],
|
||||
"default": "*normal*"
|
||||
},
|
||||
"minconf": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"Minimum number of confirmations that used outputs should have."
|
||||
],
|
||||
"default": 1
|
||||
},
|
||||
"utxos": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "outpoint",
|
||||
"description": [
|
||||
"Utxos to be used to be withdrawn from, as an array of `txid:vout`. These must be drawn from the node's available UTXO set."
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"tx",
|
||||
"txid"
|
||||
],
|
||||
"properties": {
|
||||
"tx": {
|
||||
"type": "hex",
|
||||
"description": [
|
||||
"The raw transaction which was sent."
|
||||
]
|
||||
},
|
||||
"txid": {
|
||||
"type": "txid",
|
||||
"description": [
|
||||
"The txid of the **tx**."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:multiwithdraw#1",
|
||||
"method": "multiwithdraw",
|
||||
"params": {
|
||||
"outputs": [
|
||||
{
|
||||
"bcrt1qyusnugshkn6kh5vmdjpe8hylvxlxjy3ns0hmrs": "2222000msat"
|
||||
},
|
||||
{
|
||||
"bcrt1q6r4vvt7uack33qf9n05umfxy8h5s2rdcmq7ra3": "3333000msat"
|
||||
}
|
||||
],
|
||||
"feerate": null,
|
||||
"minconf": null,
|
||||
"utxos": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "example:multiwithdraw#2",
|
||||
"method": "multiwithdraw",
|
||||
"params": {
|
||||
"outputs": [
|
||||
{
|
||||
"BCRT1QW508D6QEJXTDG4Y5R3ZARVARY0C5XW7KYGT080": 1000
|
||||
},
|
||||
{
|
||||
"bcrt1qrp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0gdcccefvpysxf3qzf4jry": 1000
|
||||
},
|
||||
{
|
||||
"bcrt1pw508d6qejxtdg4y5r3zarvary0c5xw7kw508d6qejxtdg4y5r3zarvary0c5xw7k0ylj56": 1000
|
||||
},
|
||||
{
|
||||
"BCRT1SW50QT2UWHA": 1000
|
||||
},
|
||||
{
|
||||
"bcrt1zw508d6qejxtdg4y5r3zarvaryv2wuatf": 1000
|
||||
},
|
||||
{
|
||||
"bcrt1qqqqqp399et2xygdj5xreqhjjvcmzhxw4aywxecjdzew6hylgvseswlauz7": 1000
|
||||
},
|
||||
{
|
||||
"bcrt1pqqqqp399et2xygdj5xreqhjjvcmzhxw4aywxecjdzew6hylgvsesyga46z": 1000
|
||||
},
|
||||
{
|
||||
"bcrt1p0xlxvlhemja6c4dqv22uapctqupfhlxm9h8z3k2e72q4k9hcz7vqc8gma6": 1000
|
||||
}
|
||||
],
|
||||
"feerate": null,
|
||||
"minconf": null,
|
||||
"utxos": null
|
||||
}
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"tx": "02000000000101b75863b811587b4c15bb94d9285c31d6369b8ff609e44de399936f8acb268f600000000000fdffffff03050d000000000000160014d0eac62fdcee2d1881259be9cda4c43de9050db8ae0800000000000016001427213e2217b4f56bd19b6c8393dc9f61be691233d4b5f5050000000022512063ffee4ea7d51e6cadf9086e286a2527922aaa25b8c53aebf32fa32a0a627f5a0247304402203a001463da125de5615ff1c18f9cd4a1d2a138c91d40189d350821ac8fb3ae4f02207a507eec27e15fe43476233cd9fe8b690ebd265073a58ed18ff79a1416886f18012103d745445c9362665f22e0d96e9e766f273f3260dea39c8a76bfa05dd2684ddccf66000000",
|
||||
"txid": "94e803b98257855569d35b675d65fb4fa0061a8b5f828992e2104a2882bb18bf"
|
||||
},
|
||||
{
|
||||
"tx": "02000000000101dc5a50dfbafc30697b930b44e763ff7a255475d17d975fa0e2003431312098cf0100000000fdffffff09e803000000000000225120000000c4a5cad46221b2a187905e5266362b99d5e91c6ce24d165dab93e86433e803000000000000046002751ee8030000000000002a5128751e76e8199196d454941c45d1b3a323f1433bd6751e76e8199196d454941c45d1b3a323f1433bd6e80300000000000022512079be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f817983b939700000000002251200518e92cd94e0f62c06f126dff98b9abe79b7ed845a156d5245678e26554475de803000000000000160014751e76e8199196d454941c45d1b3a323f1433bd6e8030000000000002200201863143c14c5166804bd19203356da136c985678cd4d27a1b8c6329604903262e803000000000000125210751e76e8199196d454941c45d1b3a323e803000000000000220020000000c4a5cad46221b2a187905e5266362b99d5e91c6ce24d165dab93e8643301407f0d9bc098c5439ff611507b6a7d403047ed4e0b883f293db19d4e109d350a24f790acb55547384ff2a23fcfde0eba9af7cebc321c19cfc4817ecd47d50c2cd854000000",
|
||||
"txid": "062383a7c9a19a2768939087a5c89826a4ea3531080f20cc06aa1cbf431be505"
|
||||
}
|
||||
],
|
||||
"errors": [
|
||||
"On failure, an error is reported and the withdrawal transaction is not created.",
|
||||
"",
|
||||
"- -1: Catchall nonspecific error.",
|
||||
"- 301: There are not enough funds in the internal wallet (including fees) to create the transaction.",
|
||||
"- 302: The dust limit is not met."
|
||||
],
|
||||
"author": [
|
||||
"ZmnSCPxj <<ZmnSCPxj@protonmail.com>> is mainly responsible."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-listfunds(7)",
|
||||
"lightning-fundchannel(7)",
|
||||
"lightning-newaddr(7)",
|
||||
"lightning-txprepare(7)",
|
||||
"lightning-withdraw(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
88
doc/schemas/lightning-newaddr.json
Normal file
88
doc/schemas/lightning-newaddr.json
Normal file
|
@ -0,0 +1,88 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"rpc": "newaddr",
|
||||
"title": "Command for generating a new address to be used by Core Lightning",
|
||||
"description": [
|
||||
"The **newaddr** RPC command generates a new address which can subsequently be used to fund channels managed by the Core Lightning node.",
|
||||
"",
|
||||
"The funding transaction needs to be confirmed before funds can be used.",
|
||||
"",
|
||||
"To send an on-chain payment from the Core Lightning node wallet, use `withdraw`."
|
||||
],
|
||||
"request": {
|
||||
"required": [],
|
||||
"properties": {
|
||||
"addresstype": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"It specifies the type of address wanted; currently *bech32* (e.g. `tb1qu9j4lg5f9rgjyfhvfd905vw46eg39czmktxqgg` on bitcoin testnet or `bc1qwqdg6squsna38e46795at95yu9atm8azzmyvckulcc7kytlcckxswvvzej` on bitcoin mainnet), or *p2tr* taproot addresses. The special value *all* generates all known address types for the same underlying key."
|
||||
],
|
||||
"default": "*bech32* address",
|
||||
"enum": [
|
||||
"bech32",
|
||||
"p2tr",
|
||||
"all"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [],
|
||||
"properties": {
|
||||
"p2tr": {
|
||||
"added": "v23.08",
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The taproot address."
|
||||
]
|
||||
},
|
||||
"bech32": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The bech32 (native segwit) address."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"errors": [
|
||||
"If an unrecognized address type is requested an error message will be returned."
|
||||
],
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:newaddr#1",
|
||||
"method": "newaddr",
|
||||
"params": {
|
||||
"addresstype": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "example:newaddr#2",
|
||||
"method": "newaddr",
|
||||
"params": {
|
||||
"addresstype": "bech32"
|
||||
}
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"bech32": "bcrt1qq8adjz4u6enf0cjey9j8yt0y490tact93fzgsf"
|
||||
},
|
||||
{
|
||||
"bech32": "bcrt1qq8adjz4u6enf0cjey9j8yt0y490tact93fzgsf"
|
||||
}
|
||||
],
|
||||
"author": [
|
||||
"Felix <<fixone@gmail.com>> is mainly responsible."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-listfunds(7)",
|
||||
"lightning-fundchannel(7)",
|
||||
"lightning-withdraw(7)",
|
||||
"lightning-listtransactions(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
93
doc/schemas/lightning-notifications.json
Normal file
93
doc/schemas/lightning-notifications.json
Normal file
|
@ -0,0 +1,93 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"rpc": "notifications",
|
||||
"title": "Command to set up notifications.",
|
||||
"description": [
|
||||
"The **notifications** the RPC command enabled notifications for this JSON-RPC connection. By default (and for backwards-compatibility) notifications are disabled.",
|
||||
"",
|
||||
"Various commands, especially complex and slow ones, offer notifications which indicate their progress."
|
||||
],
|
||||
"request": {
|
||||
"required": [
|
||||
"enable"
|
||||
],
|
||||
"properties": {
|
||||
"enable": {
|
||||
"type": "boolean",
|
||||
"description": [
|
||||
"Whether to enable or disable notifications."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"properties": {},
|
||||
"post_return_value_notes": [
|
||||
"On success, if *enable* was *true*, notifications will be forwarded from then on."
|
||||
]
|
||||
},
|
||||
"notifications": [
|
||||
"Notifications are JSON-RPC objects without an *id* field. *lightningd* sends notifications (once enabled with this *notifications* command) with a *params* *id* field indicating which command the notification refers to.",
|
||||
"",
|
||||
"Implementations should ignore notifications without an *id* parameter, or unknown *method*.",
|
||||
"",
|
||||
"Common *method*s include:",
|
||||
" *message*: param *message*: a descriptional string indicating something which occurred relating to the command. Param *level* indicates the level, as per lightning-getlog(7): *info* and *debug* are typical.",
|
||||
" *progress*: param *num* and *total*, where *num* starts at 0 and is always less than *total*. Optional param *stage* with fields *num* and *total*, indicating what stage we are progressing through."
|
||||
],
|
||||
"errors": [
|
||||
"On failure, one of the following error codes may be returned:",
|
||||
"",
|
||||
"- -32602: Error in given parameters."
|
||||
],
|
||||
"example_json_notifications": [
|
||||
{
|
||||
"method": "message",
|
||||
"params": {
|
||||
"id": 1,
|
||||
"message": "This is a test message",
|
||||
"level": "DEBUG"
|
||||
}
|
||||
},
|
||||
{
|
||||
"method": "progress",
|
||||
"params": {
|
||||
"id": 2,
|
||||
"num": 0,
|
||||
"total": 30,
|
||||
"stage": {
|
||||
"num": 0,
|
||||
"total": 2
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:notifications#1",
|
||||
"method": "notifications",
|
||||
"params": {
|
||||
"enable": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "example:notifications#2",
|
||||
"method": "notifications",
|
||||
"params": {
|
||||
"enable": false
|
||||
}
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{},
|
||||
{}
|
||||
],
|
||||
"author": [
|
||||
"Rusty Russell <<rusty@blockstream.com>> wrote the initial version of this man page."
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
216
doc/schemas/lightning-offer.json
Normal file
216
doc/schemas/lightning-offer.json
Normal file
|
@ -0,0 +1,216 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"rpc": "offer",
|
||||
"title": "Command for accepting payments",
|
||||
"warning": "experimental-offers only",
|
||||
"description": [
|
||||
"The **offer** RPC command creates an offer (or returns an existing one), which is a precursor to creating one or more invoices. It automatically enables the processing of an incoming invoice_request, and issuing of invoices.",
|
||||
"",
|
||||
"Note that for making an offer to *pay* someone else, see lightning- invoicerequest(7)."
|
||||
],
|
||||
"request": {
|
||||
"required": [
|
||||
"amount",
|
||||
"description"
|
||||
],
|
||||
"properties": {
|
||||
"amount": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "msat_or_any"
|
||||
},
|
||||
{
|
||||
"type": "currency"
|
||||
}
|
||||
],
|
||||
"description": [
|
||||
"Can be the string `any`, which creates an offer that can be paid with any amount (e.g. a donation). Otherwise it can be a positive value in millisatoshi precision; it can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*. It can also have an ISO 4217 postfix (e.g. USD), in which case currency conversion will need to be done for the invoice itself. A plugin is needed which provides the `currencyconvert` API for this currency, otherwise the offer creation will fail."
|
||||
]
|
||||
},
|
||||
"description": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"A short description of purpose of the offer, e.g. *coffee*. This value is encoded into the resulting offer and is viewable by anyone you expose this offer to. It must be UTF-8, and cannot use *\\u* JSON escape codes."
|
||||
]
|
||||
},
|
||||
"issuer": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Who is issuing this offer (i.e. you) if appropriate."
|
||||
]
|
||||
},
|
||||
"label": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"An internal-use name for the offer, which can be any UTF-8 string. This is *NOT* encoded in the offer not sent to the issuer."
|
||||
]
|
||||
},
|
||||
"quantity_max": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"Invoice can specify more than one of the items up (and including) this maximum: 0 is a special value meaning `no maximuim`. The *amount* for the invoice will need to be multiplied accordingly. This is encoded in the offer."
|
||||
]
|
||||
},
|
||||
"absolute_expiry": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"Time the offer is valid until,in seconds since the first day of 1970 UTC. If not set, the offer remains valid (though it can be deactivated by the issuer of course). This is encoded in the offer."
|
||||
]
|
||||
},
|
||||
"recurrence": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"An invoice is expected at regular intervals. The argument is a positive number followed by one of `seconds`, `minutes`, `hours`, `days`, `weeks`, `months` or `years` (variants without the trailing `s` are also permitted). This is encoded in the offer. The semantics of recurrence is fairly predictable, but fully documented in BOLT 12. e.g. `4weeks`."
|
||||
]
|
||||
},
|
||||
"recurrence_base": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"type": "integer"
|
||||
}
|
||||
],
|
||||
"description": [
|
||||
"Time in seconds since the first day of 1970 UTC, optionally with a `@` prefix. This indicates when the first period begins; without this, the recurrence periods start from the first invoice. The `@` prefix means that the invoice must start by paying the first period; otherwise it is permitted to start at any period. This is encoded in the offer. e.g. `@1609459200` indicates you must start paying on the 1st January 2021."
|
||||
]
|
||||
},
|
||||
"recurrence_paywindow": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Argument of form `-time+time[%]`. The first time is the number of seconds before the start of a period in which an invoice and payment is valid, the second time is the number of seconds after the start of the period. For example *-604800+86400* means you can fetch an pay the invoice 4 weeks before the given period starts, and up to 1 day afterwards. The optional *%* indicates that the amount of the invoice will be scaled by the time remaining in the period. This is encoded in the offer."
|
||||
],
|
||||
"default": "that payment is allowed during the current and previous periods"
|
||||
},
|
||||
"recurrence_limit": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"To indicate the maximum period which exists. eg. `12` means there are 13 periods, from 0 to 12 inclusive. This is encoded in the offer."
|
||||
]
|
||||
},
|
||||
"single_use": {
|
||||
"type": "boolean",
|
||||
"description": [
|
||||
"Indicates that the offer is only valid once; we may issue multiple invoices, but as soon as one is paid all other invoices will be expired (i.e. only one person can pay this offer)."
|
||||
],
|
||||
"default": "False"
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"offer_id",
|
||||
"active",
|
||||
"single_use",
|
||||
"bolt12",
|
||||
"used",
|
||||
"created"
|
||||
],
|
||||
"properties": {
|
||||
"offer_id": {
|
||||
"type": "hash",
|
||||
"description": [
|
||||
"The id of this offer (merkle hash of non-signature fields)."
|
||||
]
|
||||
},
|
||||
"active": {
|
||||
"type": "boolean",
|
||||
"enum": [
|
||||
true
|
||||
],
|
||||
"description": [
|
||||
"Whether this can still be used."
|
||||
]
|
||||
},
|
||||
"single_use": {
|
||||
"type": "boolean",
|
||||
"description": [
|
||||
"Whether this expires as soon as it's paid (reflects the *single_use* parameter)."
|
||||
]
|
||||
},
|
||||
"bolt12": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The bolt12 encoding of the offer."
|
||||
]
|
||||
},
|
||||
"used": {
|
||||
"type": "boolean",
|
||||
"description": [
|
||||
"True if an associated invoice has been paid."
|
||||
]
|
||||
},
|
||||
"created": {
|
||||
"type": "boolean",
|
||||
"description": [
|
||||
"False if the offer already existed."
|
||||
]
|
||||
},
|
||||
"label": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The (optional) user-specified label."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"errors": [
|
||||
"On failure, an error is returned and no offer is created. If the lightning process fails before responding, the caller should use lightning-listoffers(7) to query whether this offer was created or not.",
|
||||
"",
|
||||
"If the offer already existed, and is still active, that is returned; if it's not active then this call fails.",
|
||||
"",
|
||||
"- -1: Catchall nonspecific error.",
|
||||
"- 1000: Offer with this offer_id already exists (but is not active)."
|
||||
],
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:offer#1",
|
||||
"method": "offer",
|
||||
"params": {
|
||||
"amount": "1msat",
|
||||
"description": "test for 1msat"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "example:offer#2",
|
||||
"method": "offer",
|
||||
"params": {
|
||||
"amount": "100000sat",
|
||||
"description": "quantity_max test",
|
||||
"recurrence": "1week"
|
||||
}
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"offer_id": "f61cca153d1948dade19349792d9bcdc9cef687fd27db0b553a67979f55aae48",
|
||||
"active": true,
|
||||
"single_use": false,
|
||||
"bolt12": "lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcgqyqs5rn5v4ehggrxdaezqvtdwdshg93pqfnwgkvdr57yzh6h92zg3qctvrm7w38djg67kzcm4yeg8vc4cq63s",
|
||||
"used": false,
|
||||
"created": true
|
||||
},
|
||||
{
|
||||
"offer_id": "f7a501e51e2a90d032150b9100b1977c625f05cfda22469bdc81d8a20b1e303f",
|
||||
"active": true,
|
||||
"single_use": false,
|
||||
"bolt12": "lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcgqszltcgqpgghzatpde6xjaretakkz7pqw3jhxaqkyypxdeze35wncs2l2u4gfzyrpds00e6yakfrt6ctrw5n9qanzhqr2xq6qgqsw",
|
||||
"used": false,
|
||||
"created": true
|
||||
}
|
||||
],
|
||||
"author": [
|
||||
"Rusty Russell <<rusty@rustcorp.com.au>> is mainly responsible."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-listoffers(7)",
|
||||
"lightning-disableoffer(7)",
|
||||
"lightning-invoicerequest(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
93
doc/schemas/lightning-openchannel_abort.json
Normal file
93
doc/schemas/lightning-openchannel_abort.json
Normal file
|
@ -0,0 +1,93 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"rpc": "openchannel_abort",
|
||||
"title": "Command to abort a channel to a peer",
|
||||
"description": [
|
||||
"`openchannel_init` is a low level RPC command which initiates a channel open with a specified peer. It uses the openchannel protocol which allows for interactive transaction construction."
|
||||
],
|
||||
"request": {
|
||||
"required": [
|
||||
"channel_id"
|
||||
],
|
||||
"properties": {
|
||||
"channel_id": {
|
||||
"type": "hash",
|
||||
"description": [
|
||||
"Channel id of the channel to be aborted."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"channel_id",
|
||||
"channel_canceled",
|
||||
"reason"
|
||||
],
|
||||
"properties": {
|
||||
"channel_id": {
|
||||
"type": "hash",
|
||||
"description": [
|
||||
"The channel id of the aborted channel."
|
||||
]
|
||||
},
|
||||
"channel_canceled": {
|
||||
"type": "boolean",
|
||||
"description": [
|
||||
"Whether this is completely canceled (there may be remaining in-flight transactions)."
|
||||
]
|
||||
},
|
||||
"reason": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Usually \"Abort requested\", but if it happened to fail at the same time it could be different."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"errors": [
|
||||
"On error the returned object will contain `code` and `message` properties, with `code` being one of the following:",
|
||||
"",
|
||||
"- -32602: If the given parameters are wrong.",
|
||||
"- -1: Catchall nonspecific error.",
|
||||
"- 305: Peer is not connected.",
|
||||
"- 311: Unknown channel id.",
|
||||
"- 312: Channel in an invalid state"
|
||||
],
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:openchannel_abort#1",
|
||||
"method": "openchannel_abort",
|
||||
"params": {
|
||||
"channel_id": "aec3dfd0c7643a23b679cd2e493c053f8fdf621ff2624949f9582c4118b818c6"
|
||||
}
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"channel_id": "aec3dfd0c7643a23b679cd2e493c053f8fdf621ff2624949f9582c4118b818c6",
|
||||
"channel_canceled": true,
|
||||
"reason": "Abort requested"
|
||||
}
|
||||
],
|
||||
"author": [
|
||||
"Lisa Neigut <<niftynei@gmail.com>> is mainly responsible."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-openchannel_init(7)",
|
||||
"lightning-openchannel_update(7)",
|
||||
"lightning-openchannel_signed(7)",
|
||||
"lightning-openchannel_bump(7)",
|
||||
"lightning-fundchannel_start(7)",
|
||||
"lightning-fundchannel_complete(7)",
|
||||
"lightning-fundchannel(7)",
|
||||
"lightning-fundpsbt(7)",
|
||||
"lightning-utxopsbt(7)",
|
||||
"lightning-multifundchannel(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
172
doc/schemas/lightning-openchannel_bump.json
Normal file
172
doc/schemas/lightning-openchannel_bump.json
Normal file
|
@ -0,0 +1,172 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"rpc": "openchannel_bump",
|
||||
"title": "Command to initiate a channel RBF",
|
||||
"description": [
|
||||
"`openchannel_bump` is a RPC command which initiates a channel RBF (Replace-By-Fee) for the specified channel. It uses the openchannel protocol which allows for interactive transaction construction.",
|
||||
"",
|
||||
"Warning: bumping a leased channel will lose the lease."
|
||||
],
|
||||
"request": {
|
||||
"required": [
|
||||
"channel_id",
|
||||
"amount",
|
||||
"initialpsbt"
|
||||
],
|
||||
"properties": {
|
||||
"channel_id": {
|
||||
"type": "hash",
|
||||
"description": [
|
||||
"Id of the channel to RBF."
|
||||
]
|
||||
},
|
||||
"amount": {
|
||||
"type": "sat",
|
||||
"description": [
|
||||
"Satoshi value that we will contribute to the channel. This value will be _added_ to the provided PSBT in the output which is encumbered by the 2-of-2 script for this channel."
|
||||
]
|
||||
},
|
||||
"initialpsbt": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The funded, incomplete PSBT that specifies the UTXOs and change output for our channel contribution. It can be updated, see `openchannel_update`; *initialpsbt* must have at least one input. Must have the Non-Witness UTXO (PSBT_IN_NON_WITNESS_UTXO) set for every input. An error (code 309) will be returned if this requirement is not met."
|
||||
]
|
||||
},
|
||||
"funding_feerate": {
|
||||
"type": "feerate",
|
||||
"description": [
|
||||
"Feerate for the funding transaction."
|
||||
],
|
||||
"default": "1/64th greater than the last feerate used for this channel"
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"channel_id",
|
||||
"channel_type",
|
||||
"psbt",
|
||||
"commitments_secured",
|
||||
"funding_serial"
|
||||
],
|
||||
"properties": {
|
||||
"channel_id": {
|
||||
"type": "hash",
|
||||
"description": [
|
||||
"The channel id of the channel."
|
||||
]
|
||||
},
|
||||
"channel_type": {
|
||||
"type": "object",
|
||||
"description": [
|
||||
"Channel_type as negotiated with peer."
|
||||
],
|
||||
"added": "v24.02",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"bits",
|
||||
"names"
|
||||
],
|
||||
"properties": {
|
||||
"bits": {
|
||||
"type": "array",
|
||||
"description": [
|
||||
"Each bit set in this channel_type."
|
||||
],
|
||||
"added": "v24.02",
|
||||
"items": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"Bit number."
|
||||
]
|
||||
}
|
||||
},
|
||||
"names": {
|
||||
"type": "array",
|
||||
"description": [
|
||||
"Feature name for each bit set in this channel_type."
|
||||
],
|
||||
"added": "v24.02",
|
||||
"items": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"static_remotekey/even",
|
||||
"anchor_outputs/even",
|
||||
"anchors_zero_fee_htlc_tx/even",
|
||||
"scid_alias/even",
|
||||
"zeroconf/even"
|
||||
],
|
||||
"description": [
|
||||
"Name of feature bit."
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"psbt": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The (incomplete) PSBT of the RBF transaction."
|
||||
]
|
||||
},
|
||||
"commitments_secured": {
|
||||
"type": "boolean",
|
||||
"enum": [
|
||||
false
|
||||
],
|
||||
"description": [
|
||||
"Whether the *psbt* is complete."
|
||||
]
|
||||
},
|
||||
"funding_serial": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"The serial_id of the funding output in the *psbt*."
|
||||
]
|
||||
},
|
||||
"requires_confirmed_inputs": {
|
||||
"type": "boolean",
|
||||
"description": [
|
||||
"Does peer require confirmed inputs in psbt?"
|
||||
]
|
||||
}
|
||||
},
|
||||
"post_return_value_notes": [
|
||||
"If the peer does not support `option_dual_fund`, this command will return an error.",
|
||||
"",
|
||||
"If the channel is not in a state that is eligible for RBF, this command will return an error."
|
||||
]
|
||||
},
|
||||
"errors": [
|
||||
"On error the returned object will contain `code` and `message` properties, with `code` being one of the following:",
|
||||
"",
|
||||
"- -32602: If the given parameters are wrong.",
|
||||
"- -1: Catchall nonspecific error.",
|
||||
"- 300: The amount exceeded the maximum configured funding amount.",
|
||||
"- 301: The provided PSBT cannot afford the funding amount.",
|
||||
"- 305: Peer is not connected.",
|
||||
"- 309: PSBT missing required fields",
|
||||
"- 311: Unknown channel id.",
|
||||
"- 312: Channel in an invalid state"
|
||||
],
|
||||
"author": [
|
||||
"Lisa Neigut <<niftynei@gmail.com>> is mainly responsible."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-openchannel_init(7)",
|
||||
"lightning-openchannel_update(7)",
|
||||
"lightning-openchannel_signed(7)",
|
||||
"lightning-openchannel_abort(7)",
|
||||
"lightning-fundchannel_start(7)",
|
||||
"lightning-fundchannel_complete(7)",
|
||||
"lightning-fundchannel(7)",
|
||||
"lightning-fundpsbt(7)",
|
||||
"lightning-utxopsbt(7)",
|
||||
"lightning-multifundchannel(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
285
doc/schemas/lightning-openchannel_init.json
Normal file
285
doc/schemas/lightning-openchannel_init.json
Normal file
|
@ -0,0 +1,285 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"rpc": "openchannel_init",
|
||||
"title": "Command to initiate a channel to a peer",
|
||||
"description": [
|
||||
"`openchannel_init` is a low level RPC command which initiates a channel open with a specified peer. It uses the openchannel protocol which allows for interactive transaction construction."
|
||||
],
|
||||
"request": {
|
||||
"required": [
|
||||
"id",
|
||||
"amount",
|
||||
"initialpsbt"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "pubkey",
|
||||
"description": [
|
||||
"Node id of the remote peer."
|
||||
]
|
||||
},
|
||||
"amount": {
|
||||
"type": "sat",
|
||||
"description": [
|
||||
"Satoshi value that we will contribute to the channel. This value will be _added_ to the provided PSBT in the output which is encumbered by the 2-of-2 script for this channel."
|
||||
]
|
||||
},
|
||||
"initialpsbt": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Funded, incomplete PSBT that specifies the UTXOs and change output for our channel contribution. It can be updated, see `openchannel_update`; *initialpsbt* must have at least one input. Must have the Non-Witness UTXO (PSBT_IN_NON_WITNESS_UTXO) set for every input. An error (code 309) will be returned if this requirement is not met."
|
||||
]
|
||||
},
|
||||
"commitment_feerate": {
|
||||
"type": "feerate",
|
||||
"description": [
|
||||
"Feerate for commitment transactions for non-anchor channels: see **fundchannel**. For anchor channels, it is ignored."
|
||||
]
|
||||
},
|
||||
"funding_feerate": {
|
||||
"type": "feerate",
|
||||
"description": [
|
||||
"Feerate for the funding transaction."
|
||||
],
|
||||
"default": "'opening' feerate"
|
||||
},
|
||||
"announce": {
|
||||
"type": "boolean",
|
||||
"description": [
|
||||
"Whether or not to announce this channel."
|
||||
]
|
||||
},
|
||||
"close_to": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Bitcoin address to which the channel funds should be sent on close. Only valid if both peers have negotiated `option_upfront_shutdown_script`."
|
||||
]
|
||||
},
|
||||
"request_amt": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"An amount of liquidity you'd like to lease from the peer. If peer supports `option_will_fund`, indicates to them to include this much liquidity into the channel. Must also pass in *compact_lease*."
|
||||
]
|
||||
},
|
||||
"compact_lease": {
|
||||
"type": "hex",
|
||||
"description": [
|
||||
"A compact representation of the peer's expected channel lease terms. If the peer's terms don't match this set, we will fail to open the channel."
|
||||
]
|
||||
},
|
||||
"channel_type": {
|
||||
"type": "array",
|
||||
"description": [
|
||||
"Each bit set in this channel_type."
|
||||
],
|
||||
"items": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"Bit number."
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"channel_id",
|
||||
"psbt",
|
||||
"channel_type",
|
||||
"commitments_secured",
|
||||
"funding_serial"
|
||||
],
|
||||
"properties": {
|
||||
"channel_id": {
|
||||
"type": "hash",
|
||||
"description": [
|
||||
"The channel id of the channel."
|
||||
]
|
||||
},
|
||||
"psbt": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The (incomplete) PSBT of the funding transaction."
|
||||
]
|
||||
},
|
||||
"channel_type": {
|
||||
"type": "object",
|
||||
"description": [
|
||||
"Channel_type as negotiated with peer."
|
||||
],
|
||||
"added": "v24.02",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"bits",
|
||||
"names"
|
||||
],
|
||||
"properties": {
|
||||
"bits": {
|
||||
"type": "array",
|
||||
"description": [
|
||||
"Each bit set in this channel_type."
|
||||
],
|
||||
"added": "v24.02",
|
||||
"items": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"Bit number."
|
||||
]
|
||||
}
|
||||
},
|
||||
"names": {
|
||||
"type": "array",
|
||||
"description": [
|
||||
"Feature name for each bit set in this channel_type."
|
||||
],
|
||||
"added": "v24.02",
|
||||
"items": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"static_remotekey/even",
|
||||
"anchor_outputs/even",
|
||||
"anchors_zero_fee_htlc_tx/even",
|
||||
"scid_alias/even",
|
||||
"zeroconf/even"
|
||||
],
|
||||
"description": [
|
||||
"Name of feature bit."
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"commitments_secured": {
|
||||
"type": "boolean",
|
||||
"enum": [
|
||||
false
|
||||
],
|
||||
"description": [
|
||||
"Whether the *psbt* is complete."
|
||||
]
|
||||
},
|
||||
"funding_serial": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"The serial_id of the funding output in the *psbt*."
|
||||
]
|
||||
},
|
||||
"requires_confirmed_inputs": {
|
||||
"type": "boolean",
|
||||
"description": [
|
||||
"Does peer require confirmed inputs in psbt?"
|
||||
]
|
||||
}
|
||||
},
|
||||
"post_return_value_notes": [
|
||||
"If the peer does not support `option_dual_fund`, this command will return an error.",
|
||||
"",
|
||||
"If you sent a *request_amt* and the peer supports `option_will_fund` and is interested in leasing you liquidity in this channel, returns their updated channel fee max (*channel_fee_proportional_basis*, *channel_fee_base_msat*), updated rate card for the lease fee (*lease_fee_proportional_basis*, *lease_fee_base_sat*) and their on-chain weight *weight_charge*, which will be added to the lease fee at a rate of *funding_feerate* * *weight_charge* / 1000."
|
||||
]
|
||||
},
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:openchannel_init#1",
|
||||
"method": "openchannel_init",
|
||||
"params": {
|
||||
"id": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d",
|
||||
"amount": 999000,
|
||||
"initialpsbt": "cHNidP8BADMCAAAAAYbThUhSzYr7ph6Z434bdcW7eoirYOFMmUt2GXZ79sF/AQAAAAD9////AGYAAAAAAQDeAgAAAAABARVD4QKlmwy8SNcNypf1o9TzbIFZjj4dqVzHAL0SLDoTAAAAAAD9////AjOv9ikBAAAAFgAUXJGglH7At5HOVY4ZHp0+19kv655AQg8AAAAAABYAFAH62Qq81maX4lkhZHIt5KlevuFlAkcwRAIgVIxRXqIykOOxm/6YPaFFx2Qh1618qlXPUhDiliVQ2KUCIHQcHniUTcm1XT8SyRE8ev52jm0uiIYum15XcR/tPh+NASEC3Pby7xL4+Ig/Z8TchQ0QT1upLGet3da8qjSjgHO9LOJlAAAAAQEfQEIPAAAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQA=",
|
||||
"commitment_feerate": null,
|
||||
"funding_feerate": null,
|
||||
"announce": true,
|
||||
"close_to": null,
|
||||
"request_amt": null,
|
||||
"channel_type": [
|
||||
12,
|
||||
22
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "example:openchannel_init#2",
|
||||
"method": "openchannel_init",
|
||||
"params": {
|
||||
"id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59",
|
||||
"amount": 16777216,
|
||||
"initialpsbt": "cHNidP8BADMCAAAAAQVmgyf8sA3N9J6XaH5z7W+GUPDFOM/2L/PuD7iE0RaqAAAAAAD9////AGYAAAAAAQDeAgAAAAABAdWZZguGlQJ1eA+d7WAT500jdCzHJWT9J/TGQIkbS1KfAAAAAAD9////AoCWmAEAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WXzWm0oAQAAABYAFE8Xxp4GJggW2lJcsHg0VLolc/Z/AkcwRAIgEQLtA2JvAk7S1R9QD5o4SVNXCjMwTUIyHtu65taC/d4CIEnpq2PdrqKqitdmZj09U8cFuwV+Ba9kmZSUsctSWx8CASECUKP6EBufpaBXT910uYhCcKdw9z8iqHgyKa3uuX2QgmVlAAAAAQEfgJaYAQAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQA=",
|
||||
"commitment_feerate": null,
|
||||
"funding_feerate": null,
|
||||
"announce": true,
|
||||
"close_to": null,
|
||||
"request_amt": null,
|
||||
"channel_type": null
|
||||
}
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"channel_id": "53fa2b1ca0d8f21abeaaac0495ab9925cdfaf2ca8b04dbe4aeb061823e1ff2c8",
|
||||
"psbt": "cHNidP8BAgQCAAAAAQMEZgAAAAEEAQEBBQEBAQYBAwH7BAIAAAAAAQDeAgAAAAABARVD4QKlmwy8SNcNypf1o9TzbIFZjj4dqVzHAL0SLDoTAAAAAAD9////AjOv9ikBAAAAFgAUXJGglH7At5HOVY4ZHp0+19kv655AQg8AAAAAABYAFAH62Qq81maX4lkhZHIt5KlevuFlAkcwRAIgVIxRXqIykOOxm/6YPaFFx2Qh1618qlXPUhDiliVQ2KUCIHQcHniUTcm1XT8SyRE8ev52jm0uiIYum15XcR/tPh+NASEC3Pby7xL4+Ig/Z8TchQ0QT1upLGet3da8qjSjgHO9LOJlAAAAAQEfQEIPAAAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQEOIIbThUhSzYr7ph6Z434bdcW7eoirYOFMmUt2GXZ79sF/AQ8EAQAAAAEQBP3///8M/AlsaWdodG5pbmcBCMCDK/6LyRi8AAEDCFg+DwAAAAAAAQQiACDYM+8ZRsbTj0OCG/yzqLt2buFQn9LuMPDZqFFcgmCmfAz8CWxpZ2h0bmluZwEIchtFHfZ5FBgA",
|
||||
"channel_type": {
|
||||
"bits": [
|
||||
12,
|
||||
22
|
||||
],
|
||||
"names": [
|
||||
"static_remotekey/even",
|
||||
"anchors_zero_fee_htlc_tx/even"
|
||||
]
|
||||
},
|
||||
"commitments_secured": false,
|
||||
"funding_serial": 8222241539686471000,
|
||||
"requires_confirmed_inputs": false
|
||||
},
|
||||
{
|
||||
"channel_id": "252d1b0a1e57895e84137f28cf19ab2c35847e284c112fefdecc7afeaa5c1de7",
|
||||
"psbt": "cHNidP8BAgQCAAAAAQMEZgAAAAEEAQEBBQEBAQYBAwH7BAIAAAAAAQDeAgAAAAABAdWZZguGlQJ1eA+d7WAT500jdCzHJWT9J/TGQIkbS1KfAAAAAAD9////AoCWmAEAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WXzWm0oAQAAABYAFE8Xxp4GJggW2lJcsHg0VLolc/Z/AkcwRAIgEQLtA2JvAk7S1R9QD5o4SVNXCjMwTUIyHtu65taC/d4CIEnpq2PdrqKqitdmZj09U8cFuwV+Ba9kmZSUsctSWx8CASECUKP6EBufpaBXT910uYhCcKdw9z8iqHgyKa3uuX2QgmVlAAAAAQEfgJaYAQAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQEOIAVmgyf8sA3N9J6XaH5z7W+GUPDFOM/2L/PuD7iE0RaqAQ8EAAAAAAEQBP3///8M/AlsaWdodG5pbmcBCLR8RjOq9lmcAAEDCAAAAAEAAAAAAQQiACBbjNO5FM9nzdj6YnPJMDU902R2c0+9liECwt9TuQiAzQz8CWxpZ2h0bmluZwEIZZtc7LD4y9YA",
|
||||
"channel_type": {
|
||||
"bits": [
|
||||
12,
|
||||
22
|
||||
],
|
||||
"names": [
|
||||
"static_remotekey/even",
|
||||
"anchors_zero_fee_htlc_tx/even"
|
||||
]
|
||||
},
|
||||
"commitments_secured": false,
|
||||
"funding_serial": 7321547790872006000,
|
||||
"requires_confirmed_inputs": false
|
||||
}
|
||||
],
|
||||
"errors": [
|
||||
"On error the returned object will contain `code` and `message` properties, with `code` being one of the following:",
|
||||
"",
|
||||
"- -32602: If the given parameters are wrong.",
|
||||
"- -1: Catchall nonspecific error.",
|
||||
"- 300: The amount exceeded the maximum configured funding amount.",
|
||||
"- 301: The provided PSBT cannot afford the funding amount.",
|
||||
"- 304: Still syncing with bitcoin network",
|
||||
"- 305: Peer is not connected.",
|
||||
"- 306: Unknown peer id.",
|
||||
"- 309: PSBT missing required fields",
|
||||
"- 310: v2 channel open protocol not supported by peer",
|
||||
"- 312: Channel in an invalid state"
|
||||
],
|
||||
"author": [
|
||||
"Lisa Neigut <<niftynei@gmail.com>> is mainly responsible."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-openchannel_update(7)",
|
||||
"lightning-openchannel_signed(7)",
|
||||
"lightning-openchannel_abort(7)",
|
||||
"lightning-openchannel_bump(7)",
|
||||
"lightning-fundchannel_start(7)",
|
||||
"lightning-fundchannel_complete(7)",
|
||||
"lightning-fundchannel(7)",
|
||||
"lightning-fundpsbt(7)",
|
||||
"lightning-utxopsbt(7)",
|
||||
"lightning-multifundchannel(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
90
doc/schemas/lightning-openchannel_signed.json
Normal file
90
doc/schemas/lightning-openchannel_signed.json
Normal file
|
@ -0,0 +1,90 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"rpc": "openchannel_signed",
|
||||
"title": "Command to conclude a channel open",
|
||||
"description": [
|
||||
"`openchannel_signed` is a low level RPC command which concludes a channel open with the specified peer. It uses the v2 openchannel protocol, which allows for interactive transaction construction.",
|
||||
"",
|
||||
"This command should be called after `openchannel_update` returns *commitments_secured* `true`.",
|
||||
"",
|
||||
"This command will broadcast the finalized funding transaction, if we receive valid signatures from the peer."
|
||||
],
|
||||
"request": {
|
||||
"required": [
|
||||
"channel_id",
|
||||
"signed_psbt"
|
||||
],
|
||||
"properties": {
|
||||
"channel_id": {
|
||||
"type": "hash",
|
||||
"description": [
|
||||
"Id of the channel."
|
||||
]
|
||||
},
|
||||
"signed_psbt": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The PSBT returned from `openchannel_update` (where *commitments_secured* was true) with partial signatures or finalized witness stacks included for every input that we contributed to the PSBT."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"channel_id",
|
||||
"tx",
|
||||
"txid"
|
||||
],
|
||||
"properties": {
|
||||
"channel_id": {
|
||||
"type": "hash",
|
||||
"description": [
|
||||
"The channel id of the channel."
|
||||
]
|
||||
},
|
||||
"tx": {
|
||||
"type": "hex",
|
||||
"description": [
|
||||
"The funding transaction."
|
||||
]
|
||||
},
|
||||
"txid": {
|
||||
"type": "txid",
|
||||
"description": [
|
||||
"The txid of the **tx**."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"errors": [
|
||||
"On error, the returned object will contain `code` and `message` properties, with `code` being one of the following:",
|
||||
"",
|
||||
"- -32602: If the given parameters are wrong.",
|
||||
"- -1: Catchall nonspecific error.",
|
||||
"- 303: Funding transaction broadcast failed.",
|
||||
"- 305: Peer is not connected.",
|
||||
"- 309: PSBT missing required fields.",
|
||||
"- 311: Unknown channel id.",
|
||||
"- 312: Channel in an invalid state"
|
||||
],
|
||||
"author": [
|
||||
"Lisa Neigut <<niftynei@gmail.com>> is mainly responsible."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-openchannel_init(7)",
|
||||
"lightning-openchannel_update(7)",
|
||||
"lightning-openchannel_abort(7)",
|
||||
"lightning-openchannel_bump(7)",
|
||||
"lightning-fundchannel_start(7)",
|
||||
"lightning-fundchannel_complete(7)",
|
||||
"lightning-fundchannel(7)",
|
||||
"lightning-fundpsbt(7)",
|
||||
"lightning-utxopsbt(7)",
|
||||
"lightning-multifundchannel(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
258
doc/schemas/lightning-openchannel_update.json
Normal file
258
doc/schemas/lightning-openchannel_update.json
Normal file
|
@ -0,0 +1,258 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"rpc": "openchannel_update",
|
||||
"title": "Command to update a collab channel open",
|
||||
"description": [
|
||||
"`openchannel_update` is a low level RPC command which continues an open channel, as specified by *channel_id*. An updated *psbt* is passed in; any changes from the PSBT last returned (either from `openchannel_init` or a previous call to `openchannel_update`) will be communicated to the peer.",
|
||||
"",
|
||||
"Must be called after `openchannel_init` and before `openchannel_signed`.",
|
||||
"",
|
||||
"Must be called until *commitments_secured* is returned as true, at which point `openchannel_signed` should be called with a signed version of the PSBT returned by the last call to `openchannel_update`."
|
||||
],
|
||||
"request": {
|
||||
"required": [
|
||||
"channel_id",
|
||||
"psbt"
|
||||
],
|
||||
"properties": {
|
||||
"channel_id": {
|
||||
"type": "hash",
|
||||
"description": [
|
||||
"Id of the channel."
|
||||
]
|
||||
},
|
||||
"psbt": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Updated PSBT to be sent to the peer. May be identical to the PSBT last returned by either `openchannel_init` or `openchannel_update`."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"channel_id",
|
||||
"psbt",
|
||||
"commitments_secured",
|
||||
"channel_type",
|
||||
"funding_outnum"
|
||||
],
|
||||
"properties": {
|
||||
"channel_id": {
|
||||
"type": "hash",
|
||||
"description": [
|
||||
"The channel id of the channel."
|
||||
]
|
||||
},
|
||||
"channel_type": {
|
||||
"type": "object",
|
||||
"description": [
|
||||
"Channel_type as negotiated with peer."
|
||||
],
|
||||
"added": "v24.02",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"bits",
|
||||
"names"
|
||||
],
|
||||
"properties": {
|
||||
"bits": {
|
||||
"type": "array",
|
||||
"description": [
|
||||
"Each bit set in this channel_type."
|
||||
],
|
||||
"added": "v24.02",
|
||||
"items": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"Bit number."
|
||||
]
|
||||
}
|
||||
},
|
||||
"names": {
|
||||
"type": "array",
|
||||
"description": [
|
||||
"Feature name for each bit set in this channel_type."
|
||||
],
|
||||
"added": "v24.02",
|
||||
"items": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"static_remotekey/even",
|
||||
"anchor_outputs/even",
|
||||
"anchors_zero_fee_htlc_tx/even",
|
||||
"scid_alias/even",
|
||||
"zeroconf/even"
|
||||
],
|
||||
"description": [
|
||||
"Name of feature bit."
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"psbt": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The PSBT of the funding transaction."
|
||||
]
|
||||
},
|
||||
"commitments_secured": {
|
||||
"type": "boolean",
|
||||
"description": [
|
||||
"Whether the *psbt* is complete (if true, sign *psbt* and call `openchannel_signed` to complete the channel open)."
|
||||
]
|
||||
},
|
||||
"funding_outnum": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"The index of the funding output in the psbt."
|
||||
]
|
||||
},
|
||||
"close_to": {
|
||||
"type": "hex",
|
||||
"description": [
|
||||
"Scriptpubkey which we have to close to if we mutual close."
|
||||
]
|
||||
},
|
||||
"requires_confirmed_inputs": {
|
||||
"type": "boolean",
|
||||
"description": [
|
||||
"Does peer require confirmed inputs in psbt?"
|
||||
]
|
||||
}
|
||||
},
|
||||
"allOf": [
|
||||
{
|
||||
"if": {
|
||||
"properties": {
|
||||
"commitments_secured": {
|
||||
"type": "boolean",
|
||||
"enum": [
|
||||
true
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"then": {
|
||||
"additionalProperties": true,
|
||||
"required": [
|
||||
"channel_id",
|
||||
"funding_outnum"
|
||||
],
|
||||
"properties": {
|
||||
"commitments_secured": {},
|
||||
"channel_id": {
|
||||
"type": "hash",
|
||||
"description": [
|
||||
"The derived channel id."
|
||||
]
|
||||
},
|
||||
"close_to": {
|
||||
"type": "hex",
|
||||
"description": [
|
||||
"If a `close_to` address was provided to `openchannel_init` and the peer supports `option_upfront_shutdownscript`."
|
||||
]
|
||||
},
|
||||
"funding_outnum": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"The index of the funding output for this channel in the funding transaction."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"else": {
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"commitments_secured": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"errors": [
|
||||
"On error, the returned object will contain `code` and `message` properties,",
|
||||
"with `code` being one of the following:",
|
||||
"",
|
||||
"- -32602: If the given parameters are wrong.",
|
||||
"- -1: Catchall nonspecific error.",
|
||||
"- 305: Peer is not connected.",
|
||||
"- 309: PSBT missing required fields",
|
||||
"- 311: Unknown channel id.",
|
||||
"- 312: Channel in an invalid state"
|
||||
],
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:openchannel_update#1",
|
||||
"method": "openchannel_update",
|
||||
"params": {
|
||||
"channel_id": "c3a282c1136f44dc2e499c116a9d9e6ea64649c3eabdd396cb96fb30a86fad8e",
|
||||
"psbt": "cHNidP8BAgQCAAAAAQMEZgAAAAEEAQEBBQEBAQYBAwH7BAIAAAAAAQDeAgAAAAABAdWZZguGlQJ1eA+d7WAT500jdCzHJWT9J/TGQIkbS1KfAAAAAAD9////AoCWmAEAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WXzWm0oAQAAABYAFE8Xxp4GJggW2lJcsHg0VLolc/Z/AkcwRAIgEQLtA2JvAk7S1R9QD5o4SVNXCjMwTUIyHtu65taC/d4CIEnpq2PdrqKqitdmZj09U8cFuwV+Ba9kmZSUsctSWx8CASECUKP6EBufpaBXT910uYhCcKdw9z8iqHgyKa3uuX2QgmVlAAAAAQEfgJaYAQAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQEOIAVmgyf8sA3N9J6XaH5z7W+GUPDFOM/2L/PuD7iE0RaqAQ8EAAAAAAEQBP3///8M/AlsaWdodG5pbmcBCH932EuFXyxeAAEDCEBCDwAAAAAAAQQiACA/FzDCfUe+WFEBa+aPSY4TZTYt6liPHz5OHo04w2gQ3wz8CWxpZ2h0bmluZwEI42voJCAYLKQA"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "example:openchannel_update#2",
|
||||
"method": "openchannel_update",
|
||||
"params": {
|
||||
"channel_id": "c3a282c1136f44dc2e499c116a9d9e6ea64649c3eabdd396cb96fb30a86fad8e",
|
||||
"psbt": "cHNidP8BAgQCAAAAAQMEZgAAAAEEAQEBBQEBAQYBAwH7BAIAAAAAAQDeAgAAAAABAdWZZguGlQJ1eA+d7WAT500jdCzHJWT9J/TGQIkbS1KfAAAAAAD9////AoCWmAEAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WXzWm0oAQAAABYAFE8Xxp4GJggW2lJcsHg0VLolc/Z/AkcwRAIgEQLtA2JvAk7S1R9QD5o4SVNXCjMwTUIyHtu65taC/d4CIEnpq2PdrqKqitdmZj09U8cFuwV+Ba9kmZSUsctSWx8CASECUKP6EBufpaBXT910uYhCcKdw9z8iqHgyKa3uuX2QgmVlAAAAAQEfgJaYAQAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQEOIAVmgyf8sA3N9J6XaH5z7W+GUPDFOM/2L/PuD7iE0RaqAQ8EAAAAAAEQBP3///8M/AlsaWdodG5pbmcBCH932EuFXyxeAAEDCEBCDwAAAAAAAQQiACA/FzDCfUe+WFEBa+aPSY4TZTYt6liPHz5OHo04w2gQ3wz8CWxpZ2h0bmluZwEI42voJCAYLKQA"
|
||||
}
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"channel_id": "c3a282c1136f44dc2e499c116a9d9e6ea64649c3eabdd396cb96fb30a86fad8e",
|
||||
"psbt": "cHNidP8BAgQCAAAAAQMEZgAAAAEEAQEBBQEBAQYBAwH7BAIAAAAAAQDeAgAAAAABAdWZZguGlQJ1eA+d7WAT500jdCzHJWT9J/TGQIkbS1KfAAAAAAD9////AoCWmAEAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WXzWm0oAQAAABYAFE8Xxp4GJggW2lJcsHg0VLolc/Z/AkcwRAIgEQLtA2JvAk7S1R9QD5o4SVNXCjMwTUIyHtu65taC/d4CIEnpq2PdrqKqitdmZj09U8cFuwV+Ba9kmZSUsctSWx8CASECUKP6EBufpaBXT910uYhCcKdw9z8iqHgyKa3uuX2QgmVlAAAAAQEfgJaYAQAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQEOIAVmgyf8sA3N9J6XaH5z7W+GUPDFOM/2L/PuD7iE0RaqAQ8EAAAAAAEQBP3///8M/AlsaWdodG5pbmcBCH932EuFXyxeAAEDCEBCDwAAAAAAAQQiACA/FzDCfUe+WFEBa+aPSY4TZTYt6liPHz5OHo04w2gQ3wz8CWxpZ2h0bmluZwEI42voJCAYLKQA",
|
||||
"channel_type": {
|
||||
"bits": [
|
||||
12,
|
||||
22
|
||||
],
|
||||
"names": [
|
||||
"static_remotekey/even",
|
||||
"anchors_zero_fee_htlc_tx/even"
|
||||
]
|
||||
},
|
||||
"commitments_secured": true,
|
||||
"funding_outnum": 0
|
||||
},
|
||||
{
|
||||
"channel_id": "c3a282c1136f44dc2e499c116a9d9e6ea64649c3eabdd396cb96fb30a86fad8e",
|
||||
"psbt": "cHNidP8BAgQCAAAAAQMEZgAAAAEEAQEBBQEBAQYBAwH7BAIAAAAAAQDeAgAAAAABAdWZZguGlQJ1eA+d7WAT500jdCzHJWT9J/TGQIkbS1KfAAAAAAD9////AoCWmAEAAAAAFgAUAfrZCrzWZpfiWSFkci3kqV6+4WXzWm0oAQAAABYAFE8Xxp4GJggW2lJcsHg0VLolc/Z/AkcwRAIgEQLtA2JvAk7S1R9QD5o4SVNXCjMwTUIyHtu65taC/d4CIEnpq2PdrqKqitdmZj09U8cFuwV+Ba9kmZSUsctSWx8CASECUKP6EBufpaBXT910uYhCcKdw9z8iqHgyKa3uuX2QgmVlAAAAAQEfgJaYAQAAAAAWABQB+tkKvNZml+JZIWRyLeSpXr7hZQEOIAVmgyf8sA3N9J6XaH5z7W+GUPDFOM/2L/PuD7iE0RaqAQ8EAAAAAAEQBP3///8M/AlsaWdodG5pbmcBCH932EuFXyxeAAEDCEBCDwAAAAAAAQQiACA/FzDCfUe+WFEBa+aPSY4TZTYt6liPHz5OHo04w2gQ3wz8CWxpZ2h0bmluZwEI42voJCAYLKQA",
|
||||
"channel_type": {
|
||||
"bits": [
|
||||
12,
|
||||
22
|
||||
],
|
||||
"names": [
|
||||
"static_remotekey/even",
|
||||
"anchors_zero_fee_htlc_tx/even"
|
||||
]
|
||||
},
|
||||
"commitments_secured": true,
|
||||
"funding_outnum": 0,
|
||||
"close_to": "5120eed745804da9784cc203f563efa99ffa54fdf01b137bc964e63c3124070ffbe6"
|
||||
}
|
||||
],
|
||||
"author": [
|
||||
"Lisa Neigut <<niftynei@gmail.com>> is mainly responsible."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-openchannel_init(7)",
|
||||
"lightning-openchannel_signed(7)",
|
||||
"lightning-openchannel_bump(7)",
|
||||
"lightning-openchannel_abort(7)",
|
||||
"lightning-fundchannel_start(7)",
|
||||
"lightning-fundchannel_complete(7)",
|
||||
"lightning-fundchannel(7)",
|
||||
"lightning-fundpsbt(7)",
|
||||
"lightning-utxopsbt(7)",
|
||||
"lightning-multifundchannel(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
90
doc/schemas/lightning-parsefeerate.json
Normal file
90
doc/schemas/lightning-parsefeerate.json
Normal file
|
@ -0,0 +1,90 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"rpc": "parsefeerate",
|
||||
"title": "Command for parsing a feerate string to a feerate",
|
||||
"description": [
|
||||
"The **parsefeerate** command returns the current feerate for any valid *feerate_str*. This is useful for finding the current feerate that a **fundpsbt** or **utxopsbt** command might use."
|
||||
],
|
||||
"request": {
|
||||
"required": [
|
||||
"feerate_str"
|
||||
],
|
||||
"properties": {
|
||||
"feerate_str": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The feerate string to parse."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [],
|
||||
"properties": {
|
||||
"perkw": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"Value of *feerate_str* in kilosipa."
|
||||
],
|
||||
"additionalProperties": false
|
||||
}
|
||||
}
|
||||
},
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:parsefeerate#1",
|
||||
"method": "parsefeerate",
|
||||
"params": [
|
||||
"unilateral_close"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "example:parsefeerate#2",
|
||||
"method": "parsefeerate",
|
||||
"params": [
|
||||
"9999perkw"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "example:parsefeerate#3",
|
||||
"method": "parsefeerate",
|
||||
"params": [
|
||||
10000
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "example:parsefeerate#4",
|
||||
"method": "parsefeerate",
|
||||
"params": [
|
||||
"urgent"
|
||||
]
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"perkw": 11000
|
||||
},
|
||||
{
|
||||
"perkw": 9999
|
||||
},
|
||||
{
|
||||
"perkw": 2500
|
||||
},
|
||||
{
|
||||
"perkw": 11000
|
||||
}
|
||||
],
|
||||
"errors": [
|
||||
"The **parsefeerate** command will error if the *feerate_str* format is not recognized.",
|
||||
"",
|
||||
"- -32602: If the given parameters are wrong."
|
||||
],
|
||||
"trivia": [
|
||||
"In CLN we like to call the weight unit \"sipa\" in honor of Pieter Wuille, who uses the name \"sipa\" on IRC and elsewhere. Internally we call the *perkw* style as \"feerate per kilosipa\"."
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
265
doc/schemas/lightning-pay.json
Normal file
265
doc/schemas/lightning-pay.json
Normal file
|
@ -0,0 +1,265 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"rpc": "pay",
|
||||
"title": "Command for sending a payment to a BOLT11 invoice",
|
||||
"description": [
|
||||
"The **pay** RPC command attempts to find a route to the given destination, and send the funds it asks for. .",
|
||||
"",
|
||||
"The response will occur when the payment fails or succeeds. Once a payment has succeeded, calls to **pay** with the same *bolt11* will succeed immediately.",
|
||||
"",
|
||||
"When using *lightning-cli*, you may skip optional parameters by using *null*. Alternatively, use **-k** option to provide parameters by name."
|
||||
],
|
||||
"request": {
|
||||
"required": [
|
||||
"bolt11"
|
||||
],
|
||||
"properties": {
|
||||
"bolt11": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Bolt11 invoice, if **experimental-offers** is enabled, it can actually be a bolt12 invoice, such as one received from lightningd-fetchinvoice(7). If it does not contain an amount, *amount_msat* is required, otherwise if it is specified it must be *null*."
|
||||
]
|
||||
},
|
||||
"amount_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"*amount_msat* is in millisatoshi precision; it can be a whole number, or a whole number with suffix *msat* or *sat*, or a three decimal point number with suffix *sat*, or an 1 to 11 decimal point number suffixed by *btc*."
|
||||
]
|
||||
},
|
||||
"label": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"It is used to attach a label to payments, and is returned in lightning- listpays(7) and lightning-listsendpays(7)."
|
||||
]
|
||||
},
|
||||
"riskfactor": {
|
||||
"type": "number",
|
||||
"description": [
|
||||
"The *riskfactor* is described in detail in lightning-getroute(7)."
|
||||
],
|
||||
"default": "10"
|
||||
},
|
||||
"maxfeepercent": {
|
||||
"type": "number",
|
||||
"description": [
|
||||
"Percentage of the amount that is to be paid."
|
||||
],
|
||||
"default": "0.5"
|
||||
},
|
||||
"retry_for": {
|
||||
"type": "u16",
|
||||
"description": [
|
||||
"Until *retry_for* seconds passes, the command will keep finding routes and retrying the payment."
|
||||
],
|
||||
"default": "60 seconds"
|
||||
},
|
||||
"maxdelay": {
|
||||
"type": "u16",
|
||||
"description": [
|
||||
"A payment may be delayed for up to `maxdelay` blocks by another node; clients should be prepared for this worst case."
|
||||
]
|
||||
},
|
||||
"exemptfee": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"This option can be used for tiny payments which would be dominated by the fee leveraged by forwarding nodes. Setting `exemptfee` allows the `maxfeepercent` check to be skipped on fees that are smaller than `exemptfee`."
|
||||
],
|
||||
"default": "5000 millisatoshi"
|
||||
},
|
||||
"localinvreqid": {
|
||||
"type": "hex",
|
||||
"description": [
|
||||
"`localinvreqid` is used by offers to link a payment attempt to a local `invoice_request` offer created by lightningd-invoicerequest(7). This ensures that we only make a single payment for an offer, and that the offer is marked `used` once paid."
|
||||
]
|
||||
},
|
||||
"exclude": {
|
||||
"type": "array",
|
||||
"description": [
|
||||
"*exclude* is a JSON array of short-channel-id/direction (e.g. [ '564334x877x1/0', '564195x1292x0/1' ]) or pubkey which should be excluded from consideration for routing."
|
||||
],
|
||||
"default": "not to exclude any channels or nodes",
|
||||
"items": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "short_channel_id_dir"
|
||||
},
|
||||
{
|
||||
"type": "pubkey"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"maxfee": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"*maxfee* overrides both *maxfeepercent* and *exemptfee* defaults (and if you specify *maxfee* you cannot specify either of those), and creates an absolute limit on what fee we will pay. This allows you to implement your own heuristics rather than the primitive ones used here."
|
||||
]
|
||||
},
|
||||
"description": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"It is only required for bolt11 invoices which do not contain a description themselves, but contain a description hash: in this case *description* is required. *description* is then checked against the hash inside the invoice before it will be paid."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"payment_preimage",
|
||||
"payment_hash",
|
||||
"created_at",
|
||||
"parts",
|
||||
"amount_msat",
|
||||
"amount_sent_msat",
|
||||
"status"
|
||||
],
|
||||
"properties": {
|
||||
"payment_preimage": {
|
||||
"type": "secret",
|
||||
"description": [
|
||||
"The proof of payment: SHA256 of this **payment_hash**."
|
||||
]
|
||||
},
|
||||
"destination": {
|
||||
"type": "pubkey",
|
||||
"description": [
|
||||
"The final destination of the payment."
|
||||
]
|
||||
},
|
||||
"payment_hash": {
|
||||
"type": "hash",
|
||||
"description": [
|
||||
"The hash of the *payment_preimage* which will prove payment."
|
||||
]
|
||||
},
|
||||
"created_at": {
|
||||
"type": "number",
|
||||
"description": [
|
||||
"The UNIX timestamp showing when this payment was initiated."
|
||||
]
|
||||
},
|
||||
"parts": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"How many attempts this took."
|
||||
]
|
||||
},
|
||||
"amount_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"Amount the recipient received."
|
||||
]
|
||||
},
|
||||
"amount_sent_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"Total amount we sent (including fees)."
|
||||
]
|
||||
},
|
||||
"warning_partial_completion": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Not all parts of a multi-part payment have completed."
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"complete",
|
||||
"pending",
|
||||
"failed"
|
||||
],
|
||||
"description": [
|
||||
"Status of payment."
|
||||
]
|
||||
}
|
||||
},
|
||||
"post_return_value_notes": [
|
||||
"You can monitor the progress and retries of a payment using the lightning-paystatus(7) command."
|
||||
]
|
||||
},
|
||||
"randomization": [
|
||||
"To protect user privacy, the payment algorithm performs some randomization.",
|
||||
"",
|
||||
"1: Route Randomization",
|
||||
"",
|
||||
"Route randomization means the payment algorithm does not always use the lowest-fee or shortest route. This prevents some highly-connected node from learning all of the user payments by reducing their fees below the network average.",
|
||||
"",
|
||||
"2: Shadow Route",
|
||||
"",
|
||||
"Shadow route means the payment algorithm will virtually extend the route by adding delays and fees along it, making it appear to intermediate nodes that the route is longer than it actually is. This prevents intermediate nodes from reliably guessing their distance from the payee.",
|
||||
"",
|
||||
"Route randomization will never exceed *maxfeepercent* of the payment. Route randomization and shadow routing will not take routes that would exceed *maxdelay*."
|
||||
],
|
||||
"errors": [
|
||||
"The following error codes may occur:",
|
||||
"",
|
||||
"- -1: Catchall nonspecific error.",
|
||||
"- 201: Already paid with this *hash* using different amount or destination.",
|
||||
"- 203: Permanent failure at destination. The *data* field of the error will be routing failure object (except for self-payment, which currently returns the error directly from lightning-sendpay(7)).",
|
||||
"- 205: Unable to find a route.",
|
||||
"- 206: Route too expensive. Either the fee or the needed total locktime for the route exceeds your *maxfeepercent* or *maxdelay* settings, respectively. The *data* field of the error will indicate the actual *fee* as well as the *feepercent* percentage that the fee has of the destination payment amount. It will also indicate the actual *delay* along the route.",
|
||||
"- 207: Invoice expired. Payment took too long before expiration, or already expired at the time you initiated payment. The *data* field of the error indicates *now* (the current time) and *expiry* (the invoice expiration) as UNIX epoch time in seconds.",
|
||||
"- 210: Payment timed out without a payment in progress.",
|
||||
"",
|
||||
"Error codes 202 and 204 will only get reported at **sendpay**; in **pay** we will keep retrying if we would have gotten those errors.",
|
||||
"",
|
||||
"A routing failure object has the fields below:",
|
||||
"",
|
||||
"*erring_index*: The index of the node along the route that reported the error. 0 for the local node, 1 for the first hop, and so on.",
|
||||
"*erring_node*: The hex string of the pubkey id of the node that reported the error.",
|
||||
"*erring_channel*: The short channel ID of the channel that has the error, or *0:0:0* if the destination node raised the error.",
|
||||
"*failcode*: The failure code, as per BOLT #4.",
|
||||
"*channel_update*: The hex string of the *channel_update* message received from the remote node. Only present if error is from the remote node and the *failcode* has the UPDATE bit set, as per BOLT #4.",
|
||||
"",
|
||||
"The *data* field of errors will include statistics *getroute_tries* and *sendpay_tries*. It will also contain a *failures* field with detailed data about routing errors."
|
||||
],
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:pay#1",
|
||||
"method": "pay",
|
||||
"params": {
|
||||
"bolt11": "lni1qqgxr7gha7gusyg83lsr8qcqg4axgq3qqc3xu3s3rg94nj40zfsy866mhu5vxne6tcej5878k2mneuvgjy8ssqtypg3hgetnwsszycn0d36rzv3zypjx2umrwf5hqarfdahzcg8sn7jmpuyl423pvggzvmj9nrga83q474e2sjygxzmq7ln5fmvjxh4skxafx2pmx9wqx5v9qgqxyfhyvyg6pdvu4tcjvpp7kkal9rp57wj7xv4pl3ajku70rzy3pavzzqjz06c8s2vvmrpjlkcse0txx0gmc6jalqqxmeyjm75qcnfnqxwyt2sfsqnxu3vc68fug904w25y3zpskc8huazwmy34av93h2fjswe3tsp4rqpe8qlx9xssexfc0aguke3q6u0jgw2qmn008mzu04mkmqmjmhes3gcpqdqdnzl270s48vsp635rd4jm04snvgkcp65qlkgp8qztu2mdp7c5uqpj2rll3pzu56st537rct3v62gfqeamzthjuwkr0pkvsdnnffpn4sq9sz0lryaufktx0nfxlffum3yesqev5gwqqqqqqqqqqqqqqqzsqqqqqqqqqqqqr5jt9hav2gqqqqqq5szxtvwkyz5zq2000hlwvadejz366lqjt9sd2j4rf5tfd9rgmmyegt4dqd34cf6v4gqkfvppqfnwgkvdr57yzh6h92zg3qctvrm7w38djg67kzcm4yeg8vc4cq633uzqn3n74ccym4wcvq20vsx7lmk450kprpvlrh4cukk8xy9ptjcef4rnhytnkyn4vnxxtd57yeaksze2s30y26cs6u3rjd9322eg9puk24q",
|
||||
"amount_msat": null,
|
||||
"label": null,
|
||||
"riskfactor": null,
|
||||
"maxfeepercent": null,
|
||||
"retry_for": null,
|
||||
"maxdelay": null,
|
||||
"exemptfee": null,
|
||||
"localinvreqid": null,
|
||||
"exclude": null,
|
||||
"maxfee": null,
|
||||
"description": null
|
||||
}
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"destination": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518",
|
||||
"payment_hash": "29ef7dfee675b990a3ad7c125960d54aa34d16969468dec9942ead03635c274c",
|
||||
"created_at": 1706153504.76628,
|
||||
"parts": 1,
|
||||
"amount_msat": 100,
|
||||
"amount_sent_msat": 100,
|
||||
"payment_preimage": "6634c1b549c6615d234832f377e06d5a5ab088c40cebdc5cfb8c1262030abcad",
|
||||
"status": "complete"
|
||||
}
|
||||
],
|
||||
"author": [
|
||||
"Rusty Russell <<rusty@rustcorp.com.au>> is mainly responsible."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-listpays(7)",
|
||||
"lightning-decodepay(7)",
|
||||
"lightning-listinvoice(7)",
|
||||
"lightning-delinvoice(7)",
|
||||
"lightning-getroute(7)",
|
||||
"lightning-invoice(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
92
doc/schemas/lightning-ping.json
Normal file
92
doc/schemas/lightning-ping.json
Normal file
|
@ -0,0 +1,92 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"rpc": "ping",
|
||||
"title": "Command to check if a node is up.",
|
||||
"description": [
|
||||
"The **ping** command checks if the node with *id* is ready to talk. It currently only works for peers we have a channel with."
|
||||
],
|
||||
"request": {
|
||||
"required": [
|
||||
"id"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "pubkey",
|
||||
"description": [
|
||||
"The pubkey of the node to ping."
|
||||
]
|
||||
},
|
||||
"len": {
|
||||
"type": "u16",
|
||||
"description": [
|
||||
"The length of the ping."
|
||||
],
|
||||
"default": "128"
|
||||
},
|
||||
"pongbytes": {
|
||||
"type": "u16",
|
||||
"description": [
|
||||
"The length of the reply. A value of 65532 to 65535 means `don't reply`."
|
||||
],
|
||||
"default": "128"
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"totlen"
|
||||
],
|
||||
"properties": {
|
||||
"totlen": {
|
||||
"type": "u16",
|
||||
"description": [
|
||||
"The answer length of the reply message (including header: 0 means no reply expected)."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:ping#1",
|
||||
"method": "ping",
|
||||
"params": {
|
||||
"len": 128,
|
||||
"pongbytes": 128
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "example:ping#2",
|
||||
"method": "ping",
|
||||
"params": {
|
||||
"id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59",
|
||||
"len": 1000,
|
||||
"pongbytes": 65535
|
||||
}
|
||||
}
|
||||
],
|
||||
"errors": [
|
||||
"On failure, one of the following error codes may be returned:",
|
||||
"",
|
||||
"- -32602: Error in given parameters or we're already waiting for a ping response from peer."
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"totlen": 132
|
||||
},
|
||||
{
|
||||
"totlen": 0
|
||||
}
|
||||
],
|
||||
"author": [
|
||||
"Vincenzo Palazzo <<vincenzo.palazzo@protonmail.com>> wrote the initial version of this man page,",
|
||||
"but many others did the hard work of actually implementing this rpc command."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-connect(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
291
doc/schemas/lightning-plugin.json
Normal file
291
doc/schemas/lightning-plugin.json
Normal file
|
@ -0,0 +1,291 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": true,
|
||||
"rpc": "plugin",
|
||||
"title": "Manage plugins with RPC",
|
||||
"description": [
|
||||
"The **plugin** RPC command can be used to control dynamic plugins, i.e. plugins that declared themself 'dynamic' (in getmanifest)."
|
||||
],
|
||||
"request": {
|
||||
"required": [
|
||||
"subcommand"
|
||||
],
|
||||
"oneOfMany": [
|
||||
[
|
||||
"plugin",
|
||||
"directory"
|
||||
]
|
||||
],
|
||||
"properties": {
|
||||
"subcommand": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"start",
|
||||
"stop",
|
||||
"rescan",
|
||||
"startdir",
|
||||
"list"
|
||||
],
|
||||
"description": [
|
||||
"Determines what action is taken:",
|
||||
" - *subcommand* **start** takes a *path* to an executable as argument and starts it as plugin. *path* may be an absolute path or a path relative to the plugins directory (default *~/.lightning/plugins*). If the plugin is already running and the executable (checksum) has changed, the plugin is killed and restarted except if its an important (or builtin) plugin. If the plugin doesn't complete the 'getmanifest' and 'init' handshakes within 60 seconds, the command will timeout and kill the plugin. Additional *options* may be passed to the plugin, but requires all parameters to be passed as keyword=value pairs using the `-k|--keyword` option which is recommended. For example the following command starts the plugin helloworld.py (present in the plugin directory) with the option greeting set to 'A crazy':",
|
||||
" ```shell.",
|
||||
" lightning-cli -k plugin subcommand=start plugin=helloworld.py greeting='A crazy'.",
|
||||
" ```.",
|
||||
" - *subcommand* **stop** takes a plugin executable *path* or *name* as argument and stops the plugin. If the plugin subscribed to 'shutdown', it may take up to 30 seconds before this command returns. If the plugin is important and dynamic, this will shutdown `lightningd`.",
|
||||
" - *subcommand* **startdir** starts all executables it can find in *directory* (excl. subdirectories) as plugins. Checksum and timeout behavior as in **start** applies.",
|
||||
" - *subcommand* **rescan** starts all plugins in the default plugins directory (default *~/.lightning/plugins*) that are not already running. Checksum and timeout behavior as in **start** applies.",
|
||||
" - *subcommand* **list** lists all running plugins (incl. non-dynamic)."
|
||||
]
|
||||
},
|
||||
"plugin": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"*path* or *name* of a plugin executable to start or stop."
|
||||
]
|
||||
},
|
||||
"directory": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"*path* of a directory containing plugins."
|
||||
]
|
||||
},
|
||||
"options": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"*keyword=value* options passed to plugin, can be repeated."
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"command"
|
||||
],
|
||||
"properties": {
|
||||
"command": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"start",
|
||||
"stop",
|
||||
"rescan",
|
||||
"startdir",
|
||||
"list"
|
||||
],
|
||||
"description": [
|
||||
"The subcommand this is responding to."
|
||||
]
|
||||
}
|
||||
},
|
||||
"allOf": [
|
||||
{
|
||||
"if": {
|
||||
"properties": {
|
||||
"command": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"start",
|
||||
"startdir",
|
||||
"rescan",
|
||||
"list"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"then": {
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"command",
|
||||
"plugins"
|
||||
],
|
||||
"properties": {
|
||||
"command": {},
|
||||
"plugins": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"name",
|
||||
"active",
|
||||
"dynamic"
|
||||
],
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Full pathname of the plugin."
|
||||
]
|
||||
},
|
||||
"active": {
|
||||
"type": "boolean",
|
||||
"description": [
|
||||
"Status; plugin completed init and is operational, plugins are configured asynchronously."
|
||||
]
|
||||
},
|
||||
"dynamic": {
|
||||
"type": "boolean",
|
||||
"description": [
|
||||
"Plugin can be stopped or started without restarting lightningd."
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"if": {
|
||||
"properties": {
|
||||
"command": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"stop"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"then": {
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"command",
|
||||
"result"
|
||||
],
|
||||
"properties": {
|
||||
"command": {},
|
||||
"result": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"A message saying it successfully stopped."
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"errors": [
|
||||
"On error, the reason why the action could not be taken upon the plugin is returned."
|
||||
],
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:plugin#1",
|
||||
"method": "plugin",
|
||||
"params": [
|
||||
"list"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "example:plugin#2",
|
||||
"method": "plugin",
|
||||
"params": {
|
||||
"subcommand": "stop",
|
||||
"plugin": "fail_htlcs.py"
|
||||
}
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"command": "list",
|
||||
"plugins": [
|
||||
{
|
||||
"name": "~/lightning/plugins/autoclean",
|
||||
"active": true,
|
||||
"dynamic": false
|
||||
},
|
||||
{
|
||||
"name": "~/lightning/plugins/chanbackup",
|
||||
"active": true,
|
||||
"dynamic": false
|
||||
},
|
||||
{
|
||||
"name": "~/lightning/plugins/bcli",
|
||||
"active": true,
|
||||
"dynamic": false
|
||||
},
|
||||
{
|
||||
"name": "~/lightning/plugins/commando",
|
||||
"active": true,
|
||||
"dynamic": false
|
||||
},
|
||||
{
|
||||
"name": "~/lightning/plugins/funder",
|
||||
"active": true,
|
||||
"dynamic": true
|
||||
},
|
||||
{
|
||||
"name": "~/lightning/plugins/topology",
|
||||
"active": true,
|
||||
"dynamic": false
|
||||
},
|
||||
{
|
||||
"name": "~/lightning/plugins/keysend",
|
||||
"active": true,
|
||||
"dynamic": false
|
||||
},
|
||||
{
|
||||
"name": "~/lightning/plugins/offers",
|
||||
"active": true,
|
||||
"dynamic": true
|
||||
},
|
||||
{
|
||||
"name": "~/lightning/plugins/pay",
|
||||
"active": true,
|
||||
"dynamic": true
|
||||
},
|
||||
{
|
||||
"name": "~/lightning/plugins/txprepare",
|
||||
"active": true,
|
||||
"dynamic": true
|
||||
},
|
||||
{
|
||||
"name": "~/lightning/plugins/cln-renepay",
|
||||
"active": true,
|
||||
"dynamic": true
|
||||
},
|
||||
{
|
||||
"name": "~/lightning/plugins/spenderp",
|
||||
"active": true,
|
||||
"dynamic": false
|
||||
},
|
||||
{
|
||||
"name": "~/lightning/plugins/sql",
|
||||
"active": true,
|
||||
"dynamic": true
|
||||
},
|
||||
{
|
||||
"name": "~/lightning/plugins/bookkeeper",
|
||||
"active": true,
|
||||
"dynamic": false
|
||||
},
|
||||
{
|
||||
"name": "~/lightning/target/debug/examples/cln-plugin-startup",
|
||||
"active": true,
|
||||
"dynamic": false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"command": "stop",
|
||||
"result": "Successfully stopped fail_htlcs.py."
|
||||
}
|
||||
],
|
||||
"author": [
|
||||
"Antoine Poinsot <<darosior@protonmail.com>> is mainly responsible."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-cli(1)",
|
||||
"lightning-listconfigs(1)",
|
||||
"[writing plugins][writing plugins]"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>",
|
||||
"",
|
||||
"[writing plugins]: PLUGINS.md"
|
||||
]
|
||||
}
|
45
doc/schemas/lightning-preapproveinvoice.json
Normal file
45
doc/schemas/lightning-preapproveinvoice.json
Normal file
|
@ -0,0 +1,45 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"added": "v23.02",
|
||||
"rpc": "preapproveinvoice",
|
||||
"title": "Ask the HSM to preapprove an invoice (low-level)",
|
||||
"description": [
|
||||
"The **preapproveinvoice** RPC command submits the *bolt11* invoice to the HSM to check that it is approved for payment.",
|
||||
"",
|
||||
"Generally the **preapproveinvoice** request does not need to be made explicitly, it is automatically generated as part of a **pay** request.",
|
||||
"",
|
||||
"By default, the HSM will approve all **preapproveinvoice** requests.",
|
||||
"",
|
||||
"If a remote signer is being used it might decline an **preapproveinvoice** request because it would exceed velocity controls, is not covered by allowlist controls, was declined manually, or other reasons.",
|
||||
"",
|
||||
"If a remote signer declines a **preapproveinvoice** request a subsequent attempt to pay the invoice anyway will fail; the signer will refuse to sign the commitment."
|
||||
],
|
||||
"request": {
|
||||
"required": [
|
||||
"bolt11"
|
||||
],
|
||||
"properties": {
|
||||
"bolt11": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Bolt11 invoice to submit to the HSM to check."
|
||||
],
|
||||
"added": "v23.02"
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"properties": {}
|
||||
},
|
||||
"author": [
|
||||
"Ken Sedgwick <<ken@bonsai.com>> is mainly responsible."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-pay(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
63
doc/schemas/lightning-preapprovekeysend.json
Normal file
63
doc/schemas/lightning-preapprovekeysend.json
Normal file
|
@ -0,0 +1,63 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"added": "v23.02",
|
||||
"rpc": "preapprovekeysend",
|
||||
"title": "Ask the HSM to preapprove a keysend payment (low-level)",
|
||||
"description": [
|
||||
"The **preapprovekeysend** RPC command submits the *destination*, *payment_hash*, and *amount_msat* parameters to the HSM to check that they are approved as a keysend payment.",
|
||||
"",
|
||||
"Generally the **preapprovekeysend** request does not need to be made explicitly, it is automatically generated as part of a **keysend** request.",
|
||||
"",
|
||||
"By default, the HSM will approve all **preapprovekeysend** requests.",
|
||||
"",
|
||||
"If a remote signer is being used it might decline an **preapprovekeysend** request because it would exceed velocity controls, is not covered by allowlist controls, was declined manually, or other reasons.",
|
||||
"",
|
||||
"If a remote signer declines a **preapprovekeysend** request a subsequent attempt to pay the keysend anyway will fail; the signer will refuse to sign the commitment."
|
||||
],
|
||||
"request": {
|
||||
"required": [
|
||||
"destination",
|
||||
"payment_hash",
|
||||
"amount_msat"
|
||||
],
|
||||
"properties": {
|
||||
"destination": {
|
||||
"type": "pubkey",
|
||||
"description": [
|
||||
"It is a 33 byte, hex-encoded, node ID of the node that the payment should go to."
|
||||
],
|
||||
"added": "v23.02"
|
||||
},
|
||||
"payment_hash": {
|
||||
"type": "hex",
|
||||
"added": "v23.02",
|
||||
"description": [
|
||||
"It is the unique identifier of a payment."
|
||||
],
|
||||
"maxLength": 64,
|
||||
"minLength": 64
|
||||
},
|
||||
"amount_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"The amount to send in millisatoshi precision; it can be a whole number, or a whole number with suffix `msat` or `sat`, or a three decimal point number with suffix `sat`, or an 1 to 11 decimal point number suffixed by `btc`."
|
||||
],
|
||||
"added": "v23.02"
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"properties": {}
|
||||
},
|
||||
"author": [
|
||||
"Ken Sedgwick <<ken@bonsai.com>> is mainly responsible."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-keysend(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
72
doc/schemas/lightning-recover.json
Normal file
72
doc/schemas/lightning-recover.json
Normal file
|
@ -0,0 +1,72 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"rpc": "recover",
|
||||
"title": "Reinitialize Your Node for Recovery",
|
||||
"description": [
|
||||
"The **recover** RPC command wipes your node and restarts it with the `--recover` option. This is only permitted if the node is unused: no channels, no bitcoin addresses issued (you can use `check` to see if recovery is possible).",
|
||||
"",
|
||||
"*hsmsecret* is either a codex32 secret starting with \"cl1\" as returned by `hsmtool getcodexsecret`, or a raw 64 character hex string.",
|
||||
"",
|
||||
"NOTE: this command only currently works with the `sqlite3` database backend."
|
||||
],
|
||||
"request": {
|
||||
"required": [
|
||||
"hsmsecret"
|
||||
],
|
||||
"properties": {
|
||||
"hsmsecret": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Either a codex32 secret starting with `cl1` as returned by `hsmtool getcodexsecret`, or a raw 64 character hex string."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"result"
|
||||
],
|
||||
"properties": {
|
||||
"result": {
|
||||
"type": "string",
|
||||
"added": "v24.05",
|
||||
"enum": [
|
||||
"Recovery restart in progress"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:recover#1",
|
||||
"method": "recover",
|
||||
"params": {
|
||||
"hsmsecret": "cl10leetsd35kw6r5de5kueedxgqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqdeuq7xuh94k9g"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "example:recover#2",
|
||||
"method": "recover",
|
||||
"params": {
|
||||
"hsmsecret": "6c696768746e696e672d31000000000000000000000000000000000000000000"
|
||||
}
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{},
|
||||
{
|
||||
"result": "Recovery restart in progress"
|
||||
}
|
||||
],
|
||||
"author": [
|
||||
"Rusty Russell <<rusty@blockstream.com>> is mainly responsible."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-hsmtool(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
71
doc/schemas/lightning-recoverchannel.json
Normal file
71
doc/schemas/lightning-recoverchannel.json
Normal file
|
@ -0,0 +1,71 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"rpc": "recoverchannel",
|
||||
"title": "Command for recovering channels bundeled in an array in the form of *Static Backup*",
|
||||
"description": [
|
||||
"The **recoverchannel** RPC command tries to force the peer (with whom you already had a channel) to close the channel and sweeps on-chain fund. This method is not spontaneous and depends on the peer, so use it in case of severe data loss.",
|
||||
"",
|
||||
"The *scb* parameter is an array containing minimum required info to reconnect and sweep funds. You can get the scb for already stored channels by using the RPC command 'staticbackup'."
|
||||
],
|
||||
"request": {
|
||||
"required": [
|
||||
"scb"
|
||||
],
|
||||
"properties": {
|
||||
"scb": {
|
||||
"type": "array",
|
||||
"description": [
|
||||
"SCB of the channels in an array."
|
||||
],
|
||||
"items": {
|
||||
"type": "hex"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"stubs"
|
||||
],
|
||||
"properties": {
|
||||
"stubs": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Channel IDs of channels successfully inserted."
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:recoverchannel#1",
|
||||
"method": "recoverchannel",
|
||||
"params": [
|
||||
[
|
||||
"0000000000000001c3a7b9d74a174497122bc52d74d6d69836acadc77e0429c6d8b68b48d5c9139a022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d5904017f0000019f0bc3a7b9d74a174497122bc52d74d6d69836acadc77e0429c6d8b68b48d5c9139a0000000000000000000186a000021000"
|
||||
]
|
||||
]
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"stubs": [
|
||||
"c3a7b9d74a174497122bc52d74d6d69836acadc77e0429c6d8b68b48d5c9139a"
|
||||
]
|
||||
}
|
||||
],
|
||||
"author": [
|
||||
"Aditya <<aditya.sharma20111@gmail.com>> is mainly responsible."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-getsharedsecret(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
216
doc/schemas/lightning-renepay.json
Normal file
216
doc/schemas/lightning-renepay.json
Normal file
|
@ -0,0 +1,216 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"rpc": "renepay",
|
||||
"title": "Command for sending a payment to a BOLT11 invoice",
|
||||
"added": "v23.08",
|
||||
"description": [
|
||||
"**renepay** is a new payment plugin based on Pickhardt-Richter optimization method for Multi-Path-Payments. This implementation has not been thoroughly tested and it should be used with caution.",
|
||||
"",
|
||||
"The response will occur when the payment fails or succeeds. Once a payment has succeeded, calls to **renepay** with the same *invstring* will not lead to a new payment attempt, but instead it will succeed immediately.",
|
||||
"",
|
||||
"When using *lightning-cli*, you may skip optional parameters by using *null*. Alternatively, use **-k** option to provide parameters by name."
|
||||
],
|
||||
"request": {
|
||||
"required": [
|
||||
"invstring"
|
||||
],
|
||||
"properties": {
|
||||
"invstring": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Bolt11 invoice which the RPC command attempts to pay. Currently, **renepay** supports bolt11 invoices only."
|
||||
]
|
||||
},
|
||||
"amount_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"If the *invstring* does not contain an amount, *amount_msat* is required, otherwise if it is specified it must be *null*. in millisatoshi precision; it can be a whole number, or a whole number with suffix *msat* or *sat*, or a three decimal point number with suffix *sat*, or an 1 to 11 decimal point number suffixed by *btc*."
|
||||
]
|
||||
},
|
||||
"maxfee": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"*maxfee* is a hard bound, in the sense that the command will never attempt a payment when the fees exceed that value."
|
||||
]
|
||||
},
|
||||
"maxdelay": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"Overrides the value of `max-locktime-blocks` for this payment. It serves to limit the locktime of funds in the payment HTLC measured in blocks."
|
||||
]
|
||||
},
|
||||
"retry_for": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"Measured in seconds specifies how much time it is allowed for the command to keep retrying the payment."
|
||||
],
|
||||
"default": "60 seconds"
|
||||
},
|
||||
"description": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Only required for bolt11 invoices which do not contain a description themselves, but contain a description hash: in this case *description* is required. *description* is then checked against the hash inside the invoice before it will be paid."
|
||||
]
|
||||
},
|
||||
"label": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Used to attach a label to payments, and is returned in lightning-listpays(7) and lightning-listsendpays(7)."
|
||||
]
|
||||
},
|
||||
"dev_use_shadow": {
|
||||
"hidden": true,
|
||||
"type": "boolean"
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"payment_preimage",
|
||||
"payment_hash",
|
||||
"created_at",
|
||||
"parts",
|
||||
"amount_msat",
|
||||
"amount_sent_msat",
|
||||
"status"
|
||||
],
|
||||
"properties": {
|
||||
"payment_preimage": {
|
||||
"type": "secret",
|
||||
"description": [
|
||||
"The proof of payment: SHA256 of this **payment_hash**."
|
||||
]
|
||||
},
|
||||
"payment_hash": {
|
||||
"type": "hash",
|
||||
"description": [
|
||||
"The hash of the *payment_preimage* which will prove payment."
|
||||
]
|
||||
},
|
||||
"created_at": {
|
||||
"type": "number",
|
||||
"description": [
|
||||
"The UNIX timestamp showing when this payment was initiated."
|
||||
]
|
||||
},
|
||||
"parts": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"How many attempts this took."
|
||||
]
|
||||
},
|
||||
"amount_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"Amount the recipient received."
|
||||
]
|
||||
},
|
||||
"amount_sent_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"Total amount we sent (including fees)."
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"complete",
|
||||
"pending",
|
||||
"failed"
|
||||
],
|
||||
"description": [
|
||||
"Status of payment."
|
||||
]
|
||||
},
|
||||
"destination": {
|
||||
"type": "pubkey",
|
||||
"description": [
|
||||
"The final destination of the payment."
|
||||
]
|
||||
}
|
||||
},
|
||||
"post_return_value_notes": [
|
||||
"You can monitor the progress and retries of a payment using the lightning-renepaystatus(7) command."
|
||||
]
|
||||
},
|
||||
"optimality": [
|
||||
"**renepay** is based on the work by Pickhardt-Richter's *Optimally Reliable & Cheap Payment Flows on the Lightning Network*. Which means the payment command will prefer routes that have a higher probability of success while keeping fees low.",
|
||||
"",
|
||||
"The algorithm records some partial knowledge of the state of the Network deduced from the responses obtained after evey payment attempt. This knowledge is kept through different payment requests, but decays with time to account for the dynamics of the Network (after 1 hour all previous knowledge will be erased). Knowledge from previous payment attempts increases the reliability for subsequent ones.",
|
||||
"",
|
||||
"Higher probabilities of success and lower fees cannot generally by optimized at once. Hence **renepay** combines the two in different amounts seeking solutions that satisfy *maxfee* bound and a target for 90% probability of success. *maxfee* is a hard bound, in the sense that the command will never attempt a payment when the fees exceed that value. While the probability target is not compulsory (but desirable), i.e. if the best route does not satisfy the 90% probability target it will be tried anyways.",
|
||||
"",
|
||||
"When *maxfee* and the 90% probability bounds are satified, the algorithm will optimize the fees to its lowest value."
|
||||
],
|
||||
"randomization": [
|
||||
"To protect user privacy, the payment algorithm performs *shadow route* randomization. Which means the payment algorithm will virtually extend the route by adding delays and fees along it, making it appear to intermediate nodes that the route is longer than it actually is. This prevents intermediate nodes from reliably guessing their distance from the payee.",
|
||||
"",
|
||||
"Route randomization will never exceed *maxfee* of the payment. Route randomization and shadow routing will not take routes that would exceed *maxdelay*."
|
||||
],
|
||||
"errors": [
|
||||
"The following error codes may occur:",
|
||||
"",
|
||||
"- -1: Catchall nonspecific error.",
|
||||
"- 200: Other payment attempts are in progress.",
|
||||
"- 203: Permanent failure at destination.",
|
||||
"- 205: Unable to find a route.",
|
||||
"- 206: Payment routes are too expensive.",
|
||||
"- 207: Invoice expired. Payment took too long before expiration, or already expired at the time you initiated payment.",
|
||||
"- 210: Payment timed out without a payment in progress.",
|
||||
"- 212: Invoice is invalid."
|
||||
],
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:renepay#1",
|
||||
"method": "renepay",
|
||||
"params": {
|
||||
"invstring": "lnbcrt1230n1pjmxj9jsp5suc4cag0lv3wemllkvms56e6ll0w867cczqfttuu8cpfl089f9kspp56wvxtdh8fxg5r5y3kg3klxceakqaydskwzatga25v95da8nzkmwqdqjv3jhxcmjd9c8g6t0dcxqyjw5qcqp99qxpqysgqkmyhymt0j7hy38vzqxx465s4ys0fg78flnjqfx4clvdq9mrmgglpcnjrrnhtk7maa87pfvjez88hke8w97zvuecwswaf9gzyqlsthegpza67eu"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "example:renepay#2",
|
||||
"method": "renepay",
|
||||
"params": {
|
||||
"invstring": "lnbcrt1pja0f9asp50kzadmeyy78eymjvhnlk5dznl3g5k5x8agh52ewjtg0jclas4ylspp5crsutd9hg05lxyhzphdcuyng6z3knrsdae83mxwawa842gz3vj3sdqjv3jhxcmjd9c8g6t0dcxqyjw5qcqp99qxpqysgqr5yzhxmup4muyaz6x8u2dy4qyu9t5qzuf5k9xayvj5kg7tve60gjk4jrv2l76exnj2xkuzhtwky23pkkxedzy6p9yrsgyqdwj7dv5gsp4zcw6v",
|
||||
"amount_msat": 548925
|
||||
}
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"payment_preimage": "0a3fd704b34f47d6e306dbac78141753be83848d3a19725c972abfc367dcc591",
|
||||
"payment_hash": "d39865b6e7499141d091b2236f9b19ed81d2361670bab475546168de9e62b6dc",
|
||||
"created_at": 1706248370.6267352,
|
||||
"parts": 1,
|
||||
"amount_msat": 123000,
|
||||
"amount_sent_msat": 123000,
|
||||
"status": "complete",
|
||||
"destination": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59"
|
||||
},
|
||||
{
|
||||
"payment_preimage": "a635e92d024beebfc58519e6544888aa560ba3bcaba7e74924e4b8432eaa56f5",
|
||||
"payment_hash": "c0e1c5b4b743e9f312e20ddb8e1268d0a3698e0dee4f1d99dd774f55205164a3",
|
||||
"created_at": 1708631229.7841823,
|
||||
"parts": 1,
|
||||
"amount_msat": 548925,
|
||||
"amount_sent_msat": 548925,
|
||||
"status": "complete",
|
||||
"destination": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59"
|
||||
}
|
||||
],
|
||||
"author": [
|
||||
"Eduardo Quintana-Miranda <<eduardo.quintana@pm.me>> is mainly responsible."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-renepaystatus(7)",
|
||||
"lightning-listpays(7)",
|
||||
"lightning-invoice(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>",
|
||||
"",
|
||||
"Pickhardt R. and Richter S., *Optimally Reliable & Cheap Payment Flows on the Lightning Network* <https://arxiv.org/abs/2107.05322>"
|
||||
]
|
||||
}
|
139
doc/schemas/lightning-renepaystatus.json
Normal file
139
doc/schemas/lightning-renepaystatus.json
Normal file
|
@ -0,0 +1,139 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"rpc": "renepaystatus",
|
||||
"title": "Command for quering the status of previous renepay attempts",
|
||||
"added": "v23.08",
|
||||
"description": [
|
||||
"The **renepaystatus** RPC command queries the payment plugin **renepay** for the status of previous payment attempts.",
|
||||
"",
|
||||
"This command always succeeds."
|
||||
],
|
||||
"request": {
|
||||
"required": [],
|
||||
"properties": {
|
||||
"invstring": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"If specified, the command will return a list of payment attempts whose invoice matches *invstring*, otherwise all payments with be listed."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"paystatus"
|
||||
],
|
||||
"properties": {
|
||||
"paystatus": {
|
||||
"type": "array",
|
||||
"description": [
|
||||
"A list of payments attempted by renepay."
|
||||
],
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"bolt11",
|
||||
"payment_hash",
|
||||
"created_at",
|
||||
"groupid",
|
||||
"amount_msat",
|
||||
"status",
|
||||
"notes"
|
||||
],
|
||||
"properties": {
|
||||
"bolt11": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Invoice string BOLT11."
|
||||
]
|
||||
},
|
||||
"payment_preimage": {
|
||||
"type": "secret",
|
||||
"description": [
|
||||
"The proof of payment: SHA256 of this **payment_hash** (for completed payments only)."
|
||||
]
|
||||
},
|
||||
"payment_hash": {
|
||||
"type": "hash",
|
||||
"description": [
|
||||
"The hash of the *payment_preimage* which will prove payment."
|
||||
]
|
||||
},
|
||||
"created_at": {
|
||||
"type": "number",
|
||||
"description": [
|
||||
"The UNIX timestamp showing when this payment was initiated."
|
||||
]
|
||||
},
|
||||
"groupid": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"The id for this payment attempt."
|
||||
]
|
||||
},
|
||||
"parts": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"How many attempts this took."
|
||||
]
|
||||
},
|
||||
"amount_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"Amount the recipient received."
|
||||
]
|
||||
},
|
||||
"amount_sent_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"Total amount we sent including fees (for completed payments only)."
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"complete",
|
||||
"pending",
|
||||
"failed"
|
||||
],
|
||||
"description": [
|
||||
"Status of payment."
|
||||
]
|
||||
},
|
||||
"destination": {
|
||||
"type": "pubkey",
|
||||
"description": [
|
||||
"The final destination of the payment."
|
||||
]
|
||||
},
|
||||
"notes": {
|
||||
"type": "array",
|
||||
"description": [
|
||||
"A list of messages for debugging purposes."
|
||||
],
|
||||
"items": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"A message generated by renepay."
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"author": [
|
||||
"Eduardo Quintana-Miranda <<eduardo.quintana@pm.me>> is mainly responsible."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-renepay(7)",
|
||||
"lightning-listpays(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
230
doc/schemas/lightning-reserveinputs.json
Normal file
230
doc/schemas/lightning-reserveinputs.json
Normal file
|
@ -0,0 +1,230 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"rpc": "reserveinputs",
|
||||
"title": "Construct a transaction and reserve the UTXOs it spends",
|
||||
"description": [
|
||||
"The **reserveinputs** RPC command places (or increases) reservations on any inputs specified in *psbt* which are known to lightningd. It will fail with an error if any of the inputs are known to be spent, and ignore inputs which are unknown.",
|
||||
"",
|
||||
"Normally the command will fail (with no reservations made) if an input is already reserved."
|
||||
],
|
||||
"request": {
|
||||
"required": [
|
||||
"psbt"
|
||||
],
|
||||
"properties": {
|
||||
"psbt": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The PSBT to reserve inputs from."
|
||||
]
|
||||
},
|
||||
"exclusive": {
|
||||
"type": "boolean",
|
||||
"description": [
|
||||
"If set to *False*, existing reservations are simply extended, rather than causing failure."
|
||||
]
|
||||
},
|
||||
"reserve": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"The number of blocks to reserve. By default, reservations are for the next 72 blocks (approximately 6 hours)."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"reservations"
|
||||
],
|
||||
"properties": {
|
||||
"reservations": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"txid",
|
||||
"vout",
|
||||
"was_reserved",
|
||||
"reserved",
|
||||
"reserved_to_block"
|
||||
],
|
||||
"properties": {
|
||||
"txid": {
|
||||
"type": "txid",
|
||||
"description": [
|
||||
"The input transaction id."
|
||||
]
|
||||
},
|
||||
"vout": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"The input index output number which was reserved."
|
||||
]
|
||||
},
|
||||
"was_reserved": {
|
||||
"type": "boolean",
|
||||
"description": [
|
||||
"Whether the input was already reserved."
|
||||
]
|
||||
},
|
||||
"reserved": {
|
||||
"type": "boolean",
|
||||
"enum": [
|
||||
true
|
||||
],
|
||||
"description": [
|
||||
"Whether the input is now reserved."
|
||||
]
|
||||
},
|
||||
"reserved_to_block": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"What blockheight the reservation will expire."
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"errors": [
|
||||
"On failure, an error is reported and no UTXOs are reserved.",
|
||||
"",
|
||||
"- -32602: Invalid parameter, such as specifying a spent/reserved input in *psbt*."
|
||||
],
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:reserveinputs#1",
|
||||
"method": "reserveinputs",
|
||||
"params": {
|
||||
"psbt": "cHNidP8BAFwCAAAAAkwJVUqB0xXTO7JZ3PnPdGnxoYfQxhU+xqXGFYXsyX0RAAAAAAD9////TAlVSoHTFdM7slnc+c90afGhh9DGFT7GpcYVhezJfREBAAAAAP3///8AAAAAAAAAAA==",
|
||||
"exclusive": true,
|
||||
"reserve": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "example:reserveinputs#2",
|
||||
"method": "reserveinputs",
|
||||
"params": {
|
||||
"psbt": "cHNidP8BAP32AQIAAAAMgnW099dbh1uD153ih5eU5WhluynLxekXjAOjkEdNBg8BAAAAAP3///9FWKQt8C+1y4741+beFSqWAaj9DuvzHNpxvpxS+GB8lwEAAAAA/f///6E5TAGqktI29Oso6b9kZZoAFFGGvpJQUM8VO+3LMTlmAAAAAAD9////nSDT7hrkuoQtAV1yNnbpkJsB5ifKoM2zP+CcLPfis1gBAAAAAP3///+P1rW90UXfD0gIk58h3sXxxy3ZfJJLP0H1I4Jpzy/87QEAAAAA/f///w0UKZ/s9DnPpV+FJ8h2BEI7tl+qVxSGRFRv9FYw4girAQAAAAD9////EPNsUFrEOZyfjbqbh8rfHQ4C9RQECw12n3c1yhFqkzoAAAAAAP3///8QW9LEsSmuvSnvVzy+FDktM7ewQmZnIJI/TJMahLmSzwEAAAAA/f///+4edbWRHDdRJcMeHHElgSmb+nENPsz/g/0AmAEU6hXeAAAAAAD9////T15YLGmk7HBsrL+awdcxi3db3esp8AcCTS9XGrEnfoAAAAAAAP3///8q7xInvEk7J0Ir9cpKXqU2lArUskkYLrimIE0+Yb6a2QEAAAAA/f///8hBLKyMa2zRJqwNOk7DmsDIfG7IvJtQiJ+QnkkHl6atAAAAAAD9////AAAAAAAAAAAAAAAAAAAAAAAA",
|
||||
"exclusive": false,
|
||||
"reserve": null
|
||||
}
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"reservations": [
|
||||
{
|
||||
"txid": "117dc9ec8515c6a5c63e15c6d087a1f16974cff9dc59b23bd315d3814a55094c",
|
||||
"vout": 1,
|
||||
"was_reserved": false,
|
||||
"reserved": true,
|
||||
"reserved_to_block": 175
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"reservations": [
|
||||
{
|
||||
"txid": "0f064d4790a3038c17e9c5cb29bb6568e5949787e29dd7835b875bd7f7b47582",
|
||||
"vout": 1,
|
||||
"was_reserved": true,
|
||||
"reserved": true,
|
||||
"reserved_to_block": 246
|
||||
},
|
||||
{
|
||||
"txid": "977c60f8529cbe71da1cf3eb0efda801962a15dee6d7f88ecbb52ff02da45845",
|
||||
"vout": 1,
|
||||
"was_reserved": true,
|
||||
"reserved": true,
|
||||
"reserved_to_block": 246
|
||||
},
|
||||
{
|
||||
"txid": "663931cbed3b15cf505092be865114009a6564bfe928ebf436d292aa014c39a1",
|
||||
"vout": 0,
|
||||
"was_reserved": true,
|
||||
"reserved": true,
|
||||
"reserved_to_block": 246
|
||||
},
|
||||
{
|
||||
"txid": "58b3e2f72c9ce03fb3cda0ca27e6019b90e97636725d012d84bae41aeed3209d",
|
||||
"vout": 1,
|
||||
"was_reserved": true,
|
||||
"reserved": true,
|
||||
"reserved_to_block": 246
|
||||
},
|
||||
{
|
||||
"txid": "edfc2fcf698223f5413f4b927cd92dc7f1c5de219f9308480fdf45d1bdb5d68f",
|
||||
"vout": 1,
|
||||
"was_reserved": true,
|
||||
"reserved": true,
|
||||
"reserved_to_block": 246
|
||||
},
|
||||
{
|
||||
"txid": "ab08e23056f46f5444861457aa5fb63b420476c827855fa5cf39f4ec9f29140d",
|
||||
"vout": 1,
|
||||
"was_reserved": true,
|
||||
"reserved": true,
|
||||
"reserved_to_block": 246
|
||||
},
|
||||
{
|
||||
"txid": "3a936a11ca35779f760d0b0414f5020e1ddfca879bba8d9f9c39c45a506cf310",
|
||||
"vout": 0,
|
||||
"was_reserved": true,
|
||||
"reserved": true,
|
||||
"reserved_to_block": 246
|
||||
},
|
||||
{
|
||||
"txid": "cf92b9841a934c3f9220676642b0b7332d3914be3c57ef29bdae29b1c4d25b10",
|
||||
"vout": 1,
|
||||
"was_reserved": true,
|
||||
"reserved": true,
|
||||
"reserved_to_block": 246
|
||||
},
|
||||
{
|
||||
"txid": "de15ea14019800fd83ffcc3e0d71fa9b298125711c1ec32551371c91b5751eee",
|
||||
"vout": 0,
|
||||
"was_reserved": true,
|
||||
"reserved": true,
|
||||
"reserved_to_block": 246
|
||||
},
|
||||
{
|
||||
"txid": "807e27b11a572f4d0207f029ebdd5b778b31d7c19abfac6c70eca4692c585e4f",
|
||||
"vout": 0,
|
||||
"was_reserved": true,
|
||||
"reserved": true,
|
||||
"reserved_to_block": 246
|
||||
},
|
||||
{
|
||||
"txid": "d99abe613e4d20a6b82e1849b2d40a9436a55e4acaf52b42273b49bc2712ef2a",
|
||||
"vout": 1,
|
||||
"was_reserved": true,
|
||||
"reserved": true,
|
||||
"reserved_to_block": 246
|
||||
},
|
||||
{
|
||||
"txid": "ada69707499e909f88509bbcc86e7cc8c09ac34e3a0dac26d16c6b8cac2c41c8",
|
||||
"vout": 0,
|
||||
"was_reserved": true,
|
||||
"reserved": true,
|
||||
"reserved_to_block": 246
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"author": [
|
||||
"Lisa Neigut <<niftynei@gmail.com>> is mainly responsible."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-unreserveinputs(7)",
|
||||
"lightning-signpsbt(7)",
|
||||
"lightning-sendpsbt(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
76
doc/schemas/lightning-sendcustommsg.json
Normal file
76
doc/schemas/lightning-sendcustommsg.json
Normal file
|
@ -0,0 +1,76 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"added": "v0.10.1",
|
||||
"rpc": "sendcustommsg",
|
||||
"title": "Low-level interface to send protocol messages to peers",
|
||||
"description": [
|
||||
"The `sendcustommsg` RPC method allows the user to inject a custom message into the communication with the peer with the given `node_id`. This is intended as a low-level interface to implement custom protocol extensions on top, not for direct use by end-users.",
|
||||
"",
|
||||
"On the receiving end a plugin may implement the `custommsg` plugin hook and get notified about incoming messages, and allow additional unknown even types in their getmanifest response."
|
||||
],
|
||||
"request": {
|
||||
"required": [
|
||||
"node_id",
|
||||
"msg"
|
||||
],
|
||||
"properties": {
|
||||
"node_id": {
|
||||
"type": "pubkey",
|
||||
"description": [
|
||||
"The node specified by `node_id` must be a peer, i.e., it must have a direct connection with the node receiving the RPC call, and the connection must be established. For a method to send arbitrary messages over multiple hops, including hops that do not understand the custom message, see the `createonion` and `sendonion` RPC methods. Messages can only be injected if the connection is handled by `openingd` or `channeld`. Messages cannot be injected when the peer is handled by `onchaind` or `closingd` since these do not have a connection, or are synchronous daemons that do not handle spontaneous messages."
|
||||
]
|
||||
},
|
||||
"msg": {
|
||||
"type": "hex",
|
||||
"description": [
|
||||
"Must be a hex encoded well-formed message, including the 2-byte type prefix, but excluding the length prefix which will be added by the RPC method. The message types may not be one of the internally handled types, since that may cause issues with the internal state tracking of Core Lightning. We do (as of *v23.11*) allow sending of even types, but note that peers (as per the spec) will disconnect on receiving unknown even types."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"status"
|
||||
],
|
||||
"properties": {
|
||||
"status": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Information about where message was queued."
|
||||
]
|
||||
}
|
||||
},
|
||||
"pre_return_value_notes": [
|
||||
"The method will validate the arguments and queue the message for delivery through the daemon that is currently handling the connection. Queuing provides best effort guarantees and the message may not be delivered if the connection is terminated while the message is queued. The RPC method will return as soon as the message is queued.",
|
||||
"",
|
||||
"If any of the above limitations is not respected the method returns an explicit error message stating the issue."
|
||||
]
|
||||
},
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:sendcustommsg#5",
|
||||
"method": "sendcustommsg",
|
||||
"params": {
|
||||
"node_id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518",
|
||||
"msg": "77770012"
|
||||
}
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"status": "Message sent to connectd for delivery"
|
||||
}
|
||||
],
|
||||
"author": [
|
||||
"Christian Decker <<decker.christian@gmail.com>> is mainly responsible."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-createonion(7)",
|
||||
"lightning-sendonion(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
237
doc/schemas/lightning-sendinvoice.json
Normal file
237
doc/schemas/lightning-sendinvoice.json
Normal file
|
@ -0,0 +1,237 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"rpc": "sendinvoice",
|
||||
"title": "Command for send an invoice for an offer",
|
||||
"warning": "experimental-offers only",
|
||||
"description": [
|
||||
"The **sendinvoice** RPC command creates and sends an invoice to the issuer of an *invoice_request* for it to pay: lightning-invoicerequest(7).",
|
||||
"",
|
||||
"If **fetchinvoice-noconnect** is not specified in the configuation, it will connect to the destination in the (currently common!) case where it cannot find a route which supports `option_onion_messages`."
|
||||
],
|
||||
"request": {
|
||||
"required": [
|
||||
"invreq",
|
||||
"label"
|
||||
],
|
||||
"properties": {
|
||||
"invreq": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The bolt12 invoice_request string beginning with `lnr1`."
|
||||
]
|
||||
},
|
||||
"label": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"type": "integer"
|
||||
}
|
||||
],
|
||||
"description": [
|
||||
"The unique label to use for this invoice."
|
||||
]
|
||||
},
|
||||
"amount_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"Required if the *offer* does not specify an amount at all, or specifies it in a different currency. Otherwise you may set it (e.g. to provide a tip)."
|
||||
],
|
||||
"default": "the amount contained in the offer (multiplied by *quantity* if any)"
|
||||
},
|
||||
"timeout": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"Seconds to wait for the offering node to pay the invoice or return an error. This will also be the timeout on the invoice that is sent."
|
||||
],
|
||||
"default": "90 seconds"
|
||||
},
|
||||
"quantity": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"Quantity is is required if the offer specifies quantity_max, otherwise it is not allowed."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"label",
|
||||
"description",
|
||||
"payment_hash",
|
||||
"status",
|
||||
"created_index",
|
||||
"expires_at"
|
||||
],
|
||||
"properties": {
|
||||
"label": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Unique label supplied at invoice creation."
|
||||
]
|
||||
},
|
||||
"description": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Description used in the invoice."
|
||||
]
|
||||
},
|
||||
"payment_hash": {
|
||||
"type": "hash",
|
||||
"description": [
|
||||
"The hash of the *payment_preimage* which will prove payment."
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"unpaid",
|
||||
"paid",
|
||||
"expired"
|
||||
],
|
||||
"description": [
|
||||
"Whether it's paid, unpaid or unpayable."
|
||||
]
|
||||
},
|
||||
"expires_at": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"UNIX timestamp of when it will become / became unpayable."
|
||||
]
|
||||
},
|
||||
"amount_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"The amount required to pay this invoice."
|
||||
]
|
||||
},
|
||||
"bolt12": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The BOLT12 string."
|
||||
]
|
||||
},
|
||||
"created_index": {
|
||||
"type": "u64",
|
||||
"added": "v23.08",
|
||||
"description": [
|
||||
"1-based index indicating order this invoice was created in."
|
||||
]
|
||||
},
|
||||
"updated_index": {
|
||||
"type": "u64",
|
||||
"added": "v23.08",
|
||||
"description": [
|
||||
"1-based index indicating order this invoice was changed (only present if it has changed since creation)."
|
||||
]
|
||||
}
|
||||
},
|
||||
"allOf": [
|
||||
{
|
||||
"if": {
|
||||
"properties": {
|
||||
"status": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"paid"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"then": {
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"pay_index",
|
||||
"amount_received_msat",
|
||||
"paid_at",
|
||||
"payment_preimage"
|
||||
],
|
||||
"properties": {
|
||||
"label": {},
|
||||
"description": {},
|
||||
"payment_hash": {},
|
||||
"status": {},
|
||||
"msatoshi": {},
|
||||
"amount_msat": {},
|
||||
"bolt12": {},
|
||||
"expires_at": {},
|
||||
"created_index": {},
|
||||
"updated_index": {},
|
||||
"pay_index": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"Unique incrementing index for this payment."
|
||||
]
|
||||
},
|
||||
"amount_received_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"The amount actually received (could be slightly greater than *amount_msat*, since clients may overpay)."
|
||||
]
|
||||
},
|
||||
"paid_at": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"UNIX timestamp of when it was paid."
|
||||
]
|
||||
},
|
||||
"payment_preimage": {
|
||||
"type": "secret",
|
||||
"description": [
|
||||
"Proof of payment."
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"errors": [
|
||||
"The following error codes may occur:",
|
||||
"",
|
||||
"- -1: Catchall nonspecific error.",
|
||||
"- 1002: Offer has expired.",
|
||||
"- 1003: Cannot find a route to the node making the offer.",
|
||||
"- 1004: The node making the offer returned an error message.",
|
||||
"- 1005: We timed out waiting for the invoice to be paid"
|
||||
],
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:sendinvoice#1",
|
||||
"method": "sendinvoice",
|
||||
"params": {
|
||||
"invreq": "lnr1qqg804wzdsyn8g4mf2yc22k8xvjpjzstwd5k6urvv5s8getnw3gzqp3zderpzxstt8927ynqg044h0egcd8n5h3n9g0u0v4h8ncc3yg02gqsykppqgkjyd3q5dv6gllh77kygly9c3kfy0d9xwyjyxsq2nq3c83u5vw4nuzqw5w7y7xqm2rushk5a5n3mcuvqel954raykd5nqa830nq9hpd4s4fcnxw266vp9d5c8f3m3w40hmm6gm8akxx3rsnr7d4usunv0x3q8q",
|
||||
"label": "payme for real!"
|
||||
}
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"label": "payme for real!",
|
||||
"bolt12": "lni1qqg804wzdsyn8g4mf2yc22k8xvjpjzstwd5k6urvv5s8getnw3gzqp3zderpzxstt8927ynqg044h0egcd8n5h3n9g0u0v4h8ncc3yg02gqsykppqgkjyd3q5dv6gllh77kygly9c3kfy0d9xwyjyxsq2nq3c83u5vw4ngycqdwjkyvjm7apxnssu4qgwhfkd67ghs6n6k48v6uqczgt88p6tky96qmcmtl30xtt7jdakfyhzm8f0gny6f4d2ukx5gurem04z8lfd2wza5qs9pz6wp9vu7cm6n4wmmrz77y4w6z5xv4q93yudkdtkl5zmzdzuawzqqex7gd5v0x0r83pqj82udd542fl4krh50s0dkx47d0hd5wh77g52xxl75ccpkt35mc8n282wslju9ufyys2y8qqqqqqqqqqqqqqqpgqqqqqqqqqqqqp6f9jm7k9yqqqqqq2gpr96l99lfspt25zqnyfgu7hznmt2tzkjdt92d2wc3dsq7keph7w8gudjs46spfzqrlu4gqs9vppqdwjkyvjm7apxnssu4qgwhfkd67ghs6n6k48v6uqczgt88p6tky9muzqpze8kk43g0wh4h8qlac5lswwesrvsaxcza2f5j90c2h3ts8yzmn9g4mxqe89fngrqny8nf52xxuxep6548etda8lp876jr0nnxgdkdq",
|
||||
"payment_hash": "4c89473d714f6b52c56935655354ec45b007ad90dfce3a38d942ba8052200ffc",
|
||||
"amount_msat": 2,
|
||||
"status": "paid",
|
||||
"pay_index": 1,
|
||||
"amount_received_msat": 2,
|
||||
"paid_at": 1708640865,
|
||||
"payment_preimage": "305951ab02cb2ea5eb884dbfd8fb110b4e088ecb8338b3e84e8f9c70919c19bf",
|
||||
"description": "simple test",
|
||||
"expires_at": 1708640953,
|
||||
"created_index": 2,
|
||||
"updated_index": 1
|
||||
}
|
||||
],
|
||||
"author": [
|
||||
"Rusty Russell <<rusty@rustcorp.com.au>> is mainly responsible."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-fetchinvoice(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
364
doc/schemas/lightning-sendonion.json
Normal file
364
doc/schemas/lightning-sendonion.json
Normal file
|
@ -0,0 +1,364 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"rpc": "sendonion",
|
||||
"title": "Send a payment with a custom onion packet",
|
||||
"description": [
|
||||
"The **sendonion** RPC command can be used to initiate a payment attempt with a custom onion packet. The onion packet is used to deliver instructions for hops along the route on how to behave. Normally these instructions are indications on where to forward a payment and what parameters to use, or contain details of the payment for the final hop. However, it is possible to add arbitrary information for hops in the custom onion, allowing for custom extensions that are not directly supported by Core Lightning.",
|
||||
"",
|
||||
"If the first element of *route* does not have \"channel\" set, a suitable channel (if any) will be chosen, otherwise that specific short-channel-id is used. The following is an example of a 3 hop onion:",
|
||||
"",
|
||||
"```json",
|
||||
"[",
|
||||
" \"298606954e9de3e9d938d18a74fed794c440e8eda82e52dc08600953c8acf9c4\",",
|
||||
" \"2dc094de72adb03b90894192edf9f67919cb2691b37b1f7d4a2f4f31c108b087\",",
|
||||
" \"a7b82b240dbd77a4ac8ea07709b1395d8c510c73c17b4b392bb1f0605d989c85\"",
|
||||
"]",
|
||||
"```"
|
||||
],
|
||||
"request": {
|
||||
"required": [
|
||||
"onion",
|
||||
"first_hop",
|
||||
"payment_hash"
|
||||
],
|
||||
"properties": {
|
||||
"onion": {
|
||||
"type": "hex",
|
||||
"description": [
|
||||
"Hex-encoded 1366 bytes long blob that was returned by either of the tools that can generate onions. It contains the payloads destined for each hop and some metadata. Please refer to [BOLT 04][bolt04] for further details. If is specific to the route that is being used and the *payment_hash* used to construct, and therefore cannot be reused for other payments or to attempt a separate route. The custom onion can generally be created using the `devtools/onion` CLI tool, or the **createonion** RPC command."
|
||||
]
|
||||
},
|
||||
"first_hop": {
|
||||
"type": "object",
|
||||
"description": [
|
||||
"Instructs Core Lightning which peer to send the onion to. It is a JSON dictionary that corresponds to the first element of the route array returned by *getroute*."
|
||||
],
|
||||
"required": [
|
||||
"id",
|
||||
"amount_msat",
|
||||
"delay"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "pubkey",
|
||||
"description": [
|
||||
"Node id for the peer. Use any available channel available to this peer."
|
||||
]
|
||||
},
|
||||
"amount_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"The amount to add an HTLC for millisatoshis."
|
||||
]
|
||||
},
|
||||
"delay": {
|
||||
"type": "u16",
|
||||
"description": [
|
||||
"The number of blocks delay of blocks on top of the current blockheight."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"payment_hash": {
|
||||
"type": "hash",
|
||||
"description": [
|
||||
"Specifies the 32 byte hex-encoded hash to use as a challenge to the HTLC that we are sending. It is specific to the onion and has to match the one the onion was created with."
|
||||
]
|
||||
},
|
||||
"label": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Can be used to provide a human readable reference to retrieve the payment at a later time."
|
||||
]
|
||||
},
|
||||
"shared_secrets": {
|
||||
"type": "array",
|
||||
"description": [
|
||||
"A JSON list of 32 byte hex-encoded secrets that were used when creating the onion. Core Lightning can send a payment with a custom onion without the knowledge of these secrets, however it will not be able to parse an eventual error message since that is encrypted with the shared secrets used in the onion. If *shared_secrets* is provided Core Lightning will decrypt the error, act accordingly, e.g., add a `channel_update` included in the error to its network view, and set the details in *listsendpays* correctly. If it is not provided Core Lightning will store the encrypted onion, and expose it in *listsendpays* allowing the caller to decrypt it externally. If it is not provided the Core Lightning node does not know how long the route is, which channels or nodes are involved, and what an eventual error could have been. It can therefore be used for oblivious payments."
|
||||
],
|
||||
"items": {
|
||||
"type": "secret"
|
||||
}
|
||||
},
|
||||
"partid": {
|
||||
"type": "u16",
|
||||
"description": [
|
||||
"If provided and non-zero, allows for multiple parallel partial payments with the same *payment_hash*."
|
||||
]
|
||||
},
|
||||
"bolt11": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"If provided, it will be returned in *waitsendpay* and *listsendpays* results."
|
||||
]
|
||||
},
|
||||
"amount_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"Used to annotate the payment, and is returned by *waitsendpay* and *listsendpays*."
|
||||
]
|
||||
},
|
||||
"destination": {
|
||||
"type": "pubkey",
|
||||
"description": [
|
||||
"If provided, it will be returned in **listpays** result."
|
||||
]
|
||||
},
|
||||
"localinvreqid": {
|
||||
"type": "hash",
|
||||
"description": [
|
||||
"`localinvreqid` is used by offers to link a payment attempt to a local `invoice_request` offer created by lightningd-invoicerequest(7)."
|
||||
]
|
||||
},
|
||||
"groupid": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"Grouping key to disambiguate multiple attempts to pay an invoice or the same payment_hash."
|
||||
]
|
||||
},
|
||||
"description": {
|
||||
"added": "v0.11.0",
|
||||
"type": "string",
|
||||
"description": [
|
||||
"If provided, it will be returned in *waitsendpay* and *listsendpays* results."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"created_index",
|
||||
"id",
|
||||
"payment_hash",
|
||||
"status",
|
||||
"created_at",
|
||||
"amount_sent_msat"
|
||||
],
|
||||
"properties": {
|
||||
"created_index": {
|
||||
"added": "v23.11",
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"1-based index indicating order this payment was created in."
|
||||
]
|
||||
},
|
||||
"id": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"Old synonym for created_index."
|
||||
]
|
||||
},
|
||||
"payment_hash": {
|
||||
"type": "hash",
|
||||
"description": [
|
||||
"The hash of the *payment_preimage* which will prove payment."
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"pending",
|
||||
"complete"
|
||||
],
|
||||
"description": [
|
||||
"Status of the payment (could be complete if already sent previously)."
|
||||
]
|
||||
},
|
||||
"amount_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"The amount delivered to destination (if known)."
|
||||
]
|
||||
},
|
||||
"destination": {
|
||||
"type": "pubkey",
|
||||
"description": [
|
||||
"The final destination of the payment if known."
|
||||
]
|
||||
},
|
||||
"created_at": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"The UNIX timestamp showing when this payment was initiated."
|
||||
]
|
||||
},
|
||||
"amount_sent_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"The amount sent."
|
||||
]
|
||||
},
|
||||
"label": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The label, if given to sendpay."
|
||||
]
|
||||
},
|
||||
"bolt11": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The bolt11 string (if supplied)."
|
||||
]
|
||||
},
|
||||
"bolt12": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The bolt12 string (if supplied: **experimental-offers** only)."
|
||||
]
|
||||
},
|
||||
"partid": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"The partid (if supplied) to sendonion/sendpay."
|
||||
]
|
||||
}
|
||||
},
|
||||
"allOf": [
|
||||
{
|
||||
"if": {
|
||||
"properties": {
|
||||
"status": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"complete"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"then": {
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"payment_preimage"
|
||||
],
|
||||
"properties": {
|
||||
"created_index": {},
|
||||
"id": {},
|
||||
"payment_hash": {},
|
||||
"status": {},
|
||||
"msatoshi": {},
|
||||
"amount_msat": {},
|
||||
"destination": {},
|
||||
"created_at": {},
|
||||
"groupid": {},
|
||||
"msatoshi_sent": {},
|
||||
"amount_sent_msat": {},
|
||||
"label": {},
|
||||
"bolt11": {},
|
||||
"bolt12": {},
|
||||
"partid": {},
|
||||
"updated_index": {
|
||||
"added": "v23.11",
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"1-based index indicating order this payment was changed."
|
||||
]
|
||||
},
|
||||
"payment_preimage": {
|
||||
"type": "secret",
|
||||
"description": [
|
||||
"The proof of payment: SHA256 of this **payment_hash**."
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"if": {
|
||||
"properties": {
|
||||
"status": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"pending"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"then": {
|
||||
"additionalProperties": false,
|
||||
"required": [],
|
||||
"properties": {
|
||||
"created_index": {},
|
||||
"id": {},
|
||||
"payment_hash": {},
|
||||
"status": {},
|
||||
"msatoshi": {},
|
||||
"amount_msat": {},
|
||||
"destination": {},
|
||||
"created_at": {},
|
||||
"groupid": {},
|
||||
"msatoshi_sent": {},
|
||||
"amount_sent_msat": {},
|
||||
"label": {},
|
||||
"bolt11": {},
|
||||
"bolt12": {},
|
||||
"partid": {},
|
||||
"message": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Monitor status with listpays or waitsendpay."
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"errors": [
|
||||
"The following error codes may occur:",
|
||||
"",
|
||||
"- 202: an parseable onion",
|
||||
"",
|
||||
"the error details are decrypted and presented here, if *shared_secrets* was provided and an error was returned by one of the intermediate nodes"
|
||||
],
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:sendonion#1",
|
||||
"method": "sendonion",
|
||||
"params": {
|
||||
"onion": "00034928294556b10308f9aeac7a240223d4d5f72097db1ef36a36b10cab937f2f205ed7218b47d4600eaf7fd390940bf9a6cdac99aafdb4783c468150eeeab9b57e56a06778d023ffb3bb84c7d8c2ad8868b61c28b566634af52c288ed6569583db66f5bd0edfb801c252f078020e1df6359af5969296b4698a71d17c5ca6e5ee4b64b7cce3ad0a1aa31e6be4d5fe3a31fa7a25259c640716020a9a248ca3ebb68eb823f8884b5df3710969f4c2ffb153779a923bab946ed43c1f6658d7f8e7e25303bb78ef4862fb550b8b1c79d522b035eedfda9ab70a61322522acf7233bb8ea2423958448fc8ac3d000835fda04bf661f1bf2ad2d091f506840bb2f10f82c0812149d99267a47824defe90877ed70db526b2200e18dccb92b17516de3778c055645728eadf4c74375aa0aae80a7773a536a908ca1e25c0fdca90e50ce0be05eeb973ec5e83ce3ab6b35818e021780428af81320a694483c1c15f64e685ba1fd3b1e1b926e6b4ec9eeeac8aca60c60e0f0f583e35e7f081dc6f4c64157e100c79c4c25101bed77cd9f93416f9a67d9f1916a782c498c38365af4a5fabb1b745fa840a054a06564c3f4b376aeb72cdd059d3794c82bbbf12a1f62234016a6912b384e7e4cebbd39ee4395aeff43c461e226d1e0151cce508a181a9c61275bf4b89e4556cf24df13b993dec96541555f8b9a699be9488568a11ac7f25849da62765472511ad74a6660c10e37f5fa13d4e4665ef7825ae1f2da4a86d5581912262de89b4b11a722fd127b31aa0d7fab8c679b07bf95e65cb80b2dacb5b90794399fb8f23823f68058431aa1c399b5baceccaf8521d004f45dba6ec1fddc54473343e9e67cd50cc3f2f3d8a5dab8a7ab9ae553dc3cd34e74b858da75975265f7c673a25e8d01a5130ab40eaba712b80c608cd0431b4b45ea0d81af595e21f24976608429127bf586f7507666500bc7245cf9266fa0bd0e58404c496e190c873cd143ace9048e9d5021c23967a24e09f2e54166e54b4ee8888dc1af535624e7ee8b426c1628175017a9e8a73eb1d0d49028a4f4d77897f3c08f1cd7bdee2b00f9bb9eadc49a69bf4f6c0cb2c95a16f03d7958f1b8f83cb40ae87ddf75f26050e2c2ed9f8f8523b3d389a50b217bda651dc21f095fe7d2d3851a0a6cf01051f3f3c6f1ad59ed46d44928d15a0e6e1bd4df4c99bdb82a05b0e781b69a73bc30fe579c8ac9fe8aeb6beb1c0f44def2775b7341af37e6ef58ceb34958b29d3e36112b78644612228761b8badc802f0b2b8fcaeb1db8f3a8db4afa2d7b4540a7c331db6f5141fa3909a513df875ff8a63f5b542d662781ca96a69e3b2925d6a63555b2c5825ffb2ad848d71122f54110e0d203000f3e9cc23b793c3540dfb8d881caedd25055a8f495e9e7a0391dbf9cbd9344f7df659ee8d3ce5ec16217ab83e1394ba991eb8ffd9a869f8ebb2e2428845e779979c57b5f8875f502728229a55ce87b3eba85c75264d30eaf7b373f6b09ba3086d9e98348d87b049468c2c30a6501cb2a3862f1703bbf29895e8b4262353eae720ed8ae678750011e2eb51f4800d3f4725fa873d7deec1c46f77a5f61c73dc938239e77f432bcc245c7b935413c51c0bc92bdaae144452aa95910909e46e500557961203f4e1483b9c09c124464907825e1ff74c87c58d6e2e91970baac9b89a554beca6df9acee16d77dd929d0caa7797e06f2c384c03fdedc89c697b9c34787a50cf399a8d7f195e79b347efc8267c474a477ce210f11049d432b280eaf3fccd451f6218d35c64cbd1006bcc54eeea8b856855c9aa92bc3adc6900a7c7a0eee09834c5a1f2da3d8ea9a478aea90c954952ad2a72d3856350ac3132d17e1e8116fa774066a22c857a827699c98285111a405e74685a3ae579ae78c545774f45491e4935bf4",
|
||||
"first_hop": {
|
||||
"id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59",
|
||||
"channel": "103x3x0",
|
||||
"direction": 1,
|
||||
"amount_msat": 1002,
|
||||
"delay": 21,
|
||||
"style": "tlv"
|
||||
},
|
||||
"payment_hash": "f584c14bb23506acdd94cf3cea377f3cc5805f3cba5430bc3756ef83ede1a0dc",
|
||||
"label": null,
|
||||
"shared_secrets": null,
|
||||
"partid": null,
|
||||
"bolt11": null,
|
||||
"amount_msat": null,
|
||||
"destination": null
|
||||
}
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"message": "Monitor status with listpays or waitsendpay",
|
||||
"created_index": 1,
|
||||
"id": 1,
|
||||
"payment_hash": "f584c14bb23506acdd94cf3cea377f3cc5805f3cba5430bc3756ef83ede1a0dc",
|
||||
"groupid": 1,
|
||||
"amount_sent_msat": 1002,
|
||||
"created_at": 1706315098,
|
||||
"status": "pending"
|
||||
}
|
||||
],
|
||||
"author": [
|
||||
"Christian Decker <<decker.christian@gmail.com>> is mainly responsible."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-createonion(7)",
|
||||
"lightning-sendpay(7)",
|
||||
"lightning-listsendpays(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>",
|
||||
"",
|
||||
"[bolt04]: https://github.com/lightning/bolts/blob/master/04-onion-routing.md"
|
||||
]
|
||||
}
|
77
doc/schemas/lightning-sendonionmessage.json
Normal file
77
doc/schemas/lightning-sendonionmessage.json
Normal file
|
@ -0,0 +1,77 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"rpc": "sendonionmessage",
|
||||
"title": "low-level command to send an onion message",
|
||||
"warning": "experimental-onion-messages only",
|
||||
"description": [
|
||||
"The **sendonionmessage** RPC command can be used to send a message via the lightning network. These are currently used by *offers* to request and receive invoices."
|
||||
],
|
||||
"request": {
|
||||
"required": [
|
||||
"first_id",
|
||||
"blinding",
|
||||
"hops"
|
||||
],
|
||||
"properties": {
|
||||
"first_id": {
|
||||
"type": "pubkey",
|
||||
"description": [
|
||||
"The (presumably well-known) public key of the start of the path."
|
||||
]
|
||||
},
|
||||
"blinding": {
|
||||
"type": "pubkey",
|
||||
"description": [
|
||||
"Blinding factor for this path."
|
||||
]
|
||||
},
|
||||
"hops": {
|
||||
"type": "array",
|
||||
"description": [
|
||||
"",
|
||||
""
|
||||
],
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"node",
|
||||
"tlv"
|
||||
],
|
||||
"properties": {
|
||||
"node": {
|
||||
"type": "pubkey",
|
||||
"description": [
|
||||
"Public key of the node."
|
||||
]
|
||||
},
|
||||
"tlv": {
|
||||
"type": "u8",
|
||||
"description": [
|
||||
"Contains a hexadecimal TLV to include."
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [],
|
||||
"properties": {}
|
||||
},
|
||||
"author": [
|
||||
"Rusty Russell <<rusty@rustcorp.com.au>> is mainly responsible."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-fetchinvoice(7)",
|
||||
"lightning-offer(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>",
|
||||
"",
|
||||
"[bolt04]: https://github.com/lightning/bolts/blob/master/04-onion-routing.md"
|
||||
]
|
||||
}
|
444
doc/schemas/lightning-sendpay.json
Normal file
444
doc/schemas/lightning-sendpay.json
Normal file
|
@ -0,0 +1,444 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"rpc": "sendpay",
|
||||
"title": "Low-level command for sending a payment via a route",
|
||||
"description": [
|
||||
"The **sendpay** RPC command attempts to send funds associated with the given *payment_hash*, along a route to the final destination in the route.",
|
||||
"",
|
||||
"Generally, a client would call lightning-getroute(7) to resolve a route, then use **sendpay** to send it. If it fails, it would call lightning-getroute(7) again to retry. If the route is empty, a payment-to-self is attempted.",
|
||||
"",
|
||||
"The response will occur when the payment is on its way to the destination. The **sendpay** RPC command does not wait for definite success or definite failure of the payment (except for already-succeeded payments, or to-self payments). Instead, use the **waitsendpay** RPC command to poll or wait for definite success or definite failure.",
|
||||
"",
|
||||
"Once a payment has succeeded, calls to **sendpay** with the same *payment_hash* but a different *amount_msat* or destination will fail; this prevents accidental multiple payments. Calls to **sendpay** with the same *payment_hash*, *amount_msat*, and destination as a previous successful payment (even if a different route or *partid*) will return immediately with success."
|
||||
],
|
||||
"request": {
|
||||
"required": [
|
||||
"route",
|
||||
"payment_hash"
|
||||
],
|
||||
"properties": {
|
||||
"route": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"amount_msat",
|
||||
"id",
|
||||
"delay",
|
||||
"channel"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "pubkey",
|
||||
"description": [
|
||||
"The node at the end of this hop."
|
||||
]
|
||||
},
|
||||
"channel": {
|
||||
"type": "short_channel_id",
|
||||
"description": [
|
||||
"The channel joining these nodes."
|
||||
]
|
||||
},
|
||||
"delay": {
|
||||
"type": "u32",
|
||||
"description": [
|
||||
"The total CLTV expected by the node at the end of this hop."
|
||||
]
|
||||
},
|
||||
"amount_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"The amount expected by the node at the end of this hop."
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"payment_hash": {
|
||||
"type": "hash",
|
||||
"description": [
|
||||
"The hash of the payment_preimage."
|
||||
]
|
||||
},
|
||||
"label": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The label provided when creating the invoice_request."
|
||||
]
|
||||
},
|
||||
"amount_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"Amount must be provided if *partid* is non-zero, or the payment is to-self, otherwise it must be equal to the final amount to the destination. it can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*."
|
||||
],
|
||||
"default": "in millisatoshi precision"
|
||||
},
|
||||
"bolt11": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Bolt11 invoice to pay. If provided, will be returned in *waitsendpay* and *listsendpays* results."
|
||||
]
|
||||
},
|
||||
"payment_secret": {
|
||||
"type": "secret",
|
||||
"description": [
|
||||
"Value that the final recipient requires to accept the payment, as defined by the `payment_data` field in BOLT 4 and the `s` field in the BOLT 11 invoice format. It is required if *partid* is non-zero."
|
||||
]
|
||||
},
|
||||
"partid": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"Must not be provided for self-payments. If provided and non-zero, allows for multiple parallel partial payments with the same *payment_hash*. The *amount_msat* amount (which must be provided) for each **sendpay** with matching *payment_hash* must be equal, and **sendpay** will fail if there are differing values given."
|
||||
]
|
||||
},
|
||||
"localinvreqid": {
|
||||
"type": "hex",
|
||||
"description": [
|
||||
"Indicates that this payment is being made for a local invoice_request. This ensures that we only send a payment for a single-use invoice_request once."
|
||||
]
|
||||
},
|
||||
"groupid": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"Allows you to attach a number which appears in **listsendpays** so payments can be identified as part of a logical group. The *pay* plugin uses this to identify one attempt at a MPP payment, for example."
|
||||
]
|
||||
},
|
||||
"payment_metadata": {
|
||||
"added": "v0.11.0",
|
||||
"type": "hex",
|
||||
"description": [
|
||||
"Placed in the final onion hop TLV."
|
||||
]
|
||||
},
|
||||
"description": {
|
||||
"added": "v0.11.0",
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Description used in the invoice."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [
|
||||
"id",
|
||||
"created_index",
|
||||
"payment_hash",
|
||||
"status",
|
||||
"created_at",
|
||||
"amount_sent_msat"
|
||||
],
|
||||
"properties": {
|
||||
"created_index": {
|
||||
"added": "v23.11",
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"1-based index indicating order this payment was created in."
|
||||
]
|
||||
},
|
||||
"updated_index": {
|
||||
"added": "v23.11",
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"1-based index indicating order this payment was changed (only present if it has changed since creation)."
|
||||
]
|
||||
},
|
||||
"id": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"Old synonym for created_index."
|
||||
]
|
||||
},
|
||||
"groupid": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"Grouping key to disambiguate multiple attempts to pay an invoice or the same payment_hash."
|
||||
]
|
||||
},
|
||||
"payment_hash": {
|
||||
"type": "hash",
|
||||
"description": [
|
||||
"The hash of the *payment_preimage* which will prove payment."
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"pending",
|
||||
"complete"
|
||||
],
|
||||
"description": [
|
||||
"Status of the payment (could be complete if already sent previously)."
|
||||
]
|
||||
},
|
||||
"amount_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"The amount delivered to destination (if known)."
|
||||
]
|
||||
},
|
||||
"destination": {
|
||||
"type": "pubkey",
|
||||
"description": [
|
||||
"The final destination of the payment if known."
|
||||
]
|
||||
},
|
||||
"created_at": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"The UNIX timestamp showing when this payment was initiated."
|
||||
]
|
||||
},
|
||||
"completed_at": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"The UNIX timestamp showing when this payment was completed."
|
||||
]
|
||||
},
|
||||
"amount_sent_msat": {
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"The amount sent."
|
||||
]
|
||||
},
|
||||
"label": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The *label*, if given to sendpay."
|
||||
]
|
||||
},
|
||||
"partid": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"The *partid*, if given to sendpay."
|
||||
]
|
||||
},
|
||||
"bolt11": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The bolt11 string (if supplied)."
|
||||
]
|
||||
},
|
||||
"bolt12": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"The bolt12 string (if supplied: **experimental-offers** only)."
|
||||
]
|
||||
}
|
||||
},
|
||||
"allOf": [
|
||||
{
|
||||
"if": {
|
||||
"properties": {
|
||||
"status": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"complete"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"then": {
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"payment_preimage"
|
||||
],
|
||||
"properties": {
|
||||
"id": {},
|
||||
"created_index": {},
|
||||
"updated_index": {},
|
||||
"groupid": {},
|
||||
"payment_hash": {},
|
||||
"status": {},
|
||||
"msatoshi": {},
|
||||
"amount_msat": {},
|
||||
"destination": {},
|
||||
"created_at": {},
|
||||
"completed_at": {},
|
||||
"msatoshi_sent": {},
|
||||
"amount_sent_msat": {},
|
||||
"label": {},
|
||||
"partid": {},
|
||||
"bolt11": {},
|
||||
"bolt12": {},
|
||||
"payment_preimage": {
|
||||
"type": "secret",
|
||||
"description": [
|
||||
"The proof of payment: SHA256 of this **payment_hash**."
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"if": {
|
||||
"properties": {
|
||||
"status": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"pending"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"then": {
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"message"
|
||||
],
|
||||
"properties": {
|
||||
"id": {},
|
||||
"created_index": {},
|
||||
"updated_index": {},
|
||||
"groupid": {},
|
||||
"payment_hash": {},
|
||||
"status": {},
|
||||
"msatoshi": {},
|
||||
"amount_msat": {},
|
||||
"destination": {},
|
||||
"created_at": {},
|
||||
"completed_at": {},
|
||||
"msatoshi_sent": {},
|
||||
"amount_sent_msat": {},
|
||||
"label": {},
|
||||
"partid": {},
|
||||
"bolt11": {},
|
||||
"bolt12": {},
|
||||
"message": {
|
||||
"type": "string",
|
||||
"description": [
|
||||
"Monitor status with listpays or waitsendpay."
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"errors": [
|
||||
"On error, if the error occurred from a node other than the final destination, the route table will be updated so that lightning-getroute(7) should return an alternate route (if any). An error from the final destination implies the payment should not be retried.",
|
||||
"",
|
||||
"- -1: Catchall nonspecific error.",
|
||||
"- 201: Already paid with this *hash* using different amount or destination.",
|
||||
"- 202: Unparseable onion reply. The *data* field of the error will have an *onionreply* field, a hex string representation of the raw onion reply.",
|
||||
"- 203: Permanent failure at destination. The *data* field of the error will be routing failure object.",
|
||||
"- 204: Failure along route; retry a different route. The *data* field of the error will be routing failure object.",
|
||||
"- 212: *localinvreqid* refers to an invalid, or used, local invoice_request.",
|
||||
"",
|
||||
"A routing failure object has the fields below:",
|
||||
"",
|
||||
"*erring_index*: The index of the node along the route that reported the error. 0 for the local node, 1 for the first hop, and so on.",
|
||||
"*erring_node*: The hex string of the pubkey id of the node that reported the error.",
|
||||
"*erring_channel*: The short channel ID of the channel that has the error, or *0:0:0* if the destination node raised the error. In addition *erring_direction* will indicate which direction of the channel caused the failure.",
|
||||
"*failcode*: The failure code, as per BOLT #4.",
|
||||
"*channel_update*: The hex string of the *channel_update* message received from the remote node. Only present if error is from the remote node and the *failcode* has the UPDATE bit set, as per BOLT #4."
|
||||
],
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:sendpay#1",
|
||||
"method": "sendpay",
|
||||
"params": {
|
||||
"route": [
|
||||
{
|
||||
"amount_msat": 11000000,
|
||||
"id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59",
|
||||
"delay": 5,
|
||||
"channel": "103x1x0"
|
||||
}
|
||||
],
|
||||
"payment_hash": "072b1d20f4a7c757a56d5fb10eaed40b58b68849da41fe396cdbd2d81692875a",
|
||||
"label": null,
|
||||
"amount_msat": null,
|
||||
"bolt11": "lnbcrt110u1pjmr5lzsp5sfjyj3xn7ux592k36hmmt4ax98n6lgct22wvj54yck0upcmep63qpp5qu436g855lr40ftdt7csatk5pdvtdzzfmfqluwtvm0fds95jsadqdpq0pzk7s6j8y69xjt6xe25j5j4g44hsatdxqyjw5qcqp99qxpqysgquwma3zrw4cd8e8j4u9uh4gxukaacckse64kx2l9dqv8rvrysdq5r5dt38t9snqj9u5ar07h2exr4fg56wpudkhkk7gtxlyt72ku5fpqqd4fnlk",
|
||||
"payment_secret": "82644944d3f70d42aad1d5f7b5d7a629e7afa30b529cc952a4c59fc0e3790ea2",
|
||||
"partid": null,
|
||||
"groupid": null,
|
||||
"payment_metadata": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "example:sendpay#2",
|
||||
"method": "sendpay",
|
||||
"params": {
|
||||
"route": [
|
||||
{
|
||||
"id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59",
|
||||
"channel": "103x1x0",
|
||||
"direction": 1,
|
||||
"amount_msat": 4211,
|
||||
"style": "tlv",
|
||||
"delay": 24
|
||||
},
|
||||
{
|
||||
"id": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d",
|
||||
"channel": "105x1x0",
|
||||
"direction": 0,
|
||||
"amount_msat": 3710,
|
||||
"style": "tlv",
|
||||
"delay": 16
|
||||
},
|
||||
{
|
||||
"id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518",
|
||||
"channel": "107x1x0",
|
||||
"direction": 1,
|
||||
"amount_msat": 3210,
|
||||
"style": "tlv",
|
||||
"delay": 8
|
||||
}
|
||||
],
|
||||
"payment_hash": "bc747053329402620a26bdc187cd134cdb699130d85be499ecd24160aff04c5c",
|
||||
"label": null,
|
||||
"amount_msat": null,
|
||||
"bolt11": null,
|
||||
"payment_secret": "c36a2fe9aced78c06960e2f21b369ed03f0492c97e53ba3b662163bcdaf1d7fa",
|
||||
"partid": null,
|
||||
"groupid": null,
|
||||
"payment_metadata": null
|
||||
}
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{
|
||||
"message": "Monitor status with listpays or waitsendpay",
|
||||
"created_index": 1,
|
||||
"id": 1,
|
||||
"payment_hash": "072b1d20f4a7c757a56d5fb10eaed40b58b68849da41fe396cdbd2d81692875a",
|
||||
"groupid": 1,
|
||||
"destination": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59",
|
||||
"amount_msat": 11000000,
|
||||
"amount_sent_msat": 11000000,
|
||||
"created_at": 1706152930,
|
||||
"status": "pending",
|
||||
"bolt11": "lnbcrt110u1pjmr5lzsp5sfjyj3xn7ux592k36hmmt4ax98n6lgct22wvj54yck0upcmep63qpp5qu436g855lr40ftdt7csatk5pdvtdzzfmfqluwtvm0fds95jsadqdpq0pzk7s6j8y69xjt6xe25j5j4g44hsatdxqyjw5qcqp99qxpqysgquwma3zrw4cd8e8j4u9uh4gxukaacckse64kx2l9dqv8rvrysdq5r5dt38t9snqj9u5ar07h2exr4fg56wpudkhkk7gtxlyt72ku5fpqqd4fnlk"
|
||||
},
|
||||
{
|
||||
"message": "Monitor status with listpays or waitsendpay",
|
||||
"created_index": 2,
|
||||
"id": 2,
|
||||
"payment_hash": "bc747053329402620a26bdc187cd134cdb699130d85be499ecd24160aff04c5c",
|
||||
"groupid": 1,
|
||||
"destination": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518",
|
||||
"amount_msat": 3210,
|
||||
"amount_sent_msat": 4211,
|
||||
"created_at": 1708624260,
|
||||
"status": "pending"
|
||||
}
|
||||
],
|
||||
"author": [
|
||||
"Rusty Russell <<rusty@rustcorp.com.au>> is mainly responsible."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-listinvoice(7)",
|
||||
"lightning-delinvoice(7)",
|
||||
"lightning-getroute(7)",
|
||||
"lightning-invoice(7)",
|
||||
"lightning-pay(7)",
|
||||
"lightning-waitsendpay(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue