mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-22 14:42:40 +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>
89 lines
2.4 KiB
JSON
89 lines
2.4 KiB
JSON
{
|
|
"$schema": "../rpc-schema-draft.json",
|
|
"type": "object",
|
|
"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": [],
|
|
"additionalProperties": false,
|
|
"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": [],
|
|
"additionalProperties": false,
|
|
"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."
|
|
],
|
|
"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>"
|
|
],
|
|
"examples": [
|
|
{
|
|
"request": {
|
|
"id": "example:newaddr#1",
|
|
"method": "newaddr",
|
|
"params": {}
|
|
},
|
|
"response": {
|
|
"bech32": "bcrt1qcqqvkswps3e6ck3jmqf86f9tcaeke5z04d3tv4"
|
|
}
|
|
},
|
|
{
|
|
"request": {
|
|
"id": "example:newaddr#2",
|
|
"method": "newaddr",
|
|
"params": {
|
|
"addresstype": "p2tr"
|
|
}
|
|
},
|
|
"response": {
|
|
"p2tr": "bcrt1phtprcvhz842sxe8qw0yryvc0g6n6dw2puweklcpnfye273kjpfhs0d6d2e"
|
|
}
|
|
}
|
|
]
|
|
}
|