Lightning: It is hard to read output of `listfunds`

Created on 7 Dec 2019  路  5Comments  路  Source: ElementsProject/lightning

When reading the output of listfunds I have to count the number of digits to understand how many bitcoins are present in the utxos and channels. Is it possible to add one or more extra fields showing the amount in mBTC and/or BTC? It would also be nice to see the total amount tied up in utxos, total amount tied up in channels, total amount tied up in channels with connected nodes, and total amount tied up in channels with disconnected nodes.

Example output from listfunds to illustrate the problem

{
    "outputs": [{
        "txid": "440bdba1d5209b15f22998a413ac1248b50e7db195a679e0f117546e7f72c6ec",
        "output": 1,
        "value": 6623954,
        "amount_msat": "6623954000msat",
        "address": "tb1qrx3qen27fk0a74u757c3axc6rt88e3hf6u5678",
        "status": "confirmed",
        "blockheight": 1611377
    }, {
        "txid": "ebdd6bf9fd356efb033fcb8aad4dd4849582de71ae4a3c66785fd13c5701011b",
        "output": 0,
        "value": 1828,
        "amount_msat": "1828000msat",
        "address": "tb1q2uxuctk2admcgrwzq632exfkfewzp99z43afr7",
        "status": "confirmed",
        "blockheight": 1611377
    }],
    "channels": [{
        "peer_id": "031c64a68e6d1b9e50711336d92b434c584ce668b2fae59ee688bd73713fee1569",
        "connected": true,
        "state": "CHANNELD_NORMAL",
        "short_channel_id": "1611042x98x0",
        "channel_sat": 11418091,
        "our_amount_msat": "11418091000msat",
        "channel_total_sat": 11627500,
        "amount_msat": "11627500000msat",
        "funding_txid": "f2f8e9fade793d3177d21f698131657eb8b093c3e8c95414ddda823a1869df00",
        "funding_output": 0
    }]
}

Most helpful comment

All 5 comments

With the rpc_command hook you can even change the output on the fly to enrich the returned output :-)

Is it possible to add one or more extra fields showing the amount in mBTC and/or BTC?

Concept NAK. This is a display/UI issue. Please do not bloat the RPC protocol with superfluous fields.

Yeah, our trend has been to remove duplicated fields and rely on plugins to do the "human-readable" stuff. JSON will never truly be human readable anyway :(

Yeah, our trend has been to remove duplicated fields and rely on plugins to do the "human-readable" stuff. JSON will never truly be human readable anyway :(

It is "human-readable" for a very limited interpretation of "human" :-)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Xian001 picture Xian001  路  3Comments

brunoaduarte picture brunoaduarte  路  5Comments

gallizoltan picture gallizoltan  路  3Comments

brunoaduarte picture brunoaduarte  路  4Comments

igreshev picture igreshev  路  4Comments