Sort with a custom key.
sorted(
lambda
def sort_by_amount(txs): # TODO: sorted(txs, key=lambda t: ...) pass