Repository navigation
Expand file tree
/
Copy pathlncli.py
More file actions
61 lines (53 loc) · 18.3 KB
/
Copy pathlncli.py
File metadata and controls
61 lines (53 loc) · 18.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# unsafepay - because Telegram could empty your channels
# Copyright (C) 2018-2019 Martino Salvetti
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import time
from collections import defaultdict
five_min_ago = int(time.time() - 60 * 5)
def commands_sort(item):
cmd_index = item[0].split('__')
if len(cmd_index) == 1:
return cmd_index[0], 0
return cmd_index[0], int(cmd_index[1])
def group_by_index(data):
out = defaultdict(list)
for key, value in sorted(data.items(), key=commands_sort):
out[key.split('__')[0]].append(value)
return out
def cmds():
getinfo__0 = '{"identity_pubkey":"0229bfbea3f31a9b720b9da68e20b53c692860769e446f25daba27f6e9e045ea63","alias":"B Boo","num_pending_channels":0,"num_active_channels":3,"num_peers":7,"block_height":527017,"block_hash":"0000000000000000002072fd092dd211519cff013a46c9ba216df1899f344ce8","synced_to_chain":true,"testnet":false,"chains":["bitcoin"],"uris":["0229bfbea3f31a9b720b9da68e20b53c692860769e446f25daba27f6e9e045ea63@93.40.7.67:9735"],"best_header_timestamp":"1528740387","version":"0.4.2-beta commit=7cf5ebe2650b6798182e10be198c7ffc1f1d6e19"}'
getinfo__1 = '{"identity_pubkey":"0370a1b5e29423e2a1a1da474c98c2f069975db2a8ecc04d8bf68e30468543953d","alias":"Fanghiglia","num_pending_channels":1,"num_active_channels":4,"num_peers":5,"block_height":1456181,"block_hash":"000000000000011d36f08d2f90d4ad965ccf822c006daec4e377953d70f2dfd0","synced_to_chain":true,"testnet":true,"chains":["bitcoin"],"uris":[],"best_header_timestamp":"1549573875","version":"0.5.2-beta commit=v0.5.2-beta-rc7","num_inactive_channels":3}'
# payinvoice = '{"payment_error":"unable to find a path to destination","payment_preimage":"","payment_route":null}'
payinvoice__0 = '{"payment_error":"","payment_preimage":"d395f4966b9ab34219e6d22676127562c67d59d9f3138a6fa834500a325ee378","payment_route":{"total_time_lock":527561,"total_fees":1,"total_amt":149,"hops":[{"chan_id":579098480736010241,"chan_capacity":592440,"amt_to_forward":148,"fee":1,"expiry":527417,"amt_to_forward_msat":148002,"fee_msat":1118},{"chan_id":572939016663203840,"chan_capacity":1000000,"amt_to_forward":148,"expiry":527273,"amt_to_forward_msat":148000,"fee_msat":2},{"chan_id":579319482654392320,"chan_capacity":1000000,"amt_to_forward":148,"expiry":527273,"amt_to_forward_msat":148000}],"total_fees_msat":1120,"total_amt_msat":149120}}'
payinvoice__1 = '{"payment_error":"","payment_preimage":"1b0900f6c817cca98441c65e61dacf05d1737a717fb9705794ef2e861d48b71e","payment_route":{"total_time_lock":564313,"total_amt":1,"hops":[{"chan_id":596563123492421600,"chan_capacity":1000000,"amt_to_forward":1,"expiry":564169,"amt_to_forward_msat":1000,"fee_msat":1,"pub_key":"0279c22ed7a068d10dc1a38ae66d2d6461e269226c60258c021b1ddcdfe4b00bc4"},{"chan_id":610876565917335600,"chan_capacity":16777215,"amt_to_forward":1,"expiry":564169,"amt_to_forward_msat":1000,"pub_key":"03021c5f5f57322740e4ee6936452add19dc7ea7ccf90635f95119ab82a62ae268"}],"total_fees_msat":1,"total_amt_msat":1001}}'
addinvoice = '{"r_hash":"bcb1cc2cca6a26bf0d2ba86ed4dc09b64d45ccecff663819eb56ab5477481ed6","pay_req":"lnbc1pd3aml7pp5hjcuctx2dgnt7rft4phdfhqfkex5tn8vlanrsx0t2644ga6grmtqdqqcqzyshxnsetaufstvawr83yq6st9kjk072d2yp7cu4dawyc36ac05rva9ar7mmt8mldg3v56krx80jp7rdycrxjcz9qea6z4t3dvm2aan8xgpu7ey67"}'
# listinvoices[0] is expired
listinvoices = '{"invoices":[{"memo":"","receipt":null,"r_preimage":"fbJbPN9DLlnDkENgHpSD8WqPlU/8Tbk76eiRkplpOAw=","r_hash":"2x4h5WmYbZ9JjQZn6Xt0OxFLThFh02+CYOz3VRzm8bE=","value":"0","settled":false,"creation_date":"1537546524","settle_date":"0","payment_request":"lnbc1pd62xgupp5mv0zretfnpke7jvdqen7j7m58vg5kns3v8fklqnqanm4288x7xcsdqqcqzysf2tt0qehquy5w0ztnvyfx5qd35qjhwwpjnr75zvhfpe3c5xff293gv5n7kgw73ct6ag90uxynfqzqgs99arnrzxmmy8cqtaak79vm4qqg7myyx","description_hash":null,"expiry":"3600","fallback_addr":"","cltv_expiry":"144","route_hints":[],"private":false,"add_index":"1","settle_index":"0","amt_paid":"0","amt_paid_sat":"0","amt_paid_msat":"0"},{"memo":"","receipt":null,"r_preimage":"tNkaWMXNJq5SMBtnn/OOLYZd5VJvEFFHpa1acoS1ErA=","r_hash":"/ycXQzmwCsyat9NHOPKCwwxzHDok9XXz+nc+w1yJy/c=","value":"123","settled":false,"creation_date":"1537546524","settle_date":"0","payment_request":"lnbc1230n1pd62xgupp5lun3wseekq9vex4h6drn3u5zcvx8x8p6yn6htul6wulvxhyfe0msdqqcqzysd2c494r5u8az80tj0pm2zk4plt4g6wmtxxynegzmxscrgjcsth8qshunr9gmvcajp5wesafkxfz6u0zkkdy2ahjz527cqg3n6dnaaecpjt25cj","description_hash":null,"expiry":"3600","fallback_addr":"","cltv_expiry":"144","route_hints":[],"private":false,"add_index":"2","settle_index":"0","amt_paid":"0","amt_paid_sat":"0","amt_paid_msat":"0"},{"memo":"","receipt":null,"r_preimage":"QEuqJNZxmAyxzpiyIsz+HqtEhx7SZIYpwrFxhioodBE=","r_hash":"uvwi6K1jEb08md9yet2DXPIA177osI2Fni705DB7adg=","value":"100000","settled":false,"creation_date":"1537546524","settle_date":"0","payment_request":"lnbc1m1pd62xgupp5ht7z969dvvgm60yemae84hvrtneqp4a7azcgmpv79m6wgvrmd8vqdqqcqzysyaga72xaaz7vpfc8cnh4thm6n902dyezwnes2dtph5xzlu2y44h8nt3k6jdv926r57kljzzme8u3fuw6t0r50y4h0kmsjx7jtevcdngpt496gm","description_hash":null,"expiry":"3600","fallback_addr":"","cltv_expiry":"144","route_hints":[],"private":false,"add_index":"3","settle_index":"0","amt_paid":"0","amt_paid_sat":"0","amt_paid_msat":"0"},{"memo":"","receipt":null,"r_preimage":"nnSNNxgBQ5BeszYfd175EsJTeOoh0WX+5w2ZbWgP+Kc=","r_hash":"cXEaPUNBV5hOCZwZuMvjoXN9YFI+Wsx+6sUR+Uk1R7E=","value":"0","settled":false,"creation_date":"1537546567","settle_date":"0","payment_request":"lnbc1pd62x28pp5w9c3502rg9tesnsfnsvm3jlr59eh6czj8edvclh2c5gljjf4g7csdqqcqzysdmf65xfn798fvk6f4vplreuf5tw0rlxthj5w7lnecqfe075l4lwk7gn7kr8q922qxwdz4nxjpw9696a8ujgvzk9fw7grt6akvfrkquspmj46rr","description_hash":null,"expiry":"3600","fallback_addr":"","cltv_expiry":"144","route_hints":[],"private":false,"add_index":"4","settle_index":"0","amt_paid":"0","amt_paid_sat":"0","amt_paid_msat":"0"},{"memo":"","receipt":null,"r_preimage":"9DsknrirMqOurPM+AJCEPjScPzTFvyLCid34o8VLDnw=","r_hash":"bB2gZm2uQxGH31aps6zeHmXc8LRkRXATTzwgOQd+XFU=","value":"123","settled":false,"creation_date":"1537546568","settle_date":"0","payment_request":"lnbc1230n1pd62x2gpp5dsw6qend4ep3rp7l265m8tx7rejaeu95v3zhqy608ssrjpm7t32sdqqcqzyskzce3kcu979s2k04792g5h3fj3aztgcjsax86h24zw5u06rnzud5u4ufs73dwm78zzp8tckgl9hfqugw7c7h49yn7x9s60tqd8gj7hsp5jp5as","description_hash":null,"expiry":"3600","fallback_addr":"","cltv_expiry":"144","route_hints":[],"private":false,"add_index":"5","settle_index":"0","amt_paid":"0","amt_paid_sat":"0","amt_paid_msat":"0"},{"memo":"","receipt":null,"r_preimage":"CSS6wY5W531DUWI7XhuKbJ8ZvvOHsnII9vO47eslz1M=","r_hash":"/H9PpJqJEqMd+gvsGuxkq1KAB5OWZumxvTuUHJ3Hcic=","value":"100000","settled":false,"creation_date":"1537546568","settle_date":"0","payment_request":"lnbc1m1pd62x2gpp5l3l5lfy63yf2x806p0kp4mry4dfgqpunjenwnvda8w2pe8w8wgnsdqqcqzyskfuqck2z7exrpvhe2gf22gv66wqwlfsd98r2dkega8vtwrynswdkac2gaezl3cv0sphskfd526y7klamaltdv04wmkfgydjcx9kd09qq2ue8az","description_hash":null,"expiry":"3600","fallback_addr":"","cltv_expiry":"144","route_hints":[],"private":false,"add_index":"6","settle_index":"0","amt_paid":"0","amt_paid_sat":"0","amt_paid_msat":"0"},{"memo":"","receipt":null,"r_preimage":"7FyH/P8pON4EFc/OfQiNPXVCYcYp37NcT6s6Fu5m/f4=","r_hash":"W7X6gXJondEH5tCNV1U84LW9e45YrjHYH37v90DL8N4=","value":"0","settled":false,"creation_date":"1537887497","settle_date":"0","payment_request":"lnbc1pd65ngfpp5tw6l4qtjdzwazplx6zx4w4fuuz6m67uwtzhrrkql0mhlwsxt7r0qdqqcqzysk0enud0tdw89z8m4wghhxhsqfd8lzrsumx49g7sztaw048fgaxksvj986t5y75rsrc58hxxjvgl7sr8ldmsqfc5szmspp6jmzmzm9zcqss48ng","description_hash":null,"expiry":"3600","fallback_addr":"","cltv_expiry":"144","route_hints":[],"private":false,"add_index":"7","settle_index":"0","amt_paid":"0","amt_paid_sat":"0","amt_paid_msat":"0"},{"memo":"","receipt":null,"r_preimage":"Ur86sQABtfThT1EI1SXlzvdHnnNIj9ip6mmhwhmShR8=","r_hash":"shbQ4AEnt8GN8ZofACY0wEXjxDkukqK01uDKSi+p69g=","value":"100000","settled":false,"creation_date":"1537974820","settle_date":"0","payment_request":"lnbc1m1pd6hg3ypp5kgtdpcqpy7murr03ng0sqf35cpz783pe96f29dxkur9y5tafa0vqdqqcqzys8flqlwgldhjlk2dmf7z7hs8c49h3uycfcnt3xltztdlggpk8p3wqph2pmgva66jva4ud7g46wnyhrz7z562vmnk5fvm4uw567zx6h6gpjysknl","description_hash":null,"expiry":"3600","fallback_addr":"","cltv_expiry":"144","route_hints":[],"private":false,"add_index":"8","settle_index":"0","amt_paid":"0","amt_paid_sat":"0","amt_paid_msat":"0"},{"memo":"","receipt":null,"r_preimage":"vCUjViYV0RruuuApD2mFV+m4DN/RdUKEugtyg84564A=","r_hash":"hpKgQV7Iela215pIXPCq2Z4RiXTiO8TGJ+A4yRz0Zmg=","value":"100000","settled":true,"creation_date":"1539594245","settle_date":"1539594268","payment_request":"lnbc1m1pdugkq9pp5s6f2qs27epa9ddkhnfy9eu92mx0przt5ugauf338uquvj885ve5qdqqcqzysgkrsxah7n4gu57yqaax4adrlt3scccf52c509zvzur96jvr6hfyzgeedtk8cs3cndeva8px8e65ggwlrwvvs79jjhzp05jtvm9mtumspdapx7d","description_hash":null,"expiry":"3600","fallback_addr":"","cltv_expiry":"144","route_hints":[],"private":false,"add_index":"9","settle_index":"1","amt_paid":"100000000","amt_paid_sat":"100000","amt_paid_msat":"100000000"},{"memo":"","receipt":null,"r_preimage":"KIRPuMJ2Wg5ik6ArtALxjA1X/xEWH0JHnWVJ+kiTMB4=","r_hash":"8jEizb5gzv6Oma68bbgUUL1FGVX47tROeOp/lP2oPwc=","value":"1","settled":false,"creation_date":"1540580192","settle_date":"0","payment_request":"lnbc10n1pdaxcmqpp57gcj9nd7vr80ar5e467xmwq52z752x24lrhdgnncaflefldg8ursdqqcqzys097jmcw0ma96lqy3pez23yalja92rruezn8lnnzw6caxeh873yrpz4q9j5r8re4u93nen6upfjgwys0nsjm54mnafwe4jyd3llffjgcqs57wm2","description_hash":null,"expiry":"3600","fallback_addr":"","cltv_expiry":"144","route_hints":[],"private":false,"add_index":"10","settle_index":"0","amt_paid":"0","amt_paid_sat":"0","amt_paid_msat":"0"},{"memo":"","receipt":null,"r_preimage":"Kyxc214jRzkBrIsQRNrOp7j3/gKAfm88pEEiOnRqiRE=","r_hash":"YA8vThk7HWqSVPtRWG34qHWE57L+4kQRgDCoN9NP83w=","value":"100","settled":false,"creation_date":"1540930633","settle_date":"0","payment_request":"lnbc1u1pda30zfpp5vq8j7nse8vwk4yj5ldg4sm0c4p6cfeajlm3ygyvqxz5r05607d7qdqqcqzysj9dl6apafv7vudjh92hy96hp430xhhccug3p9f35a8pt80vaqr2quhdw596wy6y7e3cqcqjnurfwgltutwf7g0vnwlwxmjth6jcv9xcqvdkrts","description_hash":null,"expiry":"3600","fallback_addr":"","cltv_expiry":"144","route_hints":[],"private":false,"add_index":"11","settle_index":"0","amt_paid":"0","amt_paid_sat":"0","amt_paid_msat":"0"}],"last_index_offset":"11","first_index_offset":"1"}'
# lookupinvoice 8692a0415ec87a56b6d79a485cf0aad99e118974e23bc4c627e038c91cf46668
# 8692a041... is not expired, it is settled
lookupinvoice = '{"memo":"","receipt":null,"r_preimage":"vCUjViYV0RruuuApD2mFV+m4DN/RdUKEugtyg84564A=","r_hash":"hpKgQV7Iela215pIXPCq2Z4RiXTiO8TGJ+A4yRz0Zmg=","value":"100000","settled":true,"creation_date":"%d","settle_date":"1539594268","payment_request":"lnbc1m1pdugkq9pp5s6f2qs27epa9ddkhnfy9eu92mx0przt5ugauf338uquvj885ve5qdqqcqzysgkrsxah7n4gu57yqaax4adrlt3scccf52c509zvzur96jvr6hfyzgeedtk8cs3cndeva8px8e65ggwlrwvvs79jjhzp05jtvm9mtumspdapx7d","description_hash":null,"expiry":"3600","fallback_addr":"","cltv_expiry":"144","route_hints":[],"private":false,"add_index":"9","settle_index":"1","amt_paid":"100000000","amt_paid_sat":"100000","amt_paid_msat":"100000000"}' % (five_min_ago, )
walletbalance = '{"total_balance":"4336765","confirmed_balance":"4336765","unconfirmed_balance":"0"}'
channelbalance = '{"balance":"1128190","pending_open_balance":"0"}'
listchannels = '{"channels":[{"active":true,"remote_pubkey":"024a2e265cd66066b78a788ae615acdc84b5b0dec9efac36d7ac87513015eaf6ed","channel_point":"b4e296e1bac367a09b3c650efe2c24627235ffa2f096c0f9d6aa2d454f17a57b:1","chan_id":"0","capacity":"600000","local_balance":"598552","remote_balance":"0","commit_fee":"1448","commit_weight":"600","fee_per_kw":"2000","unsettled_balance":"0","total_satoshis_sent":"0","total_satoshis_received":"0","num_updates":"49","pending_htlcs":[],"csv_delay":144,"private":false},{"active":true,"remote_pubkey":"03557fd11b58cb93d2ad4fab4dd4cff7462a97e21e8f6b7a712cb8bd27a96b9eef","channel_point":"4d378dac54b153b13c03d2d0b3068c5c754df17c762215ea1c9a340ab9ed55a6:0","chan_id":"579098480736075776","capacity":"500000","local_balance":"498552","remote_balance":"0","commit_fee":"1448","commit_weight":"600","fee_per_kw":"2000","unsettled_balance":"0","total_satoshis_sent":"0","total_satoshis_received":"0","num_updates":"51","pending_htlcs":[],"csv_delay":144,"private":false},{"active":false,"remote_pubkey":"036fd87befd85ea3f2b0c4e687757b7acb257c44758681e3a9b657776b34da8f64","channel_point":"ca53a8942d4fddf2384051a3ddd5404a121ee03e02cf71b2432f27dbc100428c:1","chan_id":"579129267098681345","capacity":"100000","local_balance":"30000","remote_balance":"68552","commit_fee":"1448","commit_weight":"724","fee_per_kw":"2000","unsettled_balance":"0","total_satoshis_sent":"0","total_satoshis_received":"0","num_updates":"18","pending_htlcs":[],"csv_delay":144,"private":false},{"active":true,"remote_pubkey":"03c2d52cdcb5ddd40d62ba3c7197260b0f7b4dcc29ad64724c68426045919922f0","channel_point":"53f2daff7a479e40ae6abc43e3668f56c28d2520616f60a02c34449ebcb99ccf:0","chan_id":"579135864171397120","capacity":"50000","local_balance":"0","remote_balance":"49276","commit_fee":"724","commit_weight":"552","fee_per_kw":"1000","unsettled_balance":"0","total_satoshis_sent":"0","total_satoshis_received":"0","num_updates":"44","pending_htlcs":[],"csv_delay":144,"private":false},{"active":true,"remote_pubkey":"03db61876a9a50e5724048170aeb14f0096e503def38dc149d2a4ca71efd95a059","channel_point":"bda12a4773ee81c6644ec1573a802f0b63011dc450660d876ac99eb15b38cebe:0","chan_id":"579657032674181120","capacity":"700000","local_balance":"698552","remote_balance":"0","commit_fee":"1448","commit_weight":"600","fee_per_kw":"2000","unsettled_balance":"0","total_satoshis_sent":"0","total_satoshis_received":"0","num_updates":"0","pending_htlcs":[],"csv_delay":144,"private":false},{"active":true,"remote_pubkey":"037163149da6fbddd6e8e80022f1f4f8378491079f5563c818e0b97205694b58ae","channel_point":"9acbce4785ed13bde398de60f26d83d6ce590274db4862254b5b84f66dce5ae3:0","chan_id":"599233837281378304","capacity":"543505","local_balance":"5435","remote_balance":"537165","commit_fee":"905","commit_weight":"724","fee_per_kw":"1250","unsettled_balance":"0","total_satoshis_sent":"261471","total_satoshis_received":"266906","num_updates":"15","pending_htlcs":[],"csv_delay":2000,"private":true}]}'
describegraph = '{"nodes":[{"last_update":1528852475,"pub_key":"0229bfbea3f31a9b720b9da68e20b53c692860769e446f25daba27f6e9e045ea63","alias":"B Boo","addresses":[{"network":"tcp","addr":"93.40.7.67:9735"}],"color":"#004bbc"},{"last_update":1528852502,"pub_key":"03db61876a9a50e5724048170aeb14f0096e503def38dc149d2a4ca71efd95a059","alias":"mani_al_cielo","addresses":[],"color":"#ff0000"},{"last_update":1517355924,"pub_key":"02006b7be7ea4b7cdf181c5c7b338e80904f13173220eb07e991a268e518a35b4a","alias":"SILKROUTE","addresses":[{"network":"tcp","addr":"81.83.154.157:9735"}],"color":"#02006b"},{"last_update":0,"pub_key":"03aa434d9ff5d5470033aa654f201dbbdce79955c61e9e48a6674d203ae3b689f5","alias":"","addresses":[],"color":"#000000"}],"edges":[{"channel_id":"555122530222276608","chan_point":"ab3ed05032302c2672b77cb58f9b5128b8e9451c65b72b2cf3318548b8a4874e:0","last_update":1528509169,"node1_pub":"02c0ac82c33971de096d87ce5ed9b022c2de678f08002dc37fdb1b6886d12234b5","node2_pub":"02ee4469f2b686d5d02422917ac199602ce4c366a7bfaac1099e3ade377677064d","capacity":"250000","node1_policy":{"time_lock_delta":14,"min_htlc":"1000","fee_base_msat":"1000","fee_rate_milli_msat":"1"},"node2_policy":{"time_lock_delta":144,"min_htlc":"0","fee_base_msat":"1000","fee_rate_milli_msat":"1"}}]}'
decodepayreq__0 = '{"destination":"0229bfbea3f31a9b720b9da68e20b53c692860769e446f25daba27f6e9e045ea63","payment_hash":"5cb50915e0fc70701cdc81c0d57a896e725f099009b77ea372d5500ac40a4662","num_satoshis":"1000000","timestamp":"1528898241","expiry":"3600","description":"Cibo per il gatto","description_hash":"","fallback_addr":"","cltv_expiry":"144","route_hints":[]}'
decodepayreq__1 = '{"destination":"03000000a3f31a9b720b9da68e20b53c692860769e446f25daba27f6e9e045ea63","payment_hash":"5cb50915e0fc70701cdc81c0d57a896e725f099009b77ea372d5500ac40a4662","num_satoshis":"1000000","timestamp":"1528898241","expiry":"3600","description":"","description_hash":"","fallback_addr":"","cltv_expiry":"144","route_hints":[]}'
feereport = '{"channel_fees":[{"channel_point":"b4e296e1bac367a09b3c650efe2c24627235ffa2f096c0f9d6aa2d454f17a57b:1","base_fee_msat":"1000","fee_per_mil":"1","fee_rate":1e-06},{"channel_point":"4d378dac54b153b13c03d2d0b3068c5c754df17c762215ea1c9a340ab9ed55a6:0","base_fee_msat":"1000","fee_per_mil":"1","fee_rate":1e-06},{"channel_point":"bda12a4773ee81c6644ec1573a802f0b63011dc450660d876ac99eb15b38cebe:0","base_fee_msat":"1000","fee_per_mil":"1","fee_rate":1e-06},{"channel_point":"a3dbdf1666f9b80ae232682d357446c787815246b7dcae7135fb824b3a1f3215:0","base_fee_msat":"1000","fee_per_mil":"1","fee_rate":1e-06}],"day_fee_sum":"2","week_fee_sum":"2","month_fee_sum":"4"}'
pendingchannels = '{"total_limbo_balance":"124902","pending_open_channels":[{"channel":{"remote_node_pub":"02cdf83ef8e45908b1092125d25c68dcec7751ca8d39f557775cd842e5bc127469","channel_point":"5df770f1001cb48c9ea8c9c093b75202a978807c8b5772cafcd4e16dd99f06c0:0","capacity":"1000000","local_balance":"998552","remote_balance":"0"},"confirmation_height":0,"commit_fee":"1448","commit_weight":"600","fee_per_kw":"2000"}],"pending_closing_channels":[],"pending_force_closing_channels":[],"waiting_close_channels":[{"channel":{"remote_node_pub":"02189f21128ef083207237c4a982f2ce5dd83dc17224c03f24e894f2e7c498f2a4","channel_point":"a3dbdf1666f9b80ae232682d357446c787815246b7dcae7135fb824b3a1f3215:0","capacity":"1000000","local_balance":"124902","remote_balance":"0"},"limbo_balance":"124902"}]}'
newaddress = '{"address":"bc1qqkpdkgemcrn2yuwmcjj3fcypc6mfelgx23syxf"}'
error = '[lncli] rpc error: code = Unknown desc = payment of 1.2 BTC is too large, max payment allowed is 0.04294967 BTC'
return group_by_index(locals())