core-lightning/doc/schemas/lightning-newaddr.json
ShahanaFarooqui 976c0c90bc docs: Changes examples format
- Changed ALL `doc/schemas/lightning-*.json` file's `json_example` to `examples`
- Change the heading from example to examples
- Bring shell command before the json command
- Move Example to the end of the page
- Remove horizontal line from Example
2024-06-22 17:02:33 +02:00

88 lines
2.4 KiB
JSON

{
"$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."
],
"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": "bcrt1qq8adjz4u6enf0cjey9j8yt0y490tact93fzgsf"
}
},
{
"request": {
"id": "example:newaddr#2",
"method": "newaddr",
"params": {
"addresstype": "bech32"
}
},
"response": {
"bech32": "bcrt1qq8adjz4u6enf0cjey9j8yt0y490tact93fzgsf"
}
}
]
}