mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-23 06:55:13 +01:00
Without this, we have hardly any enforcement. This is why the schema mistake fixed in the previous patches weren't spotted immediately. The hard work was done by: ``` $ for f in lightning-*.json; do grep -v '^ "additionalProperties": false,' $f | bagto $f; done $ for f in lightning-*.json; do sed 's/"properties": {/"additionalProperties": false, "properties": {/' $f | bagto $f; done $ make fmt-schemas ``` Then checking where 'additionalProperties: true' had been turned to false (we deliberately use it in some places where there are if statements in the schema, or occasionally where there can be arbitrary fields). [Including doc/rpc-schema-draft.json update by Shahana] Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
97 lines
2.2 KiB
JSON
97 lines
2.2 KiB
JSON
{
|
|
"$schema": "../rpc-schema-draft.json",
|
|
"type": "object",
|
|
"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"
|
|
],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"feerate_str": {
|
|
"type": "string",
|
|
"description": [
|
|
"The feerate string to parse."
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"response": {
|
|
"required": [],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"perkw": {
|
|
"type": "u32",
|
|
"description": [
|
|
"Value of *feerate_str* in kilosipa."
|
|
],
|
|
"additionalProperties": false
|
|
}
|
|
}
|
|
},
|
|
"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>"
|
|
],
|
|
"examples": [
|
|
{
|
|
"request": {
|
|
"id": "example:parsefeerate#1",
|
|
"method": "parsefeerate",
|
|
"params": [
|
|
"unilateral_close"
|
|
]
|
|
},
|
|
"response": {
|
|
"perkw": 11000
|
|
}
|
|
},
|
|
{
|
|
"request": {
|
|
"id": "example:parsefeerate#2",
|
|
"method": "parsefeerate",
|
|
"params": [
|
|
"9999perkw"
|
|
]
|
|
},
|
|
"response": {
|
|
"perkw": 9999
|
|
}
|
|
},
|
|
{
|
|
"request": {
|
|
"id": "example:parsefeerate#3",
|
|
"method": "parsefeerate",
|
|
"params": [
|
|
10000
|
|
]
|
|
},
|
|
"response": {
|
|
"perkw": 2500
|
|
}
|
|
},
|
|
{
|
|
"request": {
|
|
"id": "example:parsefeerate#4",
|
|
"method": "parsefeerate",
|
|
"params": [
|
|
"urgent"
|
|
]
|
|
},
|
|
"response": {
|
|
"perkw": 11000
|
|
}
|
|
}
|
|
]
|
|
}
|