20 #include <ripple/ledger/ReadView.h>
21 #include <ripple/protocol/ErrorCodes.h>
22 #include <ripple/protocol/Indexes.h>
23 #include <ripple/protocol/jss.h>
24 #include <ripple/rpc/Context.h>
25 #include <ripple/rpc/impl/RPCHelpers.h>
42 if (!params.
isMember(jss::source_account))
44 if (!params[jss::source_account].isString())
52 srcAcct, params[jss::source_account].asString(),
true);
58 if (!params.
isMember(jss::destination_account))
60 if (!params[jss::destination_account].isString())
68 dstAcct, params[jss::destination_account].asString(),
true);
96 bool depositAuthorized{
true};
97 if (srcAcct != dstAcct)
104 auto const sleDepositAuth =
106 depositAuthorized =
static_cast<bool>(sleDepositAuth);
109 result[jss::source_account] = params[jss::source_account].
asString();
110 result[jss::destination_account] =
111 params[jss::destination_account].
asString();
113 result[jss::deposit_authorized] = depositAuthorized;
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)
Integers of any length that is a multiple of 32-bits.
std::string expected_field_message(std::string const &name, std::string const &type)
Keylet account(AccountID const &id) noexcept
AccountID root.
virtual bool exists(Keylet const &k) const =0
Determine if a state item exists.
bool isMember(const char *key) const
Return true if the object has a member named key.
virtual std::shared_ptr< SLE const > read(Keylet const &k) const =0
Return the state item associated with a key.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Json::Value doDepositAuthorized(RPC::JsonContext &context)
Keylet depositPreauth(AccountID const &owner, AccountID const &preauthorized) noexcept
A DepositPreauth.
void inject_error(error_code_i code, JsonValue &json)
Add or update the json update to reflect the error code.
Json::Value accountFromString(AccountID &result, std::string const &strIdent, bool bStrict)
Json::Value make_error(error_code_i code)
Returns a new json object that reflects the error code.
std::string asString() const
Returns the unquoted string value.