1#include <xrpld/rpc/detail/AccountAssets.h>
3#include <xrpld/rpc/detail/AssetCache.h>
4#include <xrpld/rpc/detail/TrustLine.h>
6#include <xrpl/basics/UnorderedContainers.h>
7#include <xrpl/beast/utility/Zero.h>
8#include <xrpl/protocol/AccountID.h>
9#include <xrpl/protocol/PathAsset.h>
10#include <xrpl/protocol/UintTypes.h>
30 for (
auto const& rspEntry : *lines)
32 auto& saBalance = rspEntry.getBalance();
35 if (saBalance > beast::kZero
37 || (rspEntry.getLimitPeer()
39 && ((-saBalance) < rspEntry.getLimitPeer())))
48 if (
auto const mpts = lrCache->getMPTs(account))
50 for (
auto const& rspEntry : *mpts)
52 if (!rspEntry.isZeroBalance() && !rspEntry.isMaxedOut())
53 assets.
insert(rspEntry.getMptID());
74 for (
auto const& rspEntry : *lines)
76 auto& saBalance = rspEntry.getBalance();
78 if (saBalance < rspEntry.getLimit())
85 if (
auto const mpts = lrCache->getMPTs(account))
87 for (
auto const& rspEntry : *mpts)
89 if (rspEntry.isZeroBalance() && !rspEntry.isMaxedOut())
90 assets.
insert(rspEntry.getMptID());
A currency issued by an account.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
std::unordered_set< Value, Hash, Pred, Allocator > hash_set
hash_set< PathAsset > accountDestAssets(AccountID const &account, std::shared_ptr< AssetCache > const &lrCache, bool includeXRP)
Currency const & xrpCurrency()
XRP currency.
hash_set< PathAsset > accountSourceAssets(AccountID const &account, std::shared_ptr< AssetCache > const &lrCache, bool includeXRP)
BaseUInt< 160, detail::AccountIDTag > AccountID
A 160-bit unsigned that uniquely identifies an account.
Currency const & badCurrency()
We deliberately disallow the currency that looks like "XRP" because too many people were using it ins...