rippled
Loading...
Searching...
No Matches
TransactionSign.h
1//------------------------------------------------------------------------------
2/*
3 This file is part of rippled: https://github.com/ripple/rippled
4 Copyright (c) 2012-2014 Ripple Labs Inc.
5
6 Permission to use, copy, modify, and/or distribute this software for any
7 purpose with or without fee is hereby granted, provided that the above
8 copyright notice and this permission notice appear in all copies.
9
10 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17*/
18//==============================================================================
19
20#ifndef RIPPLE_RPC_TRANSACTIONSIGN_H_INCLUDED
21#define RIPPLE_RPC_TRANSACTIONSIGN_H_INCLUDED
22
23#include <xrpld/app/misc/NetworkOPs.h>
24#include <xrpld/ledger/ApplyView.h>
25#include <xrpld/rpc/Role.h>
26
27namespace ripple {
28
29// Forward declarations
30class Application;
31class LoadFeeTrack;
32class Transaction;
33class TxQ;
34
35namespace RPC {
36
66 Json::Value& request,
67 Role const role,
68 bool doAutoFill,
69 Config const& config,
70 LoadFeeTrack const& feeTrack,
71 TxQ const& txQ,
72 Application const& app);
73
74// Return a std::function<> that calls NetworkOPs::processTransaction.
77 bool bUnlimited,
78 bool bLocal,
79 NetworkOPs::FailHard failType)>;
80
83{
84 return [&netOPs](
86 bool bUnlimited,
87 bool bLocal,
88 NetworkOPs::FailHard failType) {
89 netOPs.processTransaction(transaction, bUnlimited, bLocal, failType);
90 };
91}
92
96 Json::Value params, // Passed by value so it can be modified locally.
97 unsigned apiVersion,
98 NetworkOPs::FailHard failType,
99 Role role,
100 std::chrono::seconds validatedLedgerAge,
101 Application& app);
102
106 Json::Value params, // Passed by value so it can be modified locally.
107 unsigned apiVersion,
108 NetworkOPs::FailHard failType,
109 Role role,
110 std::chrono::seconds validatedLedgerAge,
111 Application& app,
112 ProcessTransactionFn const& processTransaction);
113
117 Json::Value params, // Passed by value so it can be modified locally.
118 unsigned apiVersion,
119 NetworkOPs::FailHard failType,
120 Role role,
121 std::chrono::seconds validatedLedgerAge,
122 Application& app);
123
127 Json::Value params, // Passed by value so it can be modified locally.
128 unsigned apiVersion,
129 NetworkOPs::FailHard failType,
130 Role role,
131 std::chrono::seconds validatedLedgerAge,
132 Application& app,
133 ProcessTransactionFn const& processTransaction);
134
135} // namespace RPC
136} // namespace ripple
137
138#endif
Represents a JSON value.
Definition: json_value.h:147
Provides server functionality for clients.
Definition: NetworkOPs.h:87
virtual void processTransaction(std::shared_ptr< Transaction > &transaction, bool bUnlimited, bool bLocal, FailHard failType)=0
Process transactions as they arrive from the network or which are submitted by clients.
Json::Value transactionSign(Json::Value jvRequest, unsigned apiVersion, NetworkOPs::FailHard failType, Role role, std::chrono::seconds validatedLedgerAge, Application &app)
Returns a Json::objectValue.
std::function< void(std::shared_ptr< Transaction > &transaction, bool bUnlimited, bool bLocal, NetworkOPs::FailHard failType)> ProcessTransactionFn
Json::Value transactionSubmitMultiSigned(Json::Value jvRequest, unsigned apiVersion, NetworkOPs::FailHard failType, Role role, std::chrono::seconds validatedLedgerAge, Application &app, ProcessTransactionFn const &processTransaction)
Returns a Json::objectValue.
static constexpr std::integral_constant< unsigned, Version > apiVersion
Definition: ApiVersion.h:54
Json::Value transactionSubmit(Json::Value jvRequest, unsigned apiVersion, NetworkOPs::FailHard failType, Role role, std::chrono::seconds validatedLedgerAge, Application &app, ProcessTransactionFn const &processTransaction)
Returns a Json::objectValue.
ProcessTransactionFn getProcessTxnFn(NetworkOPs &netOPs)
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 checkFee(Json::Value &request, Role const role, bool doAutoFill, Config const &config, LoadFeeTrack const &feeTrack, TxQ const &txQ, Application const &app)
Fill in the fee on behalf of the client.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:26
Role
Indicates the level of administrative permission to grant.
Definition: Role.h:43