20#include <xrpld/app/main/Application.h> 
   21#include <xrpld/app/misc/LoadFeeTrack.h> 
   22#include <xrpld/app/paths/TrustLine.h> 
   23#include <xrpld/rpc/Context.h> 
   24#include <xrpld/rpc/detail/RPCHelpers.h> 
   25#include <xrpld/rpc/detail/Tuning.h> 
   27#include <xrpl/ledger/ReadView.h> 
   28#include <xrpl/protocol/ErrorCodes.h> 
   29#include <xrpl/protocol/RPCErr.h> 
   30#include <xrpl/protocol/TxFlags.h> 
   31#include <xrpl/protocol/jss.h> 
   44    txArray[
"Account"] = 
toBase58(accountID);
 
   45    auto& fees = ledger.
fees();
 
 
   64    auto const& params(context.
params);
 
   65    if (!params.isMember(jss::account))
 
   68    if (!params.isMember(
"role"))
 
   71    if (!params[jss::account].isString())
 
   74    bool roleGateway = 
false;
 
   77        if (role == 
"gateway")
 
   79        else if (role != 
"user")
 
   87    bool transactions = 
false;
 
   88    if (params.isMember(jss::transactions))
 
   89        transactions = params[
"transactions"].asBool();
 
   95    if (context.
apiVersion > 1u && params.isMember(jss::transactions) &&
 
   96        !params[jss::transactions].isBool())
 
  110    auto id = parseBase58<AccountID>(params[jss::account].asString());
 
  116    auto const accountID{std::move(
id.value())};
 
  127    if (bDefaultRipple & !roleGateway)
 
  130            "You appear to have set your default ripple flag even though you " 
  131            "are not a gateway. This is not recommended unless you are " 
  134    else if (roleGateway & !bDefaultRipple)
 
  136        problems.
append(
"You should immediately set your default ripple flag");
 
  140            tx[
"TransactionType"] = jss::AccountSet;
 
  153            if (ownedItem->getType() == ltRIPPLE_STATE)
 
  155                bool const bLow = accountID ==
 
  156                    ownedItem->getFieldAmount(sfLowLimit).getIssuer();
 
  158                bool const bNoRipple = ownedItem->getFieldU32(sfFlags) &
 
  159                    (bLow ? lsfLowNoRipple : lsfHighNoRipple);
 
  162                bool needFix = false;
 
  163                if (bNoRipple & roleGateway)
 
  165                    problem = 
"You should clear the no ripple flag on your ";
 
  168                else if (!roleGateway & !bNoRipple)
 
  171                        "You should probably set the no ripple flag on your ";
 
  178                            ->getFieldAmount(bLow ? sfHighLimit : sfLowLimit)
 
  180                    STAmount peerLimit = ownedItem->getFieldAmount(
 
  181                        bLow ? sfHighLimit : sfLowLimit);
 
  183                    problem += 
" line to ";
 
  187                    STAmount limitAmount(ownedItem->getFieldAmount(
 
  188                        bLow ? sfLowLimit : sfHighLimit));
 
  192                    tx[
"TransactionType"] = jss::TrustSet;
 
 
Value & append(Value const &value)
Append value to array at the end.
 
virtual LoadFeeTrack & getFeeTrack()=0
 
virtual Fees const & fees() const =0
Returns the fees for the base ledger.
 
Json::Value getJson(JsonOptions=JsonOptions::none) const override
 
void setIssuer(AccountID const &uIssuer)
 
Currency const & getCurrency() const
 
AccountID const & getIssuer() const
 
Json::Value jsonClipped() const
 
@ arrayValue
array value (ordered list)
 
@ objectValue
object value (collection of name/value pairs).
 
static LimitRange constexpr noRippleCheck
Limits for the no_ripple_check command.
 
Json::Value invalid_field_error(std::string const &name)
 
void inject_error(error_code_i code, JsonValue &json)
Add or update the json update to reflect the error code.
 
Status lookupLedger(std::shared_ptr< ReadView const > &ledger, JsonContext &context, Json::Value &result)
Look up a ledger from a request and fill a Json::Result with the data representing a ledger.
 
Json::Value missing_field_error(std::string const &name)
 
Keylet account(AccountID const &id) noexcept
AccountID root.
 
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
 
std::string toBase58(AccountID const &v)
Convert AccountID to base58 checked string.
 
Json::Value doNoRippleCheck(RPC::JsonContext &)
 
Json::Value rpcError(int iError)
 
constexpr std::uint32_t tfClearNoRipple
 
bool forEachItemAfter(ReadView const &view, Keylet const &root, uint256 const &after, std::uint64_t const hint, unsigned int limit, std::function< bool(std::shared_ptr< SLE const > const &)> const &f)
Iterate all items after an item in the given directory.
 
std::string to_string(base_uint< Bits, Tag > const &a)
 
XRPAmount scaleFeeLoad(XRPAmount fee, LoadFeeTrack const &feeTrack, Fees const &fees, bool bUnlimited)
 
constexpr std::uint32_t tfSetNoRipple
 
static void fillTransaction(RPC::JsonContext &context, Json::Value &txArray, AccountID const &accountID, std::uint32_t &sequence, ReadView const &ledger)