xrpld
Loading...
Searching...
No Matches
tx/transactors/nft/NFTokenMint.h
1#pragma once
2
3#include <xrpl/basics/base_uint.h>
4#include <xrpl/beast/utility/Journal.h>
5#include <xrpl/core/ServiceRegistry.h>
6#include <xrpl/ledger/ReadView.h>
7#include <xrpl/protocol/AccountID.h>
8#include <xrpl/protocol/STTx.h>
9#include <xrpl/protocol/TER.h>
10#include <xrpl/protocol/XRPAmount.h>
11#include <xrpl/protocol/nft.h>
12#include <xrpl/tx/ApplyContext.h>
13#include <xrpl/tx/Transactor.h>
14
15#include <cstdint>
16
17namespace xrpl {
18
19class NFTokenMint : public Transactor
20{
21public:
23
24 explicit NFTokenMint(ApplyContext& ctx) : Transactor(ctx)
25 {
26 }
27
28 static bool
30
31 static std::uint32_t
33
34 static NotTEC
35 preflight(PreflightContext const& ctx);
36
37 static TER
38 preclaim(PreclaimContext const& ctx);
39
40 TER
41 doApply() override;
42
43 void
44 visitInvariantEntry(bool isDelete, SLE::const_ref before, SLE::const_ref after) override;
45
46 [[nodiscard]] bool
48 STTx const& tx,
49 TER result,
50 XRPAmount fee,
51 ReadView const& view,
52 beast::Journal const& j) override;
53
54 // Public to support unit tests.
55 static uint256
57 std::uint16_t flags,
58 std::uint16_t fee,
59 AccountID const& issuer,
60 nft::Taxon taxon,
61 std::uint32_t tokenSeq);
62};
63
64} // namespace xrpl
A generic endpoint for log messages.
Definition Journal.h:44
State information when applying a tx.
static uint256 createNFTokenID(std::uint16_t flags, std::uint16_t fee, AccountID const &issuer, nft::Taxon taxon, std::uint32_t tokenSeq)
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.
static NotTEC preflight(PreflightContext const &ctx)
void visitInvariantEntry(bool isDelete, SLE::const_ref before, SLE::const_ref after) override
Inspect a single ledger entry modified by this transaction.
static std::uint32_t getFlagsMask(PreflightContext const &ctx)
static constexpr auto kConsequencesFactory
TER doApply() override
static TER preclaim(PreclaimContext const &ctx)
static bool checkExtraFeatures(PreflightContext const &ctx)
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
TaggedInteger< std::uint32_t, TaxonTag > Taxon
Definition nft.h:18
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
BaseUInt< 256 > uint256
Definition base_uint.h:580
State information when determining if a tx is likely to claim a fee.
Definition Transactor.h:83
State information when preflighting a tx.
Definition Transactor.h:38