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/ledger/ApplyView.h>
26#include <xrpld/rpc/Role.h>
27#include <xrpld/rpc/detail/Tuning.h>
28
29namespace ripple {
30
31// Forward declarations
32class Application;
33class LoadFeeTrack;
34class Transaction;
35class TxQ;
36
37namespace RPC {
38
41 Role const role,
42 Config const& config,
43 LoadFeeTrack const& feeTrack,
44 TxQ const& txQ,
45 Application const& app,
46 Json::Value const& tx,
49
79 Json::Value& request,
80 Role const role,
81 bool doAutoFill,
82 Config const& config,
83 LoadFeeTrack const& feeTrack,
84 TxQ const& txQ,
85 Application const& app);
86
87// Return a std::function<> that calls NetworkOPs::processTransaction.
90 bool bUnlimited,
91 bool bLocal,
92 NetworkOPs::FailHard failType)>;
93
96{
97 return [&netOPs](
99 bool bUnlimited,
100 bool bLocal,
101 NetworkOPs::FailHard failType) {
102 netOPs.processTransaction(transaction, bUnlimited, bLocal, failType);
103 };
104}
105
109 Json::Value params, // Passed by value so it can be modified locally.
110 unsigned apiVersion,
111 NetworkOPs::FailHard failType,
112 Role role,
113 std::chrono::seconds validatedLedgerAge,
114 Application& app);
115
119 Json::Value params, // Passed by value so it can be modified locally.
120 unsigned apiVersion,
121 NetworkOPs::FailHard failType,
122 Role role,
123 std::chrono::seconds validatedLedgerAge,
124 Application& app,
125 ProcessTransactionFn const& processTransaction);
126
130 Json::Value params, // Passed by value so it can be modified locally.
131 unsigned apiVersion,
132 NetworkOPs::FailHard failType,
133 Role role,
134 std::chrono::seconds validatedLedgerAge,
135 Application& app);
136
140 Json::Value params, // Passed by value so it can be modified locally.
141 unsigned apiVersion,
142 NetworkOPs::FailHard failType,
143 Role role,
144 std::chrono::seconds validatedLedgerAge,
145 Application& app,
146 ProcessTransactionFn const& processTransaction);
147
148} // namespace RPC
149} // namespace ripple
150
151#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.
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:43