From 72bea053aac16adcfc8750f97c5d4533639fd451 Mon Sep 17 00:00:00 2001 From: ai-bot Date: Sun, 15 Nov 2026 10:39:45 +0000 Subject: [PATCH] Take the fee of a transfer on top of what is sent --- ledger.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/ledger.py b/ledger.py index 46f5413..db02b88 100644 --- a/ledger.py +++ b/ledger.py @@ -17,11 +17,9 @@ import rates SATS_PER_BTC = rates.SATS_PER_BTC LOT_METHODS = ("FIFO", "LIFO", "HIFO") -# Types that take sats out of an account. A sats fee is added to the amount -# consumed only where docs/spec.md section 3.2 says it increases the sats used: -# a sale and a spend. For a transfer the fee reduces what arrives instead, and -# for a loss and a gift given it is only recorded. admin_cost is not here at -# all: it stands on its own and changes no holdings (section 3.10). +# Types that take sats out of an account. For a loss and a gift given a fee is +# only recorded. admin_cost is not here at all: it stands on its own and changes +# no holdings (section 3.10). CONSUMING_TYPES = ( "trade", "spend", @@ -29,7 +27,10 @@ CONSUMING_TYPES = ( "transfer_out", "gift_given", ) -FEE_ADDS_TO_CONSUMPTION = ("trade", "spend") +# A sats fee is taken on top of the amount consumed for these types. A transfer +# takes it on top of what is sent, so the sats that are sent are exactly the sats +# that arrive (docs/spec.md sections 3.2 and 3.3). +FEE_ADDS_TO_CONSUMPTION = ("trade", "spend", "transfer_out") class LedgerError(Exception):