Transaction Cost
Transaction Cost

Transaction Cost

Transaction Cost

Intro

Let’s fetch the transaction fee from the ledger.

Video

Topics covered

  • Current Transaction Cost in Drops = (base_fee × load_factor) ÷ load_base
  • Fetch network fee from server_state command.

References

Update

const { state } = await client.send({
     command: "server_state",
});
console.log(
"Current Transaction Cost in Drops ",
(state.validated_ledger.base_fee * state.load_factor) / state.load_base
);
💡
Final tip: It’s always better to fetch the transaction fee directly from the ledger, as it depends upon the network load and we can not guess the load at any given time.
💠
https://xrpl-labs.com

Footer Social Icons

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