Balance Detail
Balance Detail

Balance Detail

Balance Detail

Intro

Calculating Balance details by fetching the reserve requirements directly from the ledger.

Video

Topics covered

  • XRP Ledger Account Reserve Requirement.
  • Fetch reserve values directly from the ledger.
  • Total Reserve = Base_reserve + Owner_reserve * OwnerCount;
  • Spendable Balance = Total Balance - Total Reserve;
  • You can not send more XRP than present in your “spendable balance”.

References

Update

Since TrustLines are a powerful feature of the XRP Ledger, there is a special feature to make an account's first two trust lines "free". When an account creates a new trust line, if the account owns at most 2 items in the ledger including the new line, the account's owner reserve is treated as zero instead of the normal amount. This allows the transaction to succeed even if the account does not hold enough XRP to meet the increased reserve requirement for owning objects in the ledger. When an account owns 3 or more objects in the ledger, the full owner reserve applies.

💡
Final tip: Do not assume the reserve value as it’s bound to change. So always fetch these information directly from the ledger and cache for a long time - as these reserves do not change regularly.
💠
https://xrpl-labs.com

Footer Social Icons

© XRPL Labs - https://xrpl-labs.com