xrpld
Toggle main menu visibility
Loading...
Searching...
No Matches
include
xrpl
protocol_autogen
transactions
protocol_autogen/transactions/LoanManage.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
14
namespace
xrpl::transactions
{
15
16
class
LoanManageBuilder
;
17
29
class
LoanManage
:
public
TransactionBase
30
{
31
public
:
32
static
constexpr
xrpl::TxType
txType
= ttLOAN_MANAGE;
33
38
explicit
LoanManage
(
std::shared_ptr<STTx const>
tx)
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 LoanManage"
);
45
}
46
}
47
48
// Transaction-specific field getters
49
54
[[nodiscard]]
55
SF_UINT256::type::value_type
56
getLoanID
()
const
57
{
58
return
this->
tx_
->at(sfLoanID);
59
}
60
};
61
69
class
LoanManageBuilder
:
public
TransactionBuilderBase
<LoanManageBuilder>
70
{
71
public
:
79
LoanManageBuilder
(SF_ACCOUNT::type::value_type account,
80
std::decay_t<typename SF_UINT256::type::value_type>
const
& loanID,
std::optional<SF_UINT32::type::value_type>
sequence = std::nullopt,
81
std::optional<SF_AMOUNT::type::value_type>
fee = std::nullopt
82
)
83
:
TransactionBuilderBase
<
LoanManageBuilder
>(ttLOAN_MANAGE, account, sequence, fee)
84
{
85
setLoanID
(loanID);
86
}
87
93
LoanManageBuilder
(
std::shared_ptr<STTx const>
tx)
94
{
95
if
(tx->getTxnType() != ttLOAN_MANAGE)
96
{
97
throw
std::runtime_error
(
"Invalid transaction type for LoanManageBuilder"
);
98
}
99
object_
= *tx;
100
}
101
105
110
LoanManageBuilder
&
111
setLoanID
(
std::decay_t<typename SF_UINT256::type::value_type>
const
& value)
112
{
113
object_
[sfLoanID] = value;
114
return
*
this
;
115
}
116
123
LoanManage
124
build
(
PublicKey
const
& publicKey,
SecretKey
const
& secretKey)
125
{
126
sign
(publicKey, secretKey);
127
return
LoanManage
{
std::make_shared<STTx>
(std::move(
object_
))};
128
}
129
};
130
131
}
// namespace xrpl::transactions
xrpl::PublicKey
A public key.
Definition
PublicKey.h:53
xrpl::SecretKey
A secret key.
Definition
SecretKey.h:24
xrpl::transactions::LoanManageBuilder
Builder for LoanManage transactions.
Definition
protocol_autogen/transactions/LoanManage.h:70
xrpl::transactions::LoanManageBuilder::setLoanID
LoanManageBuilder & setLoanID(std::decay_t< typename SF_UINT256::type::value_type > const &value)
Transaction-specific field setters.
Definition
protocol_autogen/transactions/LoanManage.h:111
xrpl::transactions::LoanManageBuilder::build
LoanManage build(PublicKey const &publicKey, SecretKey const &secretKey)
Build and return the LoanManage wrapper.
Definition
protocol_autogen/transactions/LoanManage.h:124
xrpl::transactions::LoanManageBuilder::LoanManageBuilder
LoanManageBuilder(SF_ACCOUNT::type::value_type account, std::decay_t< typename SF_UINT256::type::value_type > const &loanID, std::optional< SF_UINT32::type::value_type > sequence=std::nullopt, std::optional< SF_AMOUNT::type::value_type > fee=std::nullopt)
Construct a new LoanManageBuilder with required fields.
Definition
protocol_autogen/transactions/LoanManage.h:79
xrpl::transactions::LoanManageBuilder::LoanManageBuilder
LoanManageBuilder(std::shared_ptr< STTx const > tx)
Construct a LoanManageBuilder from an existing STTx object.
Definition
protocol_autogen/transactions/LoanManage.h:93
xrpl::transactions::LoanManage
Transaction: LoanManage.
Definition
protocol_autogen/transactions/LoanManage.h:30
xrpl::transactions::LoanManage::getLoanID
SF_UINT256::type::value_type getLoanID() const
Get sfLoanID (SoeRequired).
Definition
protocol_autogen/transactions/LoanManage.h:56
xrpl::transactions::LoanManage::txType
static constexpr xrpl::TxType txType
Definition
protocol_autogen/transactions/LoanManage.h:32
xrpl::transactions::LoanManage::LoanManage
LoanManage(std::shared_ptr< STTx const > tx)
Construct a LoanManage transaction wrapper from an existing STTx object.
Definition
protocol_autogen/transactions/LoanManage.h:38
xrpl::transactions::TransactionBase::tx_
std::shared_ptr< STTx const > tx_
The underlying transaction object being wrapped.
Definition
TransactionBase.h:456
xrpl::transactions::TransactionBase::TransactionBase
TransactionBase(std::shared_ptr< STTx const > tx)
Construct a transaction wrapper from an existing STTx object.
Definition
TransactionBase.h:31
xrpl::transactions::TransactionBuilderBase< LoanManageBuilder >::object_
STObject object_
Definition
TransactionBuilderBase.h:266
xrpl::transactions::TransactionBuilderBase< LoanManageBuilder >::TransactionBuilderBase
TransactionBuilderBase()=default
xrpl::transactions::TransactionBuilderBase< LoanManageBuilder >::sign
LoanManageBuilder & sign(PublicKey const &publicKey, SecretKey const &secretKey)
Definition
TransactionBuilderBase.h:248
std::decay_t
std::make_shared
T make_shared(T... args)
std
STL namespace.
xrpl::transactions
Definition
TransactionBase.h:15
xrpl::TxType
TxType
Transaction type identifiers.
Definition
TxFormats.h:45
optional
std::runtime_error
std::shared_ptr
stdexcept
Generated by
1.17.0