rippled
Loading...
Searching...
No Matches
protocol_autogen/transactions/NFTokenAcceptOffer.h
1// This file is auto-generated. Do not edit.
2#pragma once
3
4#include <xrpl/protocol/STTx.h>
5#include <xrpl/protocol/STParsedJSON.h>
6#include <xrpl/protocol/jss.h>
7#include <xrpl/protocol_autogen/TransactionBase.h>
8#include <xrpl/protocol_autogen/TransactionBuilderBase.h>
9#include <xrpl/json/json_value.h>
10
11#include <stdexcept>
12#include <optional>
13
14namespace xrpl::transactions {
15
16class NFTokenAcceptOfferBuilder;
17
30{
31public:
32 static constexpr xrpl::TxType txType = ttNFTOKEN_ACCEPT_OFFER;
33
39 : TransactionBase(std::move(tx))
40 {
41 // Verify transaction type
42 if (tx_->getTxnType() != txType)
43 {
44 throw std::runtime_error("Invalid transaction type for NFTokenAcceptOffer");
45 }
46 }
47
48 // Transaction-specific field getters
49
54 [[nodiscard]]
57 {
59 {
60 return this->tx_->at(sfNFTokenBuyOffer);
61 }
62 return std::nullopt;
63 }
64
69 [[nodiscard]]
70 bool
72 {
73 return this->tx_->isFieldPresent(sfNFTokenBuyOffer);
74 }
75
80 [[nodiscard]]
83 {
85 {
86 return this->tx_->at(sfNFTokenSellOffer);
87 }
88 return std::nullopt;
89 }
90
95 [[nodiscard]]
96 bool
98 {
99 return this->tx_->isFieldPresent(sfNFTokenSellOffer);
100 }
101
106 [[nodiscard]]
109 {
111 {
112 return this->tx_->at(sfNFTokenBrokerFee);
113 }
114 return std::nullopt;
115 }
116
121 [[nodiscard]]
122 bool
124 {
125 return this->tx_->isFieldPresent(sfNFTokenBrokerFee);
126 }
127};
128
136class NFTokenAcceptOfferBuilder : public TransactionBuilderBase<NFTokenAcceptOfferBuilder>
137{
138public:
145 NFTokenAcceptOfferBuilder(SF_ACCOUNT::type::value_type account,
148)
149 : TransactionBuilderBase<NFTokenAcceptOfferBuilder>(ttNFTOKEN_ACCEPT_OFFER, account, sequence, fee)
150 {
151 }
152
159 {
160 if (tx->getTxnType() != ttNFTOKEN_ACCEPT_OFFER)
161 {
162 throw std::runtime_error("Invalid transaction type for NFTokenAcceptOfferBuilder");
163 }
164 object_ = *tx;
165 }
166
175 {
176 object_[sfNFTokenBuyOffer] = value;
177 return *this;
178 }
179
186 {
187 object_[sfNFTokenSellOffer] = value;
188 return *this;
189 }
190
197 {
198 object_[sfNFTokenBrokerFee] = value;
199 return *this;
200 }
201
209 build(PublicKey const& publicKey, SecretKey const& secretKey)
210 {
211 sign(publicKey, secretKey);
213 }
214};
215
216} // namespace xrpl::transactions
A public key.
Definition PublicKey.h:42
A secret key.
Definition SecretKey.h:18
NFTokenAcceptOfferBuilder(std::shared_ptr< STTx const > tx)
Construct a NFTokenAcceptOfferBuilder from an existing STTx object.
NFTokenAcceptOfferBuilder & setNFTokenBuyOffer(std::decay_t< typename SF_UINT256::type::value_type > const &value)
Transaction-specific field setters.
NFTokenAcceptOfferBuilder(SF_ACCOUNT::type::value_type account, std::optional< SF_UINT32::type::value_type > sequence=std::nullopt, std::optional< SF_AMOUNT::type::value_type > fee=std::nullopt)
Construct a new NFTokenAcceptOfferBuilder with required fields.
NFTokenAcceptOffer build(PublicKey const &publicKey, SecretKey const &secretKey)
Build and return the NFTokenAcceptOffer wrapper.
NFTokenAcceptOfferBuilder & setNFTokenSellOffer(std::decay_t< typename SF_UINT256::type::value_type > const &value)
Set sfNFTokenSellOffer (soeOPTIONAL)
NFTokenAcceptOfferBuilder & setNFTokenBrokerFee(std::decay_t< typename SF_AMOUNT::type::value_type > const &value)
Set sfNFTokenBrokerFee (soeOPTIONAL)
bool hasNFTokenBuyOffer() const
Check if sfNFTokenBuyOffer is present.
bool hasNFTokenBrokerFee() const
Check if sfNFTokenBrokerFee is present.
protocol_autogen::Optional< SF_UINT256::type::value_type > getNFTokenBuyOffer() const
Get sfNFTokenBuyOffer (soeOPTIONAL)
bool hasNFTokenSellOffer() const
Check if sfNFTokenSellOffer is present.
protocol_autogen::Optional< SF_UINT256::type::value_type > getNFTokenSellOffer() const
Get sfNFTokenSellOffer (soeOPTIONAL)
protocol_autogen::Optional< SF_AMOUNT::type::value_type > getNFTokenBrokerFee() const
Get sfNFTokenBrokerFee (soeOPTIONAL)
NFTokenAcceptOffer(std::shared_ptr< STTx const > tx)
Construct a NFTokenAcceptOffer transaction wrapper from an existing STTx object.
Base class for all transaction wrapper types.
std::shared_ptr< STTx const > tx_
The underlying transaction object being wrapped.
Base class for all transaction builders.
NFTokenAcceptOfferBuilder & sign(PublicKey const &publicKey, SecretKey const &secretKey)
Sign the transaction with the given keys.
T is_same_v
STL namespace.
TxType
Transaction type identifiers.
Definition TxFormats.h:39