xrpld
Loading...
Searching...
No Matches
DepositPreauthEntry.h
1#pragma once
2
3#include <xrpl/basics/Slice.h>
4#include <xrpl/basics/base_uint.h>
5#include <xrpl/beast/utility/Journal.h>
6#include <xrpl/ledger/ApplyView.h>
7#include <xrpl/ledger/ReadView.h>
8#include <xrpl/ledger/entries/SLEBase.h>
9#include <xrpl/protocol/AccountID.h>
10#include <xrpl/protocol/Indexes.h>
11#include <xrpl/protocol/LedgerFormats.h>
12
13#include <set>
14#include <utility>
15
16namespace xrpl {
17
18template <typename ViewT>
19class DepositPreauthEntry : public SLEBase<ViewT, ltDEPOSIT_PREAUTH>
20{
21public:
23
24 // Inherit base constructors: adopt an existing SLE, or resolve one from a
25 // Keylet against the view.
26 using Base::Base;
27
29 AccountID const& owner,
30 AccountID const& preauthorized,
33 : Base(keylet::depositPreauth(owner, preauthorized), view, j)
34 {
35 }
36
38 AccountID const& owner,
39 std::set<std::pair<AccountID, Slice>> const& authCreds,
42 : Base(keylet::depositPreauth(owner, authCreds), view, j)
43 {
44 }
45
47 UInt256 const& preauthID,
50 : Base(keylet::depositPreauth(preauthID), view, j)
51 {
52 }
53};
54
57
58} // namespace xrpl
A generic endpoint for log messages.
Definition Journal.h:44
static Sink & getNullSink()
Returns a Sink which does nothing.
DepositPreauthEntry(UInt256 const &preauthID, Base::ViewRefType view, beast::Journal j=beast::Journal{beast::Journal::getNullSink()})
SLEBase< ViewT, ltDEPOSIT_PREAUTH > Base
DepositPreauthEntry(AccountID const &owner, AccountID const &preauthorized, Base::ViewRefType view, beast::Journal j=beast::Journal{beast::Journal::getNullSink()})
DepositPreauthEntry(AccountID const &owner, std::set< std::pair< AccountID, Slice > > const &authCreds, Base::ViewRefType view, beast::Journal j=beast::Journal{beast::Journal::getNullSink()})
std::conditional_t< kIsWritable, ApplyView &, ReadView const & > ViewRefType
Definition SLEBase.h:106
Keylet computation functions.
Definition Indexes.h:40
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
BaseUInt< 256 > UInt256
Definition base_uint.h:580
DepositPreauthEntry< ReadView > DepositPreauthEntryR
BaseUInt< 160, detail::AccountIDTag > AccountID
A 160-bit unsigned that uniquely identifies an account.
Definition AccountID.h:34
DepositPreauthEntry< ApplyView > DepositPreauthEntryW