xrpld
Loading...
Searching...
No Matches
tx/transactors/token/MPTokenIssuanceCreate.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/core/ServiceRegistry.h>
7#include <xrpl/ledger/ApplyView.h>
8#include <xrpl/ledger/ReadView.h>
9#include <xrpl/protocol/AccountID.h>
10#include <xrpl/protocol/STTx.h>
11#include <xrpl/protocol/TER.h>
12#include <xrpl/protocol/UintTypes.h>
13#include <xrpl/protocol/XRPAmount.h>
14#include <xrpl/tx/ApplyContext.h>
15#include <xrpl/tx/Transactor.h>
16
17#include <cstdint>
18#include <expected>
19#include <optional>
20
21namespace xrpl {
22
23// NOLINTBEGIN(readability-redundant-member-init)
25{
36 // Set only by callers that issue an MPT representing a wrapped asset
37 // (e.g. VaultCreate's share token). The keylet must point to an
38 // existing MPToken or RippleState owned by `account`. Surfaces on
39 // the resulting MPTokenIssuance via the optional sfReferenceHolding
40 // field. Used by readers (canTransfer, canTrade, freezing) to
41 // inherit the underlying asset's transferability.
43};
44// NOLINTEND(readability-redundant-member-init)
45
47{
48public:
50
52 {
53 }
54
55 static bool
57
58 static std::uint32_t
60
61 static NotTEC
62 preflight(PreflightContext const& ctx);
63
64 TER
65 doApply() override;
66
67 void
68 visitInvariantEntry(bool isDelete, SLE::const_ref before, SLE::const_ref after) override;
69
70 [[nodiscard]] bool
72 STTx const& tx,
73 TER result,
74 XRPAmount fee,
75 ReadView const& view,
76 beast::Journal const& j) override;
77
78 static std::expected<MPTID, TER>
79 create(ApplyViewContext ctx, beast::Journal journal, MPTCreateArgs const& args);
80};
81
82} // namespace xrpl
A generic endpoint for log messages.
Definition Journal.h:44
State information when applying a tx.
bool finalizeInvariants(STTx const &tx, TER result, XRPAmount fee, ReadView const &view, beast::Journal const &j) override
Check transaction-specific post-conditions after all entries have been visited.
void visitInvariantEntry(bool isDelete, SLE::const_ref before, SLE::const_ref after) override
Inspect a single ledger entry modified by this transaction.
static bool checkExtraFeatures(PreflightContext const &ctx)
static std::uint32_t getFlagsMask(PreflightContext const &ctx)
static NotTEC preflight(PreflightContext const &ctx)
static std::expected< MPTID, TER > create(ApplyViewContext ctx, beast::Journal journal, MPTCreateArgs const &args)
A view into a ledger.
Definition ReadView.h:41
std::shared_ptr< STLedgerEntry const > const & const_ref
ApplyView & view()
Definition Transactor.h:175
Transactor(Transactor const &)=delete
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
TERSubset< CanCvtToNotTEC > NotTEC
Definition TER.h:607
bool after(NetClock::time_point now, std::uint32_t mark)
Has the specified time passed?
Definition View.cpp:572
BaseUInt< 160, detail::AccountIDTag > AccountID
A 160-bit unsigned that uniquely identifies an account.
Definition AccountID.h:34
TERSubset< CanCvtToTER > TER
Definition TER.h:647
Bundles the mutable ledger view and the transaction being applied.
Definition ApplyView.h:444
std::optional< std::uint16_t > transferFee
std::optional< std::uint32_t > immutableFlags
State information when preflighting a tx.
Definition Transactor.h:38