core-lightning/doc/schemas/lightning-newaddr.json
2024-04-04 13:16:27 +10:30

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