xrpld
Loading...
Searching...
No Matches
protocol/Fees.h
1#pragma once
2
3#include <xrpl/protocol/XRPAmount.h>
4
5#include <cstdint>
6
7namespace xrpl {
8
9// Deprecated constant for backwards compatibility with pre-XRPFees amendment.
10// This was the reference fee units used in the old fee calculation.
11inline constexpr std::uint32_t kFeeUnitsDeprecated = 10;
12
19struct Fees
20{
25
30
35
36 explicit Fees() = default;
37 Fees(Fees const&) = default;
38 Fees&
39 operator=(Fees const&) = default;
40
45
52 [[nodiscard]] XRPAmount
54 {
55 return (reserve * accountCount) + (increment * ownerCount);
56 }
57};
58
59} // namespace xrpl
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
constexpr std::uint32_t kFeeUnitsDeprecated
std::uint32_t ownerCount(SLE::const_ref sle, beast::Journal j, std::int32_t ownerCountAdj=0)
Return number of the objects which reserve is covered by the account(sle) (so called "ownercount").
Fees(Fees const &)=default
XRPAmount reserve
Minimum XRP an account must hold to exist on the ledger.
Fees(XRPAmount base, XRPAmount reserve, XRPAmount increment)
Fees()=default
XRPAmount increment
Additional XRP reserve required per owned ledger object.
XRPAmount base
Cost of a reference transaction in drops.
XRPAmount accountReserve(std::uint32_t ownerCount, std::uint32_t accountCount) const
Returns the account reserve given the owner count, in drops.
Fees & operator=(Fees const &)=default