Open renepickhardt opened 4 years ago
I thought about offering an additional layer on top of the raw API, that parses the results into python objects (allowing things like node.peers[0].channels[0].short_channel_id
instead of walking just anonymous dicts. If we annotate the classes with type decorators we can even statically check access.
Does that sound reasonable?
When using pyln I have calls like
channels = plugin.rpc.listfunds()["channels"]
it is really a pitty that I have to type those strings when accessing the JSON fields. In particular my LAPPS and Plugins would break if for whatever reason lightning should change those keys. But more problematic is that I could have typos or similar.It would be really nice to have constants in pyln that can be used to access keys in the results from the JSON rpc and to ship this with plyln