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/LoadFeeTrack.h>
24#include <xrpld/app/misc/NetworkOPs.h>
25#include <xrpld/rpc/Role.h>
26#include <xrpld/rpc/detail/Tuning.h>
27
28namespace ripple {
29
30// Forward declarations
31class Application;
32class LoadFeeTrack;
33class Transaction;
34class TxQ;
35
36namespace RPC {
37
40 Role const role,
41 Config const& config,
42 LoadFeeTrack const& feeTrack,
43 TxQ const& txQ,
44 Application const& app,
45 Json::Value const& tx,
48
78 Json::Value& request,
79 Role const role,
80 bool doAutoFill,
81 Config const& config,
82 LoadFeeTrack const& feeTrack,
83 TxQ const& txQ,
84 Application const& app);
85
86// Return a std::function<> that calls NetworkOPs::processTransaction.
89 bool bUnlimited,
90 bool bLocal,
91 NetworkOPs::FailHard failType)>;
92
95{
96 return [&netOPs](
98 bool bUnlimited,
99 bool bLocal,
100 NetworkOPs::FailHard failType) {
101 netOPs.processTransaction(transaction, bUnlimited, bLocal, failType);
102 };
103}
104
108 Json::Value params, // Passed by value so it can be modified locally.
109 unsigned apiVersion,
110 NetworkOPs::FailHard failType,
111 Role role,
112 std::chrono::seconds validatedLedgerAge,
113 Application& app);
114
118 Json::Value params, // Passed by value so it can be modified locally.
119 unsigned apiVersion,
120 NetworkOPs::FailHard failType,
121 Role role,
122 std::chrono::seconds validatedLedgerAge,
123 Application& app,
124 ProcessTransactionFn const& processTransaction);
125
129 Json::Value params, // Passed by value so it can be modified locally.
130 unsigned apiVersion,
131 NetworkOPs::FailHard failType,
132 Role role,
133 std::chrono::seconds validatedLedgerAge,
134 Application& app);
135
139 Json::Value params, // Passed by value so it can be modified locally.
140 unsigned apiVersion,
141 NetworkOPs::FailHard failType,
142 Role role,
143 std::chrono::seconds validatedLedgerAge,
144 Application& app,
145 ProcessTransactionFn const& processTransaction);
146
147} // namespace RPC
148} // namespace ripple
149
150#endif
Represents a JSON value.
Definition: json_value.h:148
Provides server functionality for clients.
Definition: NetworkOPs.h:88
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.
static int constexpr defaultAutoFillFeeMultiplier
static int constexpr defaultAutoFillFeeDivisor
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 getCurrentNetworkFee(Role const role, Config const &config, LoadFeeTrack const &feeTrack, TxQ const &txQ, Application const &app, Json::Value const &tx, int mult, int div)
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:44