mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-22 14:42:40 +01:00
213 lines
6.1 KiB
JSON
213 lines
6.1 KiB
JSON
{
|
|
"$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
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"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>"
|
|
],
|
|
"examples": [
|
|
{
|
|
"request": {
|
|
"id": "example:bkpr-listbalances#1",
|
|
"method": "bkpr-listbalances",
|
|
"params": {}
|
|
},
|
|
"response": {
|
|
"accounts": [
|
|
{
|
|
"account": "wallet",
|
|
"balances": [
|
|
{
|
|
"balance_msat": 202498294000,
|
|
"coin_type": "bcrt"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"account": "a397dd9b3e44afcb67f3f3ce1d649b74a8ade63e35505985e4cc1828634f69a2",
|
|
"peer_id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59",
|
|
"we_opened": false,
|
|
"account_closed": true,
|
|
"account_resolved": true,
|
|
"resolved_at_block": 121,
|
|
"balances": [
|
|
{
|
|
"balance_msat": 0,
|
|
"coin_type": "bcrt"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"account": "21bd30cac60f477f2c4267220b1702a6ec5780db34f9934fa94b8c0508bf3357",
|
|
"peer_id": "0382ce59ebf18be7d84677c2e35f23294b9992ceca95491fcf8a56c6cb2d9de199",
|
|
"we_opened": true,
|
|
"account_closed": true,
|
|
"account_resolved": false,
|
|
"balances": [
|
|
{
|
|
"balance_msat": 0,
|
|
"coin_type": "bcrt"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"account": "ecabe6d86abdd57565b3fb7e7c5d724e60ca1a07633951769b5dbfa48dc884b3",
|
|
"peer_id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59",
|
|
"we_opened": false,
|
|
"account_closed": false,
|
|
"account_resolved": false,
|
|
"balances": [
|
|
{
|
|
"balance_msat": 0,
|
|
"coin_type": "bcrt"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"account": "7512083907c74ed3a045e9bf772b3d72948eb93daf84a1cee57108800451aaf2",
|
|
"peer_id": "0382ce59ebf18be7d84677c2e35f23294b9992ceca95491fcf8a56c6cb2d9de199",
|
|
"we_opened": true,
|
|
"account_closed": false,
|
|
"account_resolved": false,
|
|
"balances": [
|
|
{
|
|
"balance_msat": 1000000000,
|
|
"coin_type": "bcrt"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|