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 LoanSet");
55 SF_UINT256::type::value_type
58 return this->
tx_->at(sfLoanBrokerID);
71 return this->
tx_->at(sfData);
84 return this->
tx_->isFieldPresent(sfData);
97 return this->
tx_->at(sfCounterparty);
110 return this->
tx_->isFieldPresent(sfCounterparty);
121 if (this->
tx_->isFieldPresent(sfCounterpartySignature))
122 return this->
tx_->getFieldObject(sfCounterpartySignature);
134 return this->
tx_->isFieldPresent(sfCounterpartySignature);
147 return this->
tx_->at(sfLoanOriginationFee);
160 return this->
tx_->isFieldPresent(sfLoanOriginationFee);
173 return this->
tx_->at(sfLoanServiceFee);
186 return this->
tx_->isFieldPresent(sfLoanServiceFee);
199 return this->
tx_->at(sfLatePaymentFee);
212 return this->
tx_->isFieldPresent(sfLatePaymentFee);
225 return this->
tx_->at(sfClosePaymentFee);
238 return this->
tx_->isFieldPresent(sfClosePaymentFee);
251 return this->
tx_->at(sfOverpaymentFee);
264 return this->
tx_->isFieldPresent(sfOverpaymentFee);
277 return this->
tx_->at(sfInterestRate);
290 return this->
tx_->isFieldPresent(sfInterestRate);
303 return this->
tx_->at(sfLateInterestRate);
316 return this->
tx_->isFieldPresent(sfLateInterestRate);
329 return this->
tx_->at(sfCloseInterestRate);
342 return this->
tx_->isFieldPresent(sfCloseInterestRate);
355 return this->
tx_->at(sfOverpaymentInterestRate);
368 return this->
tx_->isFieldPresent(sfOverpaymentInterestRate);
376 SF_NUMBER::type::value_type
379 return this->
tx_->at(sfPrincipalRequested);
392 return this->
tx_->at(sfPaymentTotal);
405 return this->
tx_->isFieldPresent(sfPaymentTotal);
418 return this->
tx_->at(sfPaymentInterval);
431 return this->
tx_->isFieldPresent(sfPaymentInterval);
444 return this->
tx_->at(sfGracePeriod);
457 return this->
tx_->isFieldPresent(sfGracePeriod);
496 if (tx->getTxnType() != ttLOAN_SET)
514 object_[sfLoanBrokerID] = value;
536 object_[sfCounterparty] = value;
547 object_.setFieldObject(sfCounterpartySignature, value);
558 object_[sfLoanOriginationFee] = value;
569 object_[sfLoanServiceFee] = value;
580 object_[sfLatePaymentFee] = value;
591 object_[sfClosePaymentFee] = value;
602 object_[sfOverpaymentFee] = value;
613 object_[sfInterestRate] = value;
624 object_[sfLateInterestRate] = value;
635 object_[sfCloseInterestRate] = value;
646 object_[sfOverpaymentInterestRate] = value;
657 object_[sfPrincipalRequested] = value;
668 object_[sfPaymentTotal] = value;
679 object_[sfPaymentInterval] = value;
690 object_[sfGracePeriod] = value;
703 sign(publicKey, secretKey);
Builder for LoanSet transactions.
LoanSetBuilder & setLoanServiceFee(std::decay_t< typename SF_NUMBER::type::value_type > const &value)
Set sfLoanServiceFee (SoeOptional).
LoanSetBuilder & setLoanOriginationFee(std::decay_t< typename SF_NUMBER::type::value_type > const &value)
Set sfLoanOriginationFee (SoeOptional).
LoanSetBuilder(SF_ACCOUNT::type::value_type account, std::decay_t< typename SF_UINT256::type::value_type > const &loanBrokerID, std::decay_t< typename SF_NUMBER::type::value_type > const &principalRequested, std::optional< SF_UINT32::type::value_type > sequence=std::nullopt, std::optional< SF_AMOUNT::type::value_type > fee=std::nullopt)
Construct a new LoanSetBuilder with required fields.
LoanSetBuilder & setLateInterestRate(std::decay_t< typename SF_UINT32::type::value_type > const &value)
Set sfLateInterestRate (SoeOptional).
LoanSetBuilder(std::shared_ptr< STTx const > tx)
Construct a LoanSetBuilder from an existing STTx object.
LoanSetBuilder & setOverpaymentInterestRate(std::decay_t< typename SF_UINT32::type::value_type > const &value)
Set sfOverpaymentInterestRate (SoeOptional).
LoanSetBuilder & setPaymentInterval(std::decay_t< typename SF_UINT32::type::value_type > const &value)
Set sfPaymentInterval (SoeOptional).
LoanSetBuilder & setClosePaymentFee(std::decay_t< typename SF_NUMBER::type::value_type > const &value)
Set sfClosePaymentFee (SoeOptional).
LoanSetBuilder & setData(std::decay_t< typename SF_VL::type::value_type > const &value)
Set sfData (SoeOptional).
LoanSetBuilder & setCounterpartySignature(STObject const &value)
Set sfCounterpartySignature (SoeOptional).
LoanSetBuilder & setLatePaymentFee(std::decay_t< typename SF_NUMBER::type::value_type > const &value)
Set sfLatePaymentFee (SoeOptional).
LoanSetBuilder & setInterestRate(std::decay_t< typename SF_UINT32::type::value_type > const &value)
Set sfInterestRate (SoeOptional).
LoanSet build(PublicKey const &publicKey, SecretKey const &secretKey)
Build and return the LoanSet wrapper.
LoanSetBuilder & setLoanBrokerID(std::decay_t< typename SF_UINT256::type::value_type > const &value)
Transaction-specific field setters.
LoanSetBuilder & setOverpaymentFee(std::decay_t< typename SF_UINT32::type::value_type > const &value)
Set sfOverpaymentFee (SoeOptional).
LoanSetBuilder & setCounterparty(std::decay_t< typename SF_ACCOUNT::type::value_type > const &value)
Set sfCounterparty (SoeOptional).
LoanSetBuilder & setPaymentTotal(std::decay_t< typename SF_UINT32::type::value_type > const &value)
Set sfPaymentTotal (SoeOptional).
LoanSetBuilder & setGracePeriod(std::decay_t< typename SF_UINT32::type::value_type > const &value)
Set sfGracePeriod (SoeOptional).
LoanSetBuilder & setCloseInterestRate(std::decay_t< typename SF_UINT32::type::value_type > const &value)
Set sfCloseInterestRate (SoeOptional).
LoanSetBuilder & setPrincipalRequested(std::decay_t< typename SF_NUMBER::type::value_type > const &value)
Set sfPrincipalRequested (SoeRequired).
SF_NUMBER::type::value_type getPrincipalRequested() const
Get sfPrincipalRequested (SoeRequired).
bool hasCounterparty() const
Check if sfCounterparty is present.
bool hasCounterpartySignature() const
Check if sfCounterpartySignature is present.
bool hasInterestRate() const
Check if sfInterestRate is present.
protocol_autogen::Optional< SF_NUMBER::type::value_type > getLoanOriginationFee() const
Get sfLoanOriginationFee (SoeOptional).
bool hasLoanOriginationFee() const
Check if sfLoanOriginationFee is present.
protocol_autogen::Optional< SF_UINT32::type::value_type > getGracePeriod() const
Get sfGracePeriod (SoeOptional).
protocol_autogen::Optional< SF_UINT32::type::value_type > getOverpaymentFee() const
Get sfOverpaymentFee (SoeOptional).
protocol_autogen::Optional< SF_NUMBER::type::value_type > getLoanServiceFee() const
Get sfLoanServiceFee (SoeOptional).
protocol_autogen::Optional< SF_VL::type::value_type > getData() const
Get sfData (SoeOptional).
bool hasCloseInterestRate() const
Check if sfCloseInterestRate is present.
bool hasOverpaymentInterestRate() const
Check if sfOverpaymentInterestRate is present.
bool hasLateInterestRate() const
Check if sfLateInterestRate is present.
protocol_autogen::Optional< SF_UINT32::type::value_type > getPaymentInterval() const
Get sfPaymentInterval (SoeOptional).
protocol_autogen::Optional< SF_ACCOUNT::type::value_type > getCounterparty() const
Get sfCounterparty (SoeOptional).
bool hasOverpaymentFee() const
Check if sfOverpaymentFee is present.
protocol_autogen::Optional< SF_UINT32::type::value_type > getOverpaymentInterestRate() const
Get sfOverpaymentInterestRate (SoeOptional).
bool hasPaymentTotal() const
Check if sfPaymentTotal is present.
bool hasLatePaymentFee() const
Check if sfLatePaymentFee is present.
bool hasLoanServiceFee() const
Check if sfLoanServiceFee is present.
std::optional< STObject > getCounterpartySignature() const
Get sfCounterpartySignature (SoeOptional).
protocol_autogen::Optional< SF_UINT32::type::value_type > getLateInterestRate() const
Get sfLateInterestRate (SoeOptional).
SF_UINT256::type::value_type getLoanBrokerID() const
Get sfLoanBrokerID (SoeRequired).
protocol_autogen::Optional< SF_NUMBER::type::value_type > getLatePaymentFee() const
Get sfLatePaymentFee (SoeOptional).
protocol_autogen::Optional< SF_UINT32::type::value_type > getCloseInterestRate() const
Get sfCloseInterestRate (SoeOptional).
protocol_autogen::Optional< SF_UINT32::type::value_type > getInterestRate() const
Get sfInterestRate (SoeOptional).
bool hasPaymentInterval() const
Check if sfPaymentInterval is present.
static constexpr xrpl::TxType txType
protocol_autogen::Optional< SF_UINT32::type::value_type > getPaymentTotal() const
Get sfPaymentTotal (SoeOptional).
bool hasGracePeriod() const
Check if sfGracePeriod is present.
LoanSet(std::shared_ptr< STTx const > tx)
Construct a LoanSet transaction wrapper from an existing STTx object.
protocol_autogen::Optional< SF_NUMBER::type::value_type > getClosePaymentFee() const
Get sfClosePaymentFee (SoeOptional).
bool hasClosePaymentFee() const
Check if sfClosePaymentFee is present.
bool hasData() const
Check if sfData is present.
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
LoanSetBuilder & 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.