Open dappelt opened 6 years ago
My understanding of those two terms was basically the opposite (they're pretty poorly named).
From the rippled docs:
Amount (Optional) The amount of XRP, in drops, authorized by the Signature. This must match the amount in the signed message. This is the cumulative amount of XRP that can be dispensed by the channel, including XRP previously redeemed.
That sounds to me like it would be the amount secured by the best claim...
In parameters of the payment channel creation, Amount
is the total to set aside from the sender's funds (https://ripple.com/build/transactions/#paymentchannelcreate). When you fetch the ledger entry it's the Balance
that contains how much has been claimed so far.
In case the part "including XRP previously redeemed" is confusing to you, all that means is that amount
will never be decreased during the lifespan of a channel. The channel amount starts at the amount indicated in the channel create transaction and can be increased by channel fund transactions. Claiming funds from the channel does not decrease the amount, but does increase the balance
, hence if balance
= amount
all funds have been claimed.
The amount secured by the best claim is stored in channel.amount. However, in the context of XRP paychans,
amount
refers to the total funding in a channel and balance denotes how much was claimed out of the channel (see rippled and ripple-lib). To avoid confusions, it would be better to stick with the same terminology as rippled and ripple-lib.