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>
44 throw std::runtime_error(
"Invalid transaction type for OracleSet");
55 SF_UINT32::type::value_type
58 return this->
tx_->at(sfOracleDocumentID);
71 return this->
tx_->at(sfProvider);
84 return this->
tx_->isFieldPresent(sfProvider);
97 return this->
tx_->at(sfURI);
110 return this->
tx_->isFieldPresent(sfURI);
123 return this->
tx_->at(sfAssetClass);
136 return this->
tx_->isFieldPresent(sfAssetClass);
144 SF_UINT32::type::value_type
147 return this->
tx_->at(sfLastUpdateTime);
158 return this->
tx_->getFieldArray(sfPriceDataSeries);
199 if (tx->getTxnType() != ttORACLE_SET)
215 object_[sfOracleDocumentID] = value;
259 object_[sfLastUpdateTime] = value;
270 object_.setFieldArray(sfPriceDataSeries, value);
283 sign(publicKey, secretKey);
Builder for OracleSet transactions.
OracleSetBuilder & setAssetClass(std::decay_t< typename SF_VL::type::value_type > const &value)
Set sfAssetClass (SoeOptional).
OracleSet build(PublicKey const &publicKey, SecretKey const &secretKey)
Build and return the OracleSet wrapper.
OracleSetBuilder(SF_ACCOUNT::type::value_type account, std::decay_t< typename SF_UINT32::type::value_type > const &oracleDocumentID, std::decay_t< typename SF_UINT32::type::value_type > const &lastUpdateTime, STArray const &priceDataSeries, std::optional< SF_UINT32::type::value_type > sequence=std::nullopt, std::optional< SF_AMOUNT::type::value_type > fee=std::nullopt)
Construct a new OracleSetBuilder with required fields.
OracleSetBuilder & setProvider(std::decay_t< typename SF_VL::type::value_type > const &value)
Set sfProvider (SoeOptional).
OracleSetBuilder & setLastUpdateTime(std::decay_t< typename SF_UINT32::type::value_type > const &value)
Set sfLastUpdateTime (SoeRequired).
OracleSetBuilder & setURI(std::decay_t< typename SF_VL::type::value_type > const &value)
Set sfURI (SoeOptional).
OracleSetBuilder & setOracleDocumentID(std::decay_t< typename SF_UINT32::type::value_type > const &value)
Transaction-specific field setters.
OracleSetBuilder & setPriceDataSeries(STArray const &value)
Set sfPriceDataSeries (SoeRequired).
OracleSetBuilder(std::shared_ptr< STTx const > tx)
Construct a OracleSetBuilder from an existing STTx object.
bool hasProvider() const
Check if sfProvider is present.
STArray const & getPriceDataSeries() const
Get sfPriceDataSeries (SoeRequired).
OracleSet(std::shared_ptr< STTx const > tx)
Construct a OracleSet transaction wrapper from an existing STTx object.
SF_UINT32::type::value_type getLastUpdateTime() const
Get sfLastUpdateTime (SoeRequired).
SF_UINT32::type::value_type getOracleDocumentID() const
Get sfOracleDocumentID (SoeRequired).
bool hasAssetClass() const
Check if sfAssetClass is present.
protocol_autogen::Optional< SF_VL::type::value_type > getProvider() const
Get sfProvider (SoeOptional).
bool hasURI() const
Check if sfURI is present.
static constexpr xrpl::TxType txType
protocol_autogen::Optional< SF_VL::type::value_type > getAssetClass() const
Get sfAssetClass (SoeOptional).
protocol_autogen::Optional< SF_VL::type::value_type > getURI() const
Get sfURI (SoeOptional).
std::shared_ptr< STTx const > tx_
The underlying transaction object being wrapped.
TransactionBase(std::shared_ptr< STTx const > tx)
Construct a transaction wrapper from an existing STTx object.
TransactionBuilderBase()=default
OracleSetBuilder & sign(PublicKey const &publicKey, SecretKey const &secretKey)
std::conditional_t< std::is_reference_v< ValueType >, std::optional< std::reference_wrapper< std::remove_reference_t< ValueType > > >, std::optional< ValueType > > Optional
TxType
Transaction type identifiers.