def get_history(self):
    out = (list(self.get_lightning_history().values()) + list(self.get_onchain_history().values()))
    out.sort(key=(lambda x: (x.get('timestamp') or float('inf'))))
    balance_msat = 0
    for item in out:
        balance_msat += item['amount_msat']
        item['balance_msat'] = balance_msat
    return out
def get_history(self):
    out = (list(self.get_lightning_history().values()) + list(self.get_onchain_history().values()))
    out.sort(key=(lambda x: (x.get('timestamp') or float('inf'))))
    balance_msat = 0
    for item in out:
        balance_msat += item['amount_msat']
        item['balance_msat'] = balance_msat
    return out