rippled
Loading...
Searching...
No Matches
SignFor.cpp
1#include <xrpld/app/ledger/LedgerMaster.h>
2#include <xrpld/rpc/Context.h>
3#include <xrpld/rpc/detail/TransactionSign.h>
4
5#include <xrpl/protocol/ErrorCodes.h>
6#include <xrpl/resource/Fees.h>
7
8namespace xrpl {
9
10// {
11// tx_json: <object>,
12// account: <signing account>
13// secret: <secret of signing account>
14// }
17{
18 if (context.role != Role::ADMIN && !context.app.config().canSign())
19 {
20 return RPC::make_error(rpcNOT_SUPPORTED, "Signing is not supported by this server.");
21 }
22
24 auto const failHard = context.params[jss::fail_hard].asBool();
25 auto const failType = NetworkOPs::doFailHard(failHard);
26
27 auto ret = RPC::transactionSignFor(
28 context.params,
29 context.apiVersion,
30 failType,
31 context.role,
33 context.app);
34
35 ret[jss::deprecated] =
36 "This command has been deprecated and will be "
37 "removed in a future version of the server. Please "
38 "migrate to a standalone signing tool.";
39 return ret;
40}
41
42} // namespace xrpl
Represents a JSON value.
Definition json_value.h:131
bool asBool() const
virtual Config & config()=0
bool canSign() const
Definition Config.h:324
std::chrono::seconds getValidatedLedgerAge()
static FailHard doFailHard(bool noMeansDont)
Definition NetworkOPs.h:76
Json::Value transactionSignFor(Json::Value jvRequest, unsigned apiVersion, NetworkOPs::FailHard failType, Role role, std::chrono::seconds validatedLedgerAge, Application &app)
Returns a Json::objectValue.
Json::Value make_error(error_code_i code)
Returns a new json object that reflects the error code.
Charge const feeHeavyBurdenRPC
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6
Json::Value doSignFor(RPC::JsonContext &)
Definition SignFor.cpp:16
@ rpcNOT_SUPPORTED
Definition ErrorCodes.h:113
Application & app
Definition Context.h:22
Resource::Charge & loadType
Definition Context.h:23
unsigned int apiVersion
Definition Context.h:30
LedgerMaster & ledgerMaster
Definition Context.h:25
Json::Value params
Definition Context.h:44