Date: Fri, 1 Sep 2023 22:54:46 +0000
Subject: [PATCH] deploy: b014b79d88baefe546c3113099581c6c8ee29df6
---
AMMCreate_8cpp_source.html | 182 +-
AMMCreate_8h_source.html | 2 +-
AMMDelete_8cpp_source.html | 2 +-
AMMDeposit_8cpp_source.html | 2 +-
AMMExtended__test_8cpp_source.html | 12 +-
AMMInfo_8cpp_source.html | 313 +-
AMMInfo__test_8cpp_source.html | 334 +-
AMMUtils_8cpp_source.html | 238 +-
AMMUtils_8h_source.html | 6 +-
AMMWithdraw_8cpp_source.html | 2 +-
AMM_8cpp_source.html | 1259 +++---
AMM_8h_source.html | 566 +--
AMM__test_8cpp_source.html | 26 +-
AcceptedLedgerTx_8cpp_source.html | 2 +-
AccountLinesRPC__test_8cpp_source.html | 4 +-
AccountObjects__test_8cpp_source.html | 1672 ++++----
CashCheck_8cpp_source.html | 2 +-
Clawback_8cpp_source.html | 2 +-
CreateOffer_8cpp_source.html | 4 +-
DeleteAccount_8cpp_source.html | 12 +-
DirectStep_8cpp_source.html | 2 +-
InvariantCheck_8cpp_source.html | 2 +-
JSONRPC__test_8cpp_source.html | 4 +-
LedgerCleaner_8cpp_source.html | 2 +-
LedgerFormats_8cpp_source.html | 31 +-
LedgerFormats_8h_source.html | 2 +-
LedgerMaster_8cpp_source.html | 2 +-
LedgerToJson_8cpp_source.html | 2 +-
NFTokenAcceptOffer_8cpp_source.html | 2 +-
NetworkOPs_8cpp_source.html | 4 +-
OfferStream_8cpp_source.html | 4 +-
Path__test_8cpp_source.html | 2 +-
PaymentSandbox__test_8cpp_source.html | 4 +-
RPCHelpers_8cpp_source.html | 2 +-
STInteger_8cpp_source.html | 2 +-
STLedgerEntry_8cpp_source.html | 2 +-
STParsedJSON_8cpp_source.html | 2 +-
Taker_8cpp_source.html | 2 +-
View_8cpp_source.html | 139 +-
View_8h_source.html | 661 ++--
View__test_8cpp_source.html | 4 +-
classripple_1_1AMMCreate.html | 2 +-
classripple_1_1LedgerFormats.html | 2 +-
classripple_1_1test_1_1AMMInfo__test.html | 8 +-
...ipple_1_1test_1_1AccountObjects__test.html | 12 +-
...sripple_1_1test_1_1jtx_1_1AMM-members.html | 4 +-
classripple_1_1test_1_1jtx_1_1AMM.html | 116 +-
functions.html | 2 +-
functions_e.html | 2 +-
functions_func.html | 2 +-
functions_func_e.html | 2 +-
jss_8h_source.html | 1089 ++---
namespacemembers_c.html | 2 +-
namespacemembers_e.html | 13 +-
namespacemembers_enum.html | 3 +
namespacemembers_func_c.html | 2 +-
namespacemembers_o.html | 2 +-
namespacemembers_s.html | 29 +-
namespacemembers_type.html | 3 +
namespaceripple.html | 94 +-
namespaceripple_1_1jss.html | 1234 +++---
namespaceripple_1_1test.html | 2 +-
namespaceripple_1_1test_1_1jtx_1_1amm.html | 4 +-
search/all_1.js | 2 +-
search/all_10.js | 1240 +++---
search/all_11.js | 98 +-
search/all_12.js | 1352 +++----
search/all_13.js | 2967 +++++++-------
search/all_14.js | 3488 ++++++++---------
search/all_15.js | 708 ++--
search/all_16.js | 508 +--
search/all_17.js | 480 +--
search/all_18.js | 146 +-
search/all_19.js | 16 +-
search/all_1a.js | 18 +-
search/all_1b.js | 720 ++--
search/all_3.js | 2 +-
search/all_5.js | 321 +-
search/all_6.js | 994 ++---
search/all_7.js | 1344 +++----
search/all_8.js | 392 +-
search/all_9.js | 1624 ++++----
search/all_a.js | 228 +-
search/all_b.js | 112 +-
search/all_c.js | 962 ++---
search/all_d.js | 1974 +++++-----
search/all_e.js | 662 ++--
search/all_f.js | 694 ++--
search/classes_0.js | 4 +-
search/classes_1.js | 432 +-
search/classes_10.js | 268 +-
search/classes_11.js | 24 +-
search/classes_12.js | 258 +-
search/classes_13.js | 674 ++--
search/classes_14.js | 302 +-
search/classes_15.js | 408 +-
search/classes_16.js | 252 +-
search/classes_17.js | 144 +-
search/classes_18.js | 36 +-
search/classes_19.js | 4 +-
search/classes_1a.js | 10 +-
search/classes_2.js | 228 +-
search/classes_3.js | 432 +-
search/classes_4.js | 202 +-
search/classes_5.js | 176 +-
search/classes_6.js | 156 +-
search/classes_7.js | 56 +-
search/classes_8.js | 80 +-
search/classes_9.js | 410 +-
search/classes_a.js | 46 +-
search/classes_b.js | 32 +-
search/classes_c.js | 218 +-
search/classes_d.js | 274 +-
search/classes_e.js | 172 +-
search/classes_f.js | 184 +-
search/enums_0.js | 12 +-
search/enums_1.js | 20 +-
search/enums_10.js | 31 +-
search/enums_11.js | 34 +-
search/enums_12.js | 10 +-
search/enums_13.js | 8 +-
search/enums_14.js | 6 +-
search/enums_2.js | 8 +-
search/enums_3.js | 10 +-
search/enums_4.js | 8 +-
search/enums_5.js | 4 +-
search/enums_6.js | 4 +-
search/enums_7.js | 4 +-
search/enums_8.js | 4 +-
search/enums_9.js | 14 +-
search/enums_a.js | 4 +-
search/enums_b.js | 6 +-
search/enums_c.js | 8 +-
search/enums_d.js | 18 +-
search/enums_e.js | 2 +-
search/enums_f.js | 10 +-
search/enumvalues_0.js | 48 +-
search/enumvalues_1.js | 46 +-
search/enumvalues_10.js | 4 +-
search/enumvalues_11.js | 176 +-
search/enumvalues_12.js | 178 +-
search/enumvalues_13.js | 490 +--
search/enumvalues_14.js | 28 +-
search/enumvalues_15.js | 12 +-
search/enumvalues_16.js | 18 +-
search/enumvalues_17.js | 18 +-
search/enumvalues_18.js | 2 +-
search/enumvalues_2.js | 52 +-
search/enumvalues_3.js | 56 +-
search/enumvalues_4.js | 26 +-
search/enumvalues_5.js | 36 +-
search/enumvalues_6.js | 44 +-
search/enumvalues_7.js | 24 +-
search/enumvalues_8.js | 34 +-
search/enumvalues_9.js | 96 +-
search/enumvalues_a.js | 28 +-
search/enumvalues_b.js | 170 +-
search/enumvalues_c.js | 46 +-
search/enumvalues_d.js | 66 +-
search/enumvalues_e.js | 38 +-
search/enumvalues_f.js | 42 +-
search/files_0.js | 8 +-
search/files_1.js | 4 +-
search/files_10.js | 8 +-
search/files_2.js | 68 +-
search/files_3.js | 2 +-
search/files_4.js | 4 +-
search/files_5.js | 10 +-
search/files_6.js | 14 +-
search/files_7.js | 6 +-
search/files_8.js | 8 +-
search/files_9.js | 4 +-
search/files_a.js | 4 +-
search/files_b.js | 2 +-
search/files_c.js | 8 +-
search/files_d.js | 26 +-
search/files_e.js | 10 +-
search/files_f.js | 6 +-
search/functions_0.js | 2 +-
search/functions_1.js | 808 ++--
search/functions_10.js | 744 ++--
search/functions_11.js | 50 +-
search/functions_12.js | 612 +--
search/functions_13.js | 1390 +++----
search/functions_14.js | 2376 +++++------
search/functions_15.js | 242 +-
search/functions_16.js | 176 +-
search/functions_17.js | 304 +-
search/functions_18.js | 82 +-
search/functions_19.js | 2 +-
search/functions_1a.js | 10 +-
search/functions_1b.js | 720 ++--
search/functions_2.js | 306 +-
search/functions_3.js | 944 ++---
search/functions_4.js | 756 ++--
search/functions_5.js | 330 +-
search/functions_6.js | 544 +--
search/functions_7.js | 1228 +++---
search/functions_8.js | 186 +-
search/functions_9.js | 872 ++---
search/functions_a.js | 50 +-
search/functions_b.js | 34 +-
search/functions_c.js | 368 +-
search/functions_d.js | 630 +--
search/functions_e.js | 324 +-
search/functions_f.js | 436 +--
search/groups_0.js | 2 +-
search/namespaces_0.js | 24 +-
search/namespaces_1.js | 4 +-
search/namespaces_2.js | 2 +-
search/namespaces_3.js | 82 +-
search/namespaces_4.js | 24 +-
search/pages_0.js | 2 +-
search/pages_1.js | 4 +-
search/pages_10.js | 2 +-
search/pages_2.js | 10 +-
search/pages_3.js | 6 +-
search/pages_4.js | 2 +-
search/pages_5.js | 4 +-
search/pages_6.js | 6 +-
search/pages_7.js | 2 +-
search/pages_8.js | 4 +-
search/pages_9.js | 4 +-
search/pages_a.js | 2 +-
search/pages_b.js | 4 +-
search/pages_c.js | 6 +-
search/pages_d.js | 16 +-
search/pages_e.js | 8 +-
search/pages_f.js | 2 +-
search/related_0.js | 8 +-
search/related_1.js | 16 +-
search/related_2.js | 4 +-
search/related_3.js | 6 +-
search/related_4.js | 2 +-
search/related_5.js | 6 +-
search/related_6.js | 18 +-
search/related_7.js | 18 +-
search/related_8.js | 34 +-
search/related_9.js | 6 +-
search/related_a.js | 12 +-
search/related_b.js | 12 +-
search/related_c.js | 4 +-
search/related_d.js | 6 +-
search/typedefs_0.js | 50 +-
search/typedefs_1.js | 28 +-
search/typedefs_10.js | 2 +-
search/typedefs_11.js | 54 +-
search/typedefs_12.js | 158 +-
search/typedefs_13.js | 84 +-
search/typedefs_14.js | 16 +-
search/typedefs_15.js | 14 +-
search/typedefs_16.js | 10 +-
search/typedefs_17.js | 2 +-
search/typedefs_18.js | 2 +-
search/typedefs_2.js | 62 +-
search/typedefs_3.js | 28 +-
search/typedefs_4.js | 37 +-
search/typedefs_5.js | 20 +-
search/typedefs_6.js | 2 +-
search/typedefs_7.js | 38 +-
search/typedefs_8.js | 52 +-
search/typedefs_9.js | 6 +-
search/typedefs_a.js | 14 +-
search/typedefs_b.js | 54 +-
search/typedefs_c.js | 58 +-
search/typedefs_d.js | 22 +-
search/typedefs_e.js | 20 +-
search/typedefs_f.js | 56 +-
search/variables_0.js | 374 +-
search/variables_1.js | 162 +-
search/variables_10.js | 42 +-
search/variables_11.js | 330 +-
search/variables_12.js | 968 ++---
search/variables_13.js | 418 +-
search/variables_14.js | 72 +-
search/variables_15.js | 130 +-
search/variables_16.js | 96 +-
search/variables_17.js | 20 +-
search/variables_18.js | 6 +-
search/variables_19.js | 4 +-
search/variables_2.js | 344 +-
search/variables_3.js | 236 +-
search/variables_4.js | 122 +-
search/variables_5.js | 372 +-
search/variables_6.js | 58 +-
search/variables_7.js | 106 +-
search/variables_8.js | 398 +-
search/variables_9.js | 50 +-
search/variables_a.js | 26 +-
search/variables_b.js | 296 +-
search/variables_c.js | 1132 +++---
search/variables_d.js | 202 +-
search/variables_e.js | 100 +-
search/variables_f.js | 312 +-
294 files changed, 29706 insertions(+), 29336 deletions(-)
diff --git a/AMMCreate_8cpp_source.html b/AMMCreate_8cpp_source.html
index 0a79d41dbb8..d11a874fb3e 100644
--- a/AMMCreate_8cpp_source.html
+++ b/AMMCreate_8cpp_source.html
@@ -350,92 +350,107 @@
-
-
-
-
-
-
- 288 JLOG(j_.
debug()) <<
"AMM Instance: failed to send LPT " << lpTokens;
-
+
+
+
+
+
+
+
+
-
- 292 auto sendAndTrustSet = [&](
STAmount const& amount) ->
TER {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 310 auto const flags = sleRippleState->getFlags();
-
- 312 sb.
update(sleRippleState);
-
-
-
-
-
-
- 319 res = sendAndTrustSet(amount);
-
-
- 322 JLOG(j_.
debug()) <<
"AMM Instance: failed to send " << amount;
-
-
-
-
- 327 res = sendAndTrustSet(amount2);
-
-
- 330 JLOG(j_.
debug()) <<
"AMM Instance: failed to send " << amount2;
-
-
-
- 334 JLOG(j_.
debug()) <<
"AMM Instance: success " << *ammAccount <<
" "
- 335 << ammKeylet.key <<
" " << lpTokens <<
" " << amount <<
" "
-
-
-
- 339 Book const book{issueIn, issueOut};
-
- 341 if (
auto const bookExisted =
static_cast<bool>(sb.
read(dir));
-
-
-
- 345 addOrderBook(amount.issue(), amount2.issue(),
getRate(amount2, amount));
- 346 addOrderBook(amount2.issue(), amount.issue(),
getRate(amount, amount2));
+
+
+ 293 JLOG(j_.
debug()) <<
"AMM Instance: failed to insert owner dir";
+
+
+
+
+
+
+
+
+ 302 JLOG(j_.
debug()) <<
"AMM Instance: failed to send LPT " << lpTokens;
+
+
+
+ 306 auto sendAndTrustSet = [&](
STAmount const& amount) ->
TER {
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 324 auto const flags = sleRippleState->getFlags();
+
+ 326 sb.
update(sleRippleState);
+
+
+
+
+
+
+ 333 res = sendAndTrustSet(amount);
+
+
+ 336 JLOG(j_.
debug()) <<
"AMM Instance: failed to send " << amount;
+
+
+
+
+ 341 res = sendAndTrustSet(amount2);
+
+
+ 344 JLOG(j_.
debug()) <<
"AMM Instance: failed to send " << amount2;
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+ 348 JLOG(j_.
debug()) <<
"AMM Instance: success " << *ammAccount <<
" "
+ 349 << ammKeylet.key <<
" " << lpTokens <<
" " << amount <<
" "
+
+
+
+ 353 Book const book{issueIn, issueOut};
+
+ 355 if (
auto const bookExisted =
static_cast<bool>(sb.
read(dir));
+
+
+
+ 359 addOrderBook(amount.issue(), amount2.issue(),
getRate(amount2, amount));
+ 360 addOrderBook(amount2.issue(), amount.issue(),
getRate(amount, amount2));
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-void initializeFeeAuctionVote(ApplyView &view, std::shared_ptr< SLE > &ammSle, AccountID const &account, Issue const &lptIssue, std::uint16_t tfee)
Initialize Auction and Voting slots and set the trading/discounted fee.
+Keylet ownerDir(AccountID const &id) noexcept
The root page of an account's directory.
+void initializeFeeAuctionVote(ApplyView &view, std::shared_ptr< SLE > &ammSle, AccountID const &account, Issue const &lptIssue, std::uint16_t tfee)
Initialize Auction and Voting slots and set the trading/discounted fee.
virtual OrderBookDB & getOrderBookDB()=0
NotTEC preflight2(PreflightContext const &ctx)
Checks whether the signature appears valid.
@@ -447,12 +462,14 @@
static XRPAmount calculateBaseFee(ReadView const &view, STTx const &tx)
+const SF_UINT64 sfOwnerNode
TER accountSend(ApplyView &view, AccountID const &uSenderID, AccountID const &uReceiverID, STAmount const &saAmount, beast::Journal j, WaiveTransferFee waiveFee)
static std::pair< TER, bool > applyCreate(ApplyContext &ctx_, Sandbox &sb, AccountID const &account_, beast::Journal j_)
Issue const & issue() const
const SF_AMOUNT sfAmount2
+std::function< void(SLE::ref)> describeOwnerDir(AccountID const &account)
@@ -486,6 +503,7 @@
std::uint64_t getRate(STAmount const &offerOut, STAmount const &offerIn)
static TER preclaim(PreclaimContext const &ctx)
+
Integers of any length that is a multiple of 32-bits.
@@ -500,7 +518,7 @@
Discardable, editable view to a ledger.
-TER doApply() override
Attempt to create the AMM instance.
+TER doApply() override
Attempt to create the AMM instance.
TERSubset< CanCvtToTER > TER
@@ -520,6 +538,7 @@
+
State information when determining if a tx is likely to claim a fee.
void insert(std::shared_ptr< SLE > const &sle) override
Insert a new state SLE.
@@ -542,6 +561,7 @@
Keylet quality(Keylet const &k, std::uint64_t q) noexcept
The initial directory page for a specific quality.
State information when preflighting a tx.
+std::optional< std::uint64_t > dirInsert(Keylet const &directory, uint256 const &key, std::function< void(std::shared_ptr< SLE > const &)> const &describe)
Insert an entry to a directory.
constexpr std::uint32_t tfUniversalMask
diff --git a/AMMCreate_8h_source.html b/AMMCreate_8h_source.html
index b2a684cc067..a58bd18bce2 100644
--- a/AMMCreate_8h_source.html
+++ b/AMMCreate_8h_source.html
@@ -130,7 +130,7 @@
static TER preclaim(PreclaimContext const &ctx)
-TER doApply() override
Attempt to create the AMM instance.
+TER doApply() override
Attempt to create the AMM instance.
State information when applying a tx.
State information when determining if a tx is likely to claim a fee.
diff --git a/AMMDelete_8cpp_source.html b/AMMDelete_8cpp_source.html
index c87201d1a96..fae65b6e58c 100644
--- a/AMMDelete_8cpp_source.html
+++ b/AMMDelete_8cpp_source.html
@@ -182,7 +182,7 @@
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
-TER deleteAMMAccount(Sandbox &view, Issue const &asset, Issue const &asset2, beast::Journal j)
Delete trustlines to AMM.
+TER deleteAMMAccount(Sandbox &view, Issue const &asset, Issue const &asset2, beast::Journal j)
Delete trustlines to AMM.
diff --git a/AMMDeposit_8cpp_source.html b/AMMDeposit_8cpp_source.html
index 74e4e6419c2..9b71065a803 100644
--- a/AMMDeposit_8cpp_source.html
+++ b/AMMDeposit_8cpp_source.html
@@ -904,7 +904,7 @@
std::pair< TER, STAmount > singleDepositTokens(Sandbox &view, AccountID const &ammAccount, STAmount const &amountBalance, STAmount const &amount, STAmount const &lptAMMBalance, STAmount const &lpTokensDeposit, std::uint16_t tfee)
Single asset deposit (Asset1In, LPTokens) by the tokens.
-void initializeFeeAuctionVote(ApplyView &view, std::shared_ptr< SLE > &ammSle, AccountID const &account, Issue const &lptIssue, std::uint16_t tfee)
Initialize Auction and Voting slots and set the trading/discounted fee.
+void initializeFeeAuctionVote(ApplyView &view, std::shared_ptr< SLE > &ammSle, AccountID const &account, Issue const &lptIssue, std::uint16_t tfee)
Initialize Auction and Voting slots and set the trading/discounted fee.
NotTEC preflight2(PreflightContext const &ctx)
Checks whether the signature appears valid.
diff --git a/AMMExtended__test_8cpp_source.html b/AMMExtended__test_8cpp_source.html
index 1c97ae5d329..1d90fbffb7c 100644
--- a/AMMExtended__test_8cpp_source.html
+++ b/AMMExtended__test_8cpp_source.html
@@ -3996,7 +3996,7 @@
PrettyAmount drops(Integer i)
Returns an XRP PrettyAmount, which is trivially convertible to STAmount.
bool same(STPathSet const &st1, Args const &... args)
-AccountID const & ammAccount() const
+AccountID const & ammAccount() const
Set the expected result code for a JTx The test will fail if the code doesn't match.
void testRIPD1373(FeatureBitset features)
@@ -4021,7 +4021,7 @@
Check a set of conditions.
PrettyAmount xrpMinusFee(Env const &env, std::int64_t xrpAmount)
void testCurrencyConversionInParts(FeatureBitset features)
-Json::Value pay(Account const &account, AccountID const &to, STAmount const &amount)
+Json::Value pay(Account const &account, AccountID const &to, STAmount const &amount)
void path_find_consume_all()
const uint256 featureMultiSignReserve
@@ -4043,7 +4043,7 @@
BEAST_DEFINE_TESTSUITE_PRIO(AccountDelete, app, ripple, 2)
-bool expectBalances(STAmount const &asset1, STAmount const &asset2, IOUAmount const &lpt, std::optional< AccountID > const &account=std::nullopt) const
Verify the AMM balances.
+bool expectBalances(STAmount const &asset1, STAmount const &asset2, IOUAmount const &lpt, std::optional< AccountID > const &account=std::nullopt) const
Verify the AMM balances.
void via_offers_via_gateway()
void test_convert_all_of_an_asset(FeatureBitset features)
@@ -4079,7 +4079,7 @@
bool isOffer(jtx::Env &env, jtx::Account const &account, STAmount const &takerPays, STAmount const &takerGets)
An offer exists.
-Json::Value trust(AccountID const &account, STAmount const &amount, std::uint32_t flags=0)
+Json::Value trust(AccountID const &account, STAmount const &amount, std::uint32_t flags=0)
FeatureBitset supported_amendments()
@@ -4090,7 +4090,7 @@
Json::Value fclear(Account const &account, std::uint32_t off)
Remove account flag.
void testSellWithFillOrKill(FeatureBitset features)
constexpr std::uint32_t tfFillOrKill
-bool expectTradingFee(std::uint16_t fee) const
+bool expectTradingFee(std::uint16_t fee) const
bool equal(std::unique_ptr< Step > const &s1, DirectStepInfo const &dsi)
@@ -4100,7 +4100,7 @@
constexpr std::uint32_t tfSell
-
+
void testPayment(FeatureBitset features)
constexpr std::uint32_t tfSetfAuth
diff --git a/AMMInfo_8cpp_source.html b/AMMInfo_8cpp_source.html
index 604e5a23543..fff9565f504 100644
--- a/AMMInfo_8cpp_source.html
+++ b/AMMInfo_8cpp_source.html
@@ -145,147 +145,193 @@
75 auto const& params(context.
params);
-
-
-
-
-
- 82 if (!params.isMember(jss::asset) || !params.isMember(jss::asset2))
-
-
-
-
-
- 88 if (
auto const i =
getIssue(params[jss::asset], context.
j); !i)
-
-
-
-
-
-
- 95 if (
auto const i =
getIssue(params[jss::asset2], context.
j); !i)
-
-
-
-
-
-
-
-
-
-
-
-
- 108 if (params.isMember(jss::account))
-
- 110 accountID =
getAccount(params[jss::account], result);
-
-
-
-
-
-
+
+
+
+
+
+
+ 83 struct ValuesFromContextParams
+
+
+
+
+
+
+
+ 91 auto getValuesFromContextParams =
+
+
+
+
+
+
+ 98 if ((params.isMember(jss::asset) != params.isMember(jss::asset2)) ||
+ 99 (params.isMember(jss::asset) == params.isMember(jss::amm_account)))
+
+
+ 102 if (params.isMember(jss::asset))
+
+ 104 if (
auto const i =
getIssue(params[jss::asset], context.
j))
+
+
+
+
+
+ 110 if (params.isMember(jss::asset2))
+
+ 112 if (
auto const i =
getIssue(params[jss::asset2], context.
j))
+
+
+
+
- 118 auto const ammKeylet =
keylet::amm(issue1, issue2);
- 119 auto const amm = ledger->
read(ammKeylet);
-
-
-
-
-
-
- 126 auto const [asset1Balance, asset2Balance] =
ammPoolHolds(
-
-
-
-
- 131 FreezeHandling::fhIGNORE_FREEZE,
-
- 133 auto const lptAMMBalance = accountID
-
-
-
-
- 138 asset1Balance.setJson(ammResult[jss::amount]);
- 139 asset2Balance.setJson(ammResult[jss::amount2]);
- 140 lptAMMBalance.setJson(ammResult[jss::lp_token]);
-
-
-
-
-
- 146 for (
auto const& voteEntry : amm->getFieldArray(
sfVoteSlots))
-
-
-
-
-
- 152 voteSlots.
append(std::move(vote));
+ 118 if (params.isMember(jss::amm_account))
+
+ 120 auto const id =
getAccount(params[jss::amm_account], result);
+
+
+
+
+
+ 126 ammID = sle->getFieldH256(
sfAMMID);
+
+
+
+
+
+
+ 133 if (params.isMember(jss::account))
+
+ 135 accountID =
getAccount(params[jss::account], result);
+
+
+
+
+ 140 auto const ammKeylet = [&]() {
+ 141 if (issue1 && issue2)
+
+
+
+
+ 146 auto const amm = ledger->
read(ammKeylet);
+
+
+ 149 if (!issue1 && !issue2)
+
+
+
-
- 155 if (voteSlots.
size() > 0)
- 156 ammResult[jss::vote_slots] = std::move(voteSlots);
-
-
- 159 auto const& auctionSlot =
-
- 161 if (auctionSlot.isFieldPresent(
sfAccount))
-
-
-
-
-
- 167 auction[jss::time_interval] =
-
- 169 auctionSlot[
sfPrice].setJson(auction[jss::price]);
-
- 171 auction[jss::account] =
-
-
-
-
-
-
- 178 for (
auto const& acct :
-
-
-
-
-
-
- 185 auction[jss::auth_accounts] = auth;
-
- 187 ammResult[jss::auction_slot] = std::move(auction);
-
-
-
- 191 if (!
isXRP(asset1Balance))
- 192 ammResult[jss::asset_frozen] =
-
- 194 if (!
isXRP(asset2Balance))
- 195 ammResult[jss::asset2_frozen] =
-
-
- 198 result[jss::amm] = std::move(ammResult);
- 199 if (!result.
isMember(jss::ledger_index) &&
-
- 201 result[jss::ledger_current_index] = ledger->
info().
seq;
- 202 result[jss::validated] =
-
-
-
-
-
-
+
+ 155 return ValuesFromContextParams{
+ 156 accountID, *issue1, *issue2, std::move(amm)};
+
+
+ 159 auto const r = getValuesFromContextParams();
+
+
+
+
+
+
+ 166 auto const& [accountID, issue1, issue2, amm] = *r;
+
+
+
+
+ 171 auto const [asset1Balance, asset2Balance] =
ammPoolHolds(
+
+
+
+
+ 176 FreezeHandling::fhIGNORE_FREEZE,
+
+ 178 auto const lptAMMBalance = accountID
+
+
+
+
+ 183 asset1Balance.setJson(ammResult[jss::amount]);
+ 184 asset2Balance.setJson(ammResult[jss::amount2]);
+ 185 lptAMMBalance.setJson(ammResult[jss::lp_token]);
+
+
+
+
+
+ 191 for (
auto const& voteEntry : amm->getFieldArray(
sfVoteSlots))
+
+
+
+
+
+ 197 voteSlots.
append(std::move(vote));
+
+
+ 200 if (voteSlots.
size() > 0)
+ 201 ammResult[jss::vote_slots] = std::move(voteSlots);
+
+
+ 204 auto const& auctionSlot =
+
+ 206 if (auctionSlot.isFieldPresent(
sfAccount))
+
+
+
+
+
+ 212 auction[jss::time_interval] =
+
+ 214 auctionSlot[
sfPrice].setJson(auction[jss::price]);
+
+ 216 auction[jss::account] =
+
+
+
+
+
+
+ 223 for (
auto const& acct :
+
+
+
+
+
+
+ 230 auction[jss::auth_accounts] = auth;
+
+ 232 ammResult[jss::auction_slot] = std::move(auction);
+
+
+
+ 236 if (!
isXRP(asset1Balance))
+ 237 ammResult[jss::asset_frozen] =
+
+ 239 if (!
isXRP(asset2Balance))
+ 240 ammResult[jss::asset2_frozen] =
+
+
+ 243 result[jss::amm] = std::move(ammResult);
+ 244 if (!result.
isMember(jss::ledger_index) &&
+
+ 246 result[jss::ledger_current_index] = ledger->
info().
seq;
+ 247 result[jss::validated] =
+
+
+
+
+
+
virtual LedgerInfo const & info() const =0
Returns information about the ledger.
+
const SF_UINT16 sfDiscountedFee
A currency issued by an account.
+
-Json::Value rpcError(int iError)
constexpr std::uint16_t AUCTION_SLOT_TIME_INTERVALS
@ arrayValue
array value (ordered list)
@@ -294,7 +340,6 @@
Unexpected(E(&)[N]) -> Unexpected< E const * >
LedgerMaster & ledgerMaster
-
const SF_UINT32 sfVoteWeight
@@ -309,6 +354,8 @@
T time_since_epoch(T... args)
Value & append(const Value &value)
Append value to array at the end.
+
+
Issue getIssue(T const &amt)
Keylet account(AccountID const &id) noexcept
AccountID root.
const SField sfAuthAccounts
@@ -321,6 +368,7 @@
bool isMember(const char *key) const
Return true if the object has a member named key.
A generic endpoint for log messages.
Issue issueFromJson(Json::Value const &v)
+
virtual std::shared_ptr< SLE const > read(Keylet const &k) const =0
Return the state item associated with a key.
std::optional< AccountID > getAccount(Json::Value const &v, Json::Value &result)
Json::Value doAMMInfo(RPC::JsonContext &context)
@@ -339,7 +387,6 @@
void inject_error(error_code_i code, JsonValue &json)
Add or update the json update to reflect the error code.
bool isFrozen(ReadView const &view, AccountID const &account, Currency const ¤cy, AccountID const &issuer)
Json::Value accountFromString(AccountID &result, std::string const &strIdent, bool bStrict)
-
std::optional< std::uint8_t > ammAuctionTimeSlot(std::uint64_t current, STObject const &auctionSlot)
Get time slot of the auction slot.
diff --git a/AMMInfo__test_8cpp_source.html b/AMMInfo__test_8cpp_source.html
index 180ee246765..652086e484e 100644
--- a/AMMInfo__test_8cpp_source.html
+++ b/AMMInfo__test_8cpp_source.html
@@ -113,186 +113,250 @@
43 auto const USD =
gw[
"USD"];
-
+
46 BEAST_EXPECT(jv[jss::error_message] ==
"Account not found.");
-
+
53 BEAST_EXPECT(jv[jss::error_message] ==
"Account malformed.");
-
-
-
-
-
- 60 testcase(
"RPC simple");
-
-
-
-
-
-
-
-
-
-
-
- 72 testcase(
"Vote and Bid");
-
-
-
-
-
-
-
- 80 for (
int i = 0; i < 7; ++i)
-
-
-
- 84 fund(env,
gw, {a}, {
USD(10000)}, Fund::Acct);
-
- 86 ammAlice.
vote(a, 50 * (i + 1));
-
-
-
-
-
-
-
-
-
-
-
- 98 auto const& amm = ammInfo[jss::amm];
-
-
-
- 102 auto const voteSlots = amm[jss::vote_slots];
-
-
-
- 106 votes[voteSlots[i][jss::account].asString()] ==
- 107 voteSlots[i][jss::trading_fee].asUInt() &&
- 108 voteSlots[i][jss::vote_weight].asUInt() == 12500))
-
- 110 votes.
erase(voteSlots[i][jss::account].asString());
-
- 112 if (!BEAST_EXPECT(votes.
empty()))
-
+
+
+
+
+
+
+
+
+
+ 64 {
xrpIssue(), std::nullopt, std::nullopt,
false},
+ 65 {std::nullopt,
USD.
issue(), std::nullopt,
false},
+
+
+
+ 69 {std::nullopt, std::nullopt, std::nullopt,
true}};
+ 70 for (
auto const& [iss1, iss2, acct, ignoreParams] : vals)
+
+
+ 73 std::nullopt, std::nullopt, iss1, iss2, acct, ignoreParams);
+ 74 BEAST_EXPECT(jv[jss::error_message] ==
"Invalid parameters.");
+
+
+
+
+
+
+
+
+
+
+
+
+ 87 BEAST_EXPECT(jv[jss::error_message] ==
"Account malformed.");
+
+
+
+
+
+
+ 94 testcase(
"RPC simple");
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 113 testcase(
"Vote and Bid");
-
- 116 auto const auctionSlot = amm[jss::auction_slot];
-
-
- 119 if (!BEAST_EXPECT(authAccounts.
contains(
- 120 auctionSlot[jss::auth_accounts][i][jss::account]
-
-
-
- 124 auctionSlot[jss::auth_accounts][i][jss::account]
-
-
- 127 if (!BEAST_EXPECT(authAccounts.
empty()))
-
-
- 130 auctionSlot[jss::account].asString() ==
alice.
human() &&
- 131 auctionSlot[jss::discounted_fee].asUInt() == 17 &&
- 132 auctionSlot[jss::price][jss::value].asString() ==
"5600" &&
- 133 auctionSlot[jss::price][jss::currency].asString() ==
-
- 135 auctionSlot[jss::price][jss::issuer].asString() ==
-
-
-
-
- 140 fail(e.
what(), __FILE__, __LINE__);
-
-
-
-
-
-
-
-
-
-
-
- 152 auto test = [&](
bool freeze) {
-
-
- 155 info[jss::amm][jss::asset2_frozen].asBool() ==
freeze);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+ 121 for (
int i = 0; i < 7; ++i)
+
+
+
+ 125 fund(env,
gw, {a}, {
USD(10000)}, Fund::Acct);
+
+ 127 ammAlice.
vote(a, 50 * (i + 1));
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 141 for (
auto i = 0; i < 2; ++i)
+
+
+
+ 145 auto const ammInfo = i ? ammAlice.
ammRpcInfo()
+
+
+
+
+
+
+ 152 auto const& amm = ammInfo[jss::amm];
+
+
+
+ 156 auto const voteSlots = amm[jss::vote_slots];
+ 157 auto votesCopy = votes;
+
+
+
+ 161 votes[voteSlots[i][jss::account].asString()] ==
+ 162 voteSlots[i][jss::trading_fee].asUInt() &&
+ 163 voteSlots[i][jss::vote_weight].asUInt() ==
+
+
+ 166 votes.
erase(voteSlots[i][jss::account].asString());
+
+ 168 if (!BEAST_EXPECT(votes.
empty()))
+
+
+
+
+ 173 auto const auctionSlot = amm[jss::auction_slot];
+
+
+ 176 if (!BEAST_EXPECT(authAccounts.
contains(
+ 177 auctionSlot[jss::auth_accounts][i][jss::account]
+
+
+
+ 181 auctionSlot[jss::auth_accounts][i][jss::account]
+
+
+ 184 if (!BEAST_EXPECT(authAccounts.
empty()))
+
+
+ 187 auctionSlot[jss::account].asString() ==
alice.
human() &&
+ 188 auctionSlot[jss::discounted_fee].asUInt() == 17 &&
+ 189 auctionSlot[jss::price][jss::value].asString() ==
+
+ 191 auctionSlot[jss::price][jss::currency].asString() ==
+
+ 193 auctionSlot[jss::price][jss::issuer].asString() ==
+
+
+
+
+ 198 fail(e.
what(), __FILE__, __LINE__);
+
+
+
+
+
+
+
+
+
+
+
+
+ 211 auto test = [&](
bool freeze) {
+
+
+ 214 info[jss::amm][jss::asset2_frozen].asBool() ==
freeze);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
const XRP_t XRP
Converts to XRP Issue or STAmount.
+AccountID const & ammAccount() const
-Json::Value ammRpcInfo(std::optional< AccountID > const &account=std::nullopt, std::optional< std::string > const &ledgerIndex=std::nullopt, std::optional< std::pair< Issue, Issue >> tokens=std::nullopt) const
Send amm_info RPC command.
+
-void vote(std::optional< Account > const &account, std::uint32_t feeVal, std::optional< std::uint32_t > const &flags=std::nullopt, std::optional< jtx::seq > const &seq=std::nullopt, std::optional< std::pair< Issue, Issue >> const &assets=std::nullopt, std::optional< ter > const &ter=std::nullopt)
+void vote(std::optional< Account > const &account, std::uint32_t feeVal, std::optional< std::uint32_t > const &flags=std::nullopt, std::optional< jtx::seq > const &seq=std::nullopt, std::optional< std::pair< Issue, Issue >> const &assets=std::nullopt, std::optional< ter > const &ter=std::nullopt)
std::string const & human() const
Returns the human readable public key.
-IOUAmount deposit(std::optional< Account > const &account, LPToken tokens, std::optional< STAmount > const &asset1InDetails=std::nullopt, std::optional< std::uint32_t > const &flags=std::nullopt, std::optional< ter > const &ter=std::nullopt)
+IOUAmount deposit(std::optional< Account > const &account, LPToken tokens, std::optional< STAmount > const &asset1InDetails=std::nullopt, std::optional< std::uint32_t > const &flags=std::nullopt, std::optional< ter > const &ter=std::nullopt)
+
-void bid(std::optional< Account > const &account, std::optional< std::variant< int, IOUAmount, STAmount >> const &bidMin=std::nullopt, std::optional< std::variant< int, IOUAmount, STAmount >> const &bidMax=std::nullopt, std::vector< Account > const &authAccounts={}, std::optional< std::uint32_t > const &flags=std::nullopt, std::optional< jtx::seq > const &seq=std::nullopt, std::optional< std::pair< Issue, Issue >> const &assets=std::nullopt, std::optional< ter > const &ter=std::nullopt)
+void bid(std::optional< Account > const &account, std::optional< std::variant< int, IOUAmount, STAmount >> const &bidMin=std::nullopt, std::optional< std::variant< int, IOUAmount, STAmount >> const &bidMax=std::nullopt, std::vector< Account > const &authAccounts={}, std::optional< std::uint32_t > const &flags=std::nullopt, std::optional< jtx::seq > const &seq=std::nullopt, std::optional< std::pair< Issue, Issue >> const &assets=std::nullopt, std::optional< ter > const &ter=std::nullopt)
Floating point representation of amounts with high dynamic range.
Convenience class to test AMM functionality.
AccountID id() const
Returns the Account ID.
+Json::Value ammRpcInfo(std::optional< AccountID > const &account=std::nullopt, std::optional< std::string > const &ledgerIndex=std::nullopt, std::optional< Issue > issue1=std::nullopt, std::optional< Issue > issue2=std::nullopt, std::optional< AccountID > const &ammAccount=std::nullopt, bool ignoreParams=false) const
Send amm_info RPC command.
+bool expectAmmRpcInfo(STAmount const &asset1, STAmount const &asset2, IOUAmount const &balance, std::optional< AccountID > const &account=std::nullopt, std::optional< std::string > const &ledger_index=std::nullopt, std::optional< AccountID > const &ammAccount=std::nullopt) const
-bool expectAmmRpcInfo(STAmount const &asset1, STAmount const &asset2, IOUAmount const &balance, std::optional< AccountID > const &account=std::nullopt, std::optional< std::string > const &ledger_index=std::nullopt) const
Json::Value fset(Account const &account, std::uint32_t on, std::uint32_t off=0)
Add and/or remove flag.
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
-
-
+
+
Json::Value fclear(Account const &account, std::uint32_t off)
Remove account flag.
-bool expectTradingFee(std::uint16_t fee) const
+bool expectTradingFee(std::uint16_t fee) const
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
void fund(jtx::Env &env, jtx::Account const &gw, std::vector< jtx::Account > const &accounts, std::vector< STAmount > const &amts, Fund how)
+Issue const & xrpIssue()
Returns an asset specifier that represents XRP.
constexpr std::uint32_t asfGlobalFreeze
-
+
+
std::string to_string(Manifest const &m)
Format the specified manifest to a string for debugging purposes.
Immutable cryptographic account descriptor.
-
+
void testAMM(std::function< void(jtx::AMM &, jtx::Env &)> &&cb, std::optional< std::pair< STAmount, STAmount >> const &pool=std::nullopt, std::uint16_t tfee=0, std::optional< jtx::ter > const &ter=std::nullopt, std::optional< FeatureBitset > const &features=std::nullopt)
testAMM() funds 30,000XRP and 30,000IOU for each non-XRP asset to Alice and Carol
-
+
A transaction testing environment.
diff --git a/AMMUtils_8cpp_source.html b/AMMUtils_8cpp_source.html
index 3582c757ae4..12c35f725b2 100644
--- a/AMMUtils_8cpp_source.html
+++ b/AMMUtils_8cpp_source.html
@@ -266,118 +266,129 @@
-
+
-
-
- 205 if (nodeType != LedgerEntryType::ltRIPPLE_STATE)
-
-
- 208 <<
"deleteAMMTrustLines: deleting non-trustline "
-
-
-
-
-
-
-
-
- 217 <<
"deleteAMMTrustLines: deleting trustline with "
-
-
-
-
-
-
-
- 225 maxTrustlinesToDelete);
-
-
-
-
-
-
-
-
-
-
-
-
- 238 JLOG(j.
error()) <<
"deleteAMMAccount: AMM object does not exist "
- 239 << asset <<
" " << asset2;
-
-
-
-
-
-
-
- 247 JLOG(j.
error()) <<
"deleteAMMAccount: AMM account does not exist "
-
-
-
-
-
-
-
-
+
+
+ 205 if (nodeType == LedgerEntryType::ltAMM)
+
+
+ 208 if (nodeType != LedgerEntryType::ltRIPPLE_STATE)
+
+
+ 211 <<
"deleteAMMTrustLines: deleting non-trustline "
+
+
+
+
+
+
+
+
+ 220 <<
"deleteAMMTrustLines: deleting trustline with "
+
+
+
+
+
+
+
+
+
+ 230 maxTrustlinesToDelete);
+
+
+
+
+
+
+
+
+
+
+
+
+ 243 JLOG(j.
error()) <<
"deleteAMMAccount: AMM object does not exist "
+ 244 << asset <<
" " << asset2;
+
+
+
+
+
+
+
+ 252 JLOG(j.
error()) <<
"deleteAMMAccount: AMM account does not exist "
+
+
+
-
-
-
- 260 JLOG(j.
error()) <<
"deleteAMMAccount: cannot delete root dir node of "
-
-
-
-
-
- 266 sb.
erase(sleAMMRoot);
-
-
-
-
-
-
-
-
-
- 276 Issue const& lptIssue,
-
-
-
-
-
-
-
-
- 285 voteEntry.setAccountID(
sfAccount, account);
-
-
-
-
-
-
- 292 auto const expiration = std::chrono::duration_cast<std::chrono::seconds>(
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+ 264 ownerDirKeylet, (*ammSle)[
sfOwnerNode], ammSle->key(),
false))
+
+ 266 JLOG(j.
error()) <<
"deleteAMMAccount: failed to remove dir link";
+
+
+
+
+ 271 JLOG(j.
error()) <<
"deleteAMMAccount: cannot delete root dir node of "
+
+
+
+
+
+ 277 sb.
erase(sleAMMRoot);
+
+
+
+
+
+
+
+
+
+ 287 Issue const& lptIssue,
+
+
+
+
+
+
+
+
+ 296 voteEntry.setAccountID(
sfAccount, account);
+
+
+
+
+
+
+ 303 auto const expiration = std::chrono::duration_cast<std::chrono::seconds>(
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
virtual LedgerInfo const & info() const =0
Returns information about the ledger.
const STBase & peekAtField(SField const &field) const
@@ -385,7 +396,7 @@
void setAccountID(SField const &field, AccountID const &)
bool issues(DebtDirection dir)
-void initializeFeeAuctionVote(ApplyView &view, std::shared_ptr< SLE > &ammSle, AccountID const &account, Issue const &lptIssue, std::uint16_t tfee)
Initialize Auction and Voting slots and set the trading/discounted fee.
+void initializeFeeAuctionVote(ApplyView &view, std::shared_ptr< SLE > &ammSle, AccountID const &account, Issue const &lptIssue, std::uint16_t tfee)
Initialize Auction and Voting slots and set the trading/discounted fee.
const SF_UINT16 sfDiscountedFee
void makeFieldAbsent(SField const &field)
@@ -393,6 +404,7 @@
A currency issued by an account.
+const SF_UINT64 sfOwnerNode
void setFieldU16(SField const &field, std::uint16_t)
constexpr std::uint32_t VOTE_WEIGHT_SCALE_FACTOR
Expected< std::tuple< STAmount, STAmount, STAmount >, TER > ammHolds(ReadView const &view, SLE const &ammSle, std::optional< Issue > const &optIssue1, std::optional< Issue > const &optIssue2, FreezeHandling freezeHandling, beast::Journal const j)
Get AMM pool and LP token balances.
@@ -411,7 +423,7 @@
void push_back(STObject const &object)
constexpr std::uint16_t maxDeletableAMMTrustLines
The maximum number of trustlines to delete as part of AMM account deletion cleanup.
TER deleteAMMTrustLine(ApplyView &view, std::shared_ptr< SLE > sleState, std::optional< AccountID > const &ammAccountID, beast::Journal j)
Delete trustline to AMM.
-FreezeHandling
Controls the treatment of frozen account balances.
+FreezeHandling
Controls the treatment of frozen account balances.
const SF_UINT32 sfVoteWeight
AccountID ammAccountID(std::uint16_t prefix, uint256 const &parentHash, uint256 const &ammID)
Calculate AMM account ID.
@@ -419,15 +431,16 @@
Writeable view to a ledger, for applying a transaction.
std::pair< STAmount, STAmount > ammPoolHolds(ReadView const &view, AccountID const &ammAccountID, Issue const &issue1, Issue const &issue2, FreezeHandling freezeHandling, beast::Journal const j)
Get AMM pool balances.
const SF_UINT32 sfExpiration
+bool dirRemove(Keylet const &directory, std::uint64_t page, uint256 const &key, bool keepRoot)
Remove an entry from a directory.
Integers of any length that is a multiple of 32-bits.
T time_since_epoch(T... args)
+
void setFieldArray(SField const &field, STArray const &v)
Keylet account(AccountID const &id) noexcept
AccountID root.
AccountID getAccountID(SField const &field) const
-
const SField sfAuthAccounts
std::uint16_t getTradingFee(ReadView const &view, SLE const &ammSle, AccountID const &account)
Get AMM trading fee for the given account.
@@ -442,6 +455,7 @@
NotTEC invalidAMMAssetPair(Issue const &issue1, Issue const &issue2, std::optional< std::pair< Issue, Issue >> const &pair=std::nullopt)
Keylet line(AccountID const &id0, AccountID const &id1, Currency const ¤cy) noexcept
The index of a trust line for a given currency.
virtual std::shared_ptr< SLE const > read(Keylet const &k) const =0
Return the state item associated with a key.
+TER cleanupOnAccountDelete(ApplyView &view, Keylet const &ownerDirKeylet, EntryDeleter const &deleter, beast::Journal j, std::optional< uint16_t > maxNodesToDelete)
void erase(std::shared_ptr< SLE > const &sle) override
Remove a peeked SLE.
@@ -450,11 +464,11 @@
constexpr std::uint32_t TOTAL_TIME_SLOT_SECS
LedgerEntryType
Identifiers for on-ledger objects.
bool emptyDirDelete(Keylet const &directory)
Remove the specified directory, if it is empty.
-TER cleanupOnAccountDelete(ApplyView &view, Keylet const &ownerDirKeylet, std::function< TER(LedgerEntryType, uint256 const &, std::shared_ptr< SLE > &)> deleter, beast::Journal j, std::optional< uint16_t > maxNodesToDelete)
static TER deleteAMMTrustLines(Sandbox &sb, AccountID const &ammAccountID, std::uint16_t maxTrustlinesToDelete, beast::Journal j)
bool isFieldPresent(SField const &field) const
-TER deleteAMMAccount(Sandbox &view, Issue const &asset, Issue const &asset2, beast::Journal j)
Delete trustlines to AMM.
+TER deleteAMMAccount(Sandbox &view, Issue const &asset, Issue const &asset2, beast::Journal j)
Delete trustlines to AMM.
STAmount ammLPHolds(ReadView const &view, Currency const &cur1, Currency const &cur2, AccountID const &ammAccount, AccountID const &lpAccount, beast::Journal const j)
Get the balance of LP tokens.
+
const SF_AMOUNT sfBalance
diff --git a/AMMUtils_8h_source.html b/AMMUtils_8h_source.html
index dc6d81e607e..a9646cc8763 100644
--- a/AMMUtils_8h_source.html
+++ b/AMMUtils_8h_source.html
@@ -169,12 +169,12 @@
118 #endif // RIPPLE_APP_MISC_AMMUTILS_H_INLCUDED
-void initializeFeeAuctionVote(ApplyView &view, std::shared_ptr< SLE > &ammSle, AccountID const &account, Issue const &lptIssue, std::uint16_t tfee)
Initialize Auction and Voting slots and set the trading/discounted fee.
+void initializeFeeAuctionVote(ApplyView &view, std::shared_ptr< SLE > &ammSle, AccountID const &account, Issue const &lptIssue, std::uint16_t tfee)
Initialize Auction and Voting slots and set the trading/discounted fee.
Expected< std::tuple< STAmount, STAmount, STAmount >, TER > ammHolds(ReadView const &view, SLE const &ammSle, std::optional< Issue > const &optIssue1, std::optional< Issue > const &optIssue2, FreezeHandling freezeHandling, beast::Journal const j)
Get AMM pool and LP token balances.
-FreezeHandling
Controls the treatment of frozen account balances.
+FreezeHandling
Controls the treatment of frozen account balances.
AccountID ammAccountID(std::uint16_t prefix, uint256 const &parentHash, uint256 const &ammID)
Calculate AMM account ID.
std::pair< STAmount, STAmount > ammPoolHolds(ReadView const &view, AccountID const &ammAccountID, Issue const &issue1, Issue const &issue2, FreezeHandling freezeHandling, beast::Journal const j)
Get AMM pool balances.
std::uint16_t getTradingFee(ReadView const &view, SLE const &ammSle, AccountID const &account)
Get AMM trading fee for the given account.
@@ -183,7 +183,7 @@
base_uint< 160, detail::CurrencyTag > Currency
Currency is a hash representing a specific currency.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
-TER deleteAMMAccount(Sandbox &view, Issue const &asset, Issue const &asset2, beast::Journal j)
Delete trustlines to AMM.
+TER deleteAMMAccount(Sandbox &view, Issue const &asset, Issue const &asset2, beast::Journal j)
Delete trustlines to AMM.
STAmount ammLPHolds(ReadView const &view, Currency const &cur1, Currency const &cur2, AccountID const &ammAccount, AccountID const &lpAccount, beast::Journal const j)
Get the balance of LP tokens.
STAmount ammAccountHolds(ReadView const &view, AccountID const &ammAccountID, Issue const &issue)
Returns total amount held by AMM for the given token.
diff --git a/AMMWithdraw_8cpp_source.html b/AMMWithdraw_8cpp_source.html
index df8f287d510..0c1252f9ff6 100644
--- a/AMMWithdraw_8cpp_source.html
+++ b/AMMWithdraw_8cpp_source.html
@@ -905,7 +905,7 @@
constexpr std::uint32_t tfTwoAsset
-TER deleteAMMAccount(Sandbox &view, Issue const &asset, Issue const &asset2, beast::Journal j)
Delete trustlines to AMM.
+TER deleteAMMAccount(Sandbox &view, Issue const &asset, Issue const &asset2, beast::Journal j)
Delete trustlines to AMM.
STAmount ammLPHolds(ReadView const &view, Currency const &cur1, Currency const &cur2, AccountID const &ammAccount, AccountID const &lpAccount, beast::Journal const j)
Get the balance of LP tokens.
std::pair< TER, STAmount > withdraw(Sandbox &view, AccountID const &ammAccount, STAmount const &amountWithdraw, STAmount const &amountBalance, std::optional< STAmount > const &amount2Withdraw, STAmount const &lpTokensAMMBalance, STAmount const &lpTokensWithdraw, std::uint16_t tfee)
Withdraw requested assets and token from AMM into LP account.
diff --git a/AMM_8cpp_source.html b/AMM_8cpp_source.html
index 942b5ca1f44..4be34b3078d 100644
--- a/AMM_8cpp_source.html
+++ b/AMM_8cpp_source.html
@@ -204,632 +204,644 @@
-
+
-
-
-
-
-
-
- 145 jv[jss::ledger_index] = *ledgerIndex;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 161 if (jr.isObject() && jr.isMember(jss::result) &&
- 162 jr[jss::result].isMember(jss::status))
- 163 return jr[jss::result];
-
-
-
-
-
-
-
-
-
-
-
-
-
- 177 auto const [asset1Balance, asset2Balance] =
ammPoolHolds(
-
-
-
-
- 182 FreezeHandling::fhIGNORE_FREEZE,
-
- 184 auto const lptAMMBalance = account
-
-
- 187 return {asset1Balance, asset2Balance, lptAMMBalance};
-
-
-
-
-
-
-
-
-
-
-
- 199 auto const [asset1Balance, asset2Balance, lptAMMBalance] =
-
- 201 return asset1 == asset1Balance && asset2 == asset2Balance &&
-
-
-
-
-
-
+
+
+
+ 142 bool ignoreParams)
const
+
+
+
+
+
+ 148 jv[jss::ledger_index] = *ledgerIndex;
+
+
+ 151 if (issue1 || issue2)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 171 if (jr.isObject() && jr.isMember(jss::result) &&
+ 172 jr[jss::result].isMember(jss::status))
+ 173 return jr[jss::result];
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 187 auto const [asset1Balance, asset2Balance] =
ammPoolHolds(
+
+
+
+
+ 192 FreezeHandling::fhIGNORE_FREEZE,
+
+ 194 auto const lptAMMBalance = account
+
+
+ 197 return {asset1Balance, asset2Balance, lptAMMBalance};
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
- 214 FreezeHandling::fhZERO_IF_FROZEN,
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 229 auto const lptAMMBalance =
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 246 return slotFee ==
fee &&
-
-
- 249 ((!timeSlot && slotInterval == 0) || slotInterval == timeSlot) &&
- 250 slotPrice == expectedPrice;
-
-
-
-
-
-
-
-
-
-
- 261 for (
auto const& account : accounts)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 297 auto const jv =
ammRpcInfo(account, ledger_index);
-
-
-
-
-
-
-
-
-
+ 209 auto const [asset1Balance, asset2Balance, lptAMMBalance] =
+
+ 211 return asset1 == asset1Balance && asset2 == asset2Balance &&
+
+
+
+
+
+
+
+
+
+
+
+
+ 224 FreezeHandling::fhZERO_IF_FROZEN,
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 239 auto const lptAMMBalance =
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 256 return slotFee ==
fee &&
+
+
+ 259 ((!timeSlot && slotInterval == 0) || slotInterval == timeSlot) &&
+ 260 slotPrice == expectedPrice;
+
+
+
+
+
+
+
+
+
+
+ 271 for (
auto const& account : accounts)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
- 310 auto const& jv = jvres[jss::amm];
- 311 if (!jv.isMember(jss::amount) || !jv.isMember(jss::amount2) ||
- 312 !jv.isMember(jss::lp_token))
-
-
-
-
-
-
-
-
-
-
-
-
-
- 326 return asset1 == asset1Info && asset2 == asset2Info &&
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 361 jv[jss::Account] = acct.human();
-
- 363 jv[jss::TransactionType] = jss::AMMDeposit;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 400 assert(!(asset2In && maxEP));
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 431 asset1In->setJson(jv[jss::Amount]);
-
- 433 asset2In->setJson(jv[jss::Amount2]);
-
- 435 maxEP->setJson(jv[jss::EPrice]);
-
- 437 jv[jss::TradingFee] = *tfee;
-
-
-
-
-
-
-
-
-
-
- 448 else if (
tokens && asset1In)
-
- 450 else if (asset1In && asset2In)
-
- 452 else if (maxEP && asset1In)
-
-
-
-
- 457 jv[jss::Flags] = jvflags;
-
-
-
-
-
-
-
-
-
-
-
-
-
- 471 jv[jss::Account] = acct.human();
-
- 473 jv[jss::TransactionType] = jss::AMMWithdraw;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 508 assert(!(asset2Out && maxEP));
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 537 asset1Out->setJson(jv[jss::Amount]);
-
- 539 asset2Out->setJson(jv[jss::Amount2]);
-
-
-
- 543 saMaxEP.setJson(jv[jss::EPrice]);
-
-
-
-
-
-
-
-
- 552 else if (asset1Out && asset2Out)
-
- 554 else if (
tokens && asset1Out)
-
- 556 else if (asset1Out && maxEP)
-
-
-
-
- 561 jv[jss::Flags] = jvflags;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 577 jv[jss::TradingFee] = feeVal;
- 578 jv[jss::TransactionType] = jss::AMMVote;
-
- 580 jv[jss::Flags] = *
flags;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 602 auto const& auctionSlot =
-
-
-
-
-
-
-
-
-
-
- 613 auto getBid = [&](
auto const&
bid) {
- 614 if (std::holds_alternative<int>(
bid))
-
- 616 else if (std::holds_alternative<IOUAmount>(
bid))
-
-
- 619 return std::get<STAmount>(
bid);
-
-
-
- 623 STAmount saTokens = getBid(*bidMin);
- 624 saTokens.
setJson(jv[jss::BidMin]);
-
-
-
-
- 629 STAmount saTokens = getBid(*bidMax);
- 630 saTokens.
setJson(jv[jss::BidMax]);
-
-
- 633 if (authAccounts.
size() > 0)
+
+ 309 account, ledger_index, std::nullopt, std::nullopt,
ammAccount);
+
+
+
+
+
+
+
+
+
+
+
+
+ 322 auto const& jv = jvres[jss::amm];
+ 323 if (!jv.isMember(jss::amount) || !jv.isMember(jss::amount2) ||
+ 324 !jv.isMember(jss::lp_token))
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 338 return asset1 == asset1Info && asset2 == asset2Info &&
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 373 jv[jss::Account] = acct.human();
+
+ 375 jv[jss::TransactionType] = jss::AMMDeposit;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 412 assert(!(asset2In && maxEP));
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 443 asset1In->setJson(jv[jss::Amount]);
+
+ 445 asset2In->setJson(jv[jss::Amount2]);
+
+ 447 maxEP->setJson(jv[jss::EPrice]);
+
+ 449 jv[jss::TradingFee] = *tfee;
+
+
+
+
+
+
+
+
+
+
+ 460 else if (
tokens && asset1In)
+
+ 462 else if (asset1In && asset2In)
+
+ 464 else if (maxEP && asset1In)
+
+
+
+
+ 469 jv[jss::Flags] = jvflags;
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 483 jv[jss::Account] = acct.human();
+
+ 485 jv[jss::TransactionType] = jss::AMMWithdraw;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 520 assert(!(asset2Out && maxEP));
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 549 asset1Out->setJson(jv[jss::Amount]);
+
+ 551 asset2Out->setJson(jv[jss::Amount2]);
+
+
+
+ 555 saMaxEP.setJson(jv[jss::EPrice]);
+
+
+
+
+
+
+
+
+ 564 else if (asset1Out && asset2Out)
+
+ 566 else if (
tokens && asset1Out)
+
+ 568 else if (asset1Out && maxEP)
+
+
+
+
+ 573 jv[jss::Flags] = jvflags;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 589 jv[jss::TradingFee] = feeVal;
+ 590 jv[jss::TransactionType] = jss::AMMVote;
+
+ 592 jv[jss::Flags] = *
flags;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 614 auto const& auctionSlot =
+
+
+
+
+
+
+
+
+
+
+ 625 auto getBid = [&](
auto const&
bid) {
+ 626 if (std::holds_alternative<int>(
bid))
+
+ 628 else if (std::holds_alternative<IOUAmount>(
bid))
+
+
+ 631 return std::get<STAmount>(
bid);
+
+
-
- 636 for (
auto const& account : authAccounts)
-
-
-
- 640 acct[jss::Account] = account.human();
- 641 authAcct[jss::AuthAccount] = acct;
- 642 accounts.
append(authAcct);
-
- 644 jv[jss::AuthAccounts] = accounts;
-
-
- 647 jv[jss::Flags] = *
flags;
- 648 jv[jss::TransactionType] = jss::AMMBid;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 692 auto const& auctionSlot =
-
- 694 if (auctionSlot.isFieldPresent(
sfAccount))
-
-
-
-
-
- 700 auto const slotPrice = auctionSlot[
sfPrice].iou();
- 701 auto const authAccounts = auctionSlot.getFieldArray(
sfAuthAccounts);
- 702 return cb(slotFee, slotInterval, slotPrice, authAccounts);
-
-
-
-
-
-
-
-
-
-
-
- 714 jv[jss::TransactionType] = jss::AMMDelete;
-
-
-
+ 635 STAmount saTokens = getBid(*bidMin);
+ 636 saTokens.
setJson(jv[jss::BidMin]);
+
+
+
+
+ 641 STAmount saTokens = getBid(*bidMax);
+ 642 saTokens.
setJson(jv[jss::BidMax]);
+
+
+ 645 if (authAccounts.
size() > 0)
+
+
+ 648 for (
auto const& account : authAccounts)
+
+
+
+ 652 acct[jss::Account] = account.human();
+ 653 authAcct[jss::AuthAccount] = acct;
+ 654 accounts.
append(authAcct);
+
+ 656 jv[jss::AuthAccounts] = accounts;
+
+
+ 659 jv[jss::Flags] = *
flags;
+ 660 jv[jss::TransactionType] = jss::AMMBid;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 704 auto const& auctionSlot =
+
+ 706 if (auctionSlot.isFieldPresent(
sfAccount))
+
+
+
+
+
+ 712 auto const slotPrice = auctionSlot[
sfPrice].iou();
+ 713 auto const authAccounts = auctionSlot.getFieldArray(
sfAuthAccounts);
+ 714 return cb(slotFee, slotInterval, slotPrice, authAccounts);
+
+
+
-
-
-
-
-
- 725 Throw<std::runtime_error>(
"trust() requires IOU");
-
-
-
- 729 jv[jss::TransactionType] = jss::TrustSet;
- 730 jv[jss::Flags] =
flags;
-
-
+
+
+
+
+
+
+ 726 jv[jss::TransactionType] = jss::AMMDelete;
+
+
+
+
+
+
-
+
-
- 737 jv[jss::Account] = account.human();
-
-
- 740 jv[jss::TransactionType] = jss::Payment;
-
-
-
-
-
-
-
+
+ 737 Throw<std::runtime_error>(
"trust() requires IOU");
+
+
+
+ 741 jv[jss::TransactionType] = jss::TrustSet;
+ 742 jv[jss::Flags] =
flags;
+
+
+
+
+
+
+ 749 jv[jss::Account] = account.human();
+
+
+ 752 jv[jss::TransactionType] = jss::Payment;
+
+
+
+
+
+
+
bool amountFromJsonNoThrow(STAmount &result, Json::Value const &jvSource)
const SF_UINT16 sfDiscountedFee
A currency issued by an account.
-void ammDelete(AccountID const &deleter, std::optional< ter > const &ter=std::nullopt)
+void ammDelete(AccountID const &deleter, std::optional< ter > const &ter=std::nullopt)
const std::optional< msig > msig_
+AccountID const & ammAccount() const
Issue const & issue() const
Set the expected result code for a JTx The test will fail if the code doesn't match.
Issue ammLPTIssue(Currency const &cur1, Currency const &cur2, AccountID const &ammAccountID)
Calculate LPT Issue from AMM asset pair.
@ arrayValue
array value (ordered list)
-Json::Value ammRpcInfo(std::optional< AccountID > const &account=std::nullopt, std::optional< std::string > const &ledgerIndex=std::nullopt, std::optional< std::pair< Issue, Issue >> tokens=std::nullopt) const
Send amm_info RPC command.
const SF_AMOUNT sfLPTokenBalance
@@ -838,19 +850,19 @@
STAmount accountHolds(ReadView const &view, AccountID const &account, Currency const ¤cy, AccountID const &issuer, FreezeHandling zeroIfFrozen, beast::Journal j)
Keylet amm(Issue const &issue1, Issue const &issue2) noexcept
AMM entry.
Json::Value getJson(JsonOptions) const override
-void vote(std::optional< Account > const &account, std::uint32_t feeVal, std::optional< std::uint32_t > const &flags=std::nullopt, std::optional< jtx::seq > const &seq=std::nullopt, std::optional< std::pair< Issue, Issue >> const &assets=std::nullopt, std::optional< ter > const &ter=std::nullopt)
-Json::Value pay(Account const &account, AccountID const &to, STAmount const &amount)
+void vote(std::optional< Account > const &account, std::uint32_t feeVal, std::optional< std::uint32_t > const &flags=std::nullopt, std::optional< jtx::seq > const &seq=std::nullopt, std::optional< std::pair< Issue, Issue >> const &assets=std::nullopt, std::optional< ter > const &ter=std::nullopt)
+Json::Value pay(Account const &account, AccountID const &to, STAmount const &amount)
std::string const & human() const
Returns the human readable public key.
const beast::Journal journal
-IOUAmount deposit(std::optional< Account > const &account, LPToken tokens, std::optional< STAmount > const &asset1InDetails=std::nullopt, std::optional< std::uint32_t > const &flags=std::nullopt, std::optional< ter > const &ter=std::nullopt)
+IOUAmount deposit(std::optional< Account > const &account, LPToken tokens, std::optional< STAmount > const &asset1InDetails=std::nullopt, std::optional< std::uint32_t > const &flags=std::nullopt, std::optional< ter > const &ter=std::nullopt)
-void bid(std::optional< Account > const &account, std::optional< std::variant< int, IOUAmount, STAmount >> const &bidMin=std::nullopt, std::optional< std::variant< int, IOUAmount, STAmount >> const &bidMax=std::nullopt, std::vector< Account > const &authAccounts={}, std::optional< std::uint32_t > const &flags=std::nullopt, std::optional< jtx::seq > const &seq=std::nullopt, std::optional< std::pair< Issue, Issue >> const &assets=std::nullopt, std::optional< ter > const &ter=std::nullopt)
+void bid(std::optional< Account > const &account, std::optional< std::variant< int, IOUAmount, STAmount >> const &bidMin=std::nullopt, std::optional< std::variant< int, IOUAmount, STAmount >> const &bidMax=std::nullopt, std::vector< Account > const &authAccounts={}, std::optional< std::uint32_t > const &flags=std::nullopt, std::optional< jtx::seq > const &seq=std::nullopt, std::optional< std::pair< Issue, Issue >> const &assets=std::nullopt, std::optional< ter > const &ter=std::nullopt)
Floating point representation of amounts with high dynamic range.
Convenience class to test AMM functionality.
std::string toStyledString() const
virtual TimeKeeper & timeKeeper()=0
-bool expectAmmInfo(STAmount const &asset1, STAmount const &asset2, IOUAmount const &balance, Json::Value const &jv) const
+bool expectAmmInfo(STAmount const &asset1, STAmount const &asset2, IOUAmount const &balance, Json::Value const &jv) const
const Account creatorAccount_
@@ -858,18 +870,19 @@
AccountID ammAccountID(std::uint16_t prefix, uint256 const &parentHash, uint256 const &ammID)
Calculate AMM account ID.
const SF_UINT16 sfTradingFee
-bool expectBalances(STAmount const &asset1, STAmount const &asset2, IOUAmount const &lpt, std::optional< AccountID > const &account=std::nullopt) const
Verify the AMM balances.
+bool expectBalances(STAmount const &asset1, STAmount const &asset2, IOUAmount const &lpt, std::optional< AccountID > const &account=std::nullopt) const
Verify the AMM balances.
std::pair< STAmount, STAmount > ammPoolHolds(ReadView const &view, AccountID const &ammAccountID, Issue const &issue1, Issue const &issue2, FreezeHandling freezeHandling, beast::Journal const j)
Get AMM pool balances.
+Json::Value ammRpcInfo(std::optional< AccountID > const &account=std::nullopt, std::optional< std::string > const &ledgerIndex=std::nullopt, std::optional< Issue > issue1=std::nullopt, std::optional< Issue > issue2=std::nullopt, std::optional< AccountID > const &ammAccount=std::nullopt, bool ignoreParams=false) const
Send amm_info RPC command.
Json::Value getJson(JsonOptions) const override
Integers of any length that is a multiple of 32-bits.
+bool expectAmmRpcInfo(STAmount const &asset1, STAmount const &asset2, IOUAmount const &balance, std::optional< AccountID > const &account=std::nullopt, std::optional< std::string > const &ledger_index=std::nullopt, std::optional< AccountID > const &ammAccount=std::nullopt) const
Value & append(const Value &value)
Append value to array at the end.
void setJson(Json::Value &) const
static IOUAmount initialTokens(STAmount const &asset1, STAmount const &asset2)
-bool expectLPTokens(AccountID const &account, IOUAmount const &tokens) const
+bool expectLPTokens(AccountID const &account, IOUAmount const &tokens) const
Keylet account(AccountID const &id) noexcept
AccountID root.
-bool expectAmmRpcInfo(STAmount const &asset1, STAmount const &asset2, IOUAmount const &balance, std::optional< AccountID > const &account=std::nullopt, std::optional< std::string > const &ledger_index=std::nullopt) const
IOUAmount lastPurchasePrice_
STAmount toSTAmount(IOUAmount const &iou, Issue const &iss)
@@ -883,29 +896,29 @@
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
std::optional< IOUAmount > bidMax_
-Json::Value trust(AccountID const &account, STAmount const &amount, std::uint32_t flags=0)
+Json::Value trust(AccountID const &account, STAmount const &amount, std::uint32_t flags=0)
AMM(Env &env, Account const &account, STAmount const &asset1, STAmount const &asset2, bool log=false, std::uint16_t tfee=0, std::uint32_t fee=0, std::optional< std::uint32_t > flags=std::nullopt, std::optional< jtx::seq > seq=std::nullopt, std::optional< jtx::msig > ms=std::nullopt, std::optional< ter > const &ter=std::nullopt)
bool isXRP(AccountID const &c)
bool isMember(const char *key) const
Return true if the object has a member named key.
constexpr std::uint32_t tfSingleAsset
-bool expectTradingFee(std::uint16_t fee) const
+bool expectTradingFee(std::uint16_t fee) const
-IOUAmount withdraw(std::optional< Account > const &account, std::optional< LPToken > const &tokens, std::optional< STAmount > const &asset1OutDetails=std::nullopt, std::optional< std::uint32_t > const &flags=std::nullopt, std::optional< ter > const &ter=std::nullopt)
+IOUAmount withdraw(std::optional< Account > const &account, std::optional< LPToken > const &tokens, std::optional< STAmount > const &asset1OutDetails=std::nullopt, std::optional< std::uint32_t > const &flags=std::nullopt, std::optional< ter > const &ter=std::nullopt)
Set the sequence number on a JTx.
-
+
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
-void setTokens(Json::Value &jv, std::optional< std::pair< Issue, Issue >> const &assets=std::nullopt)
+void setTokens(Json::Value &jv, std::optional< std::pair< Issue, Issue >> const &assets=std::nullopt)
constexpr std::uint32_t tfLPToken
const AccountID ammAccount_
constexpr std::uint32_t tfDepositSubTx
-
+
constexpr std::uint32_t tfTwoAsset
@@ -913,14 +926,14 @@
virtual time_point now() const override=0
Returns the estimate of wall time, in network time.
STAmount ammLPHolds(ReadView const &view, Currency const &cur1, Currency const &cur2, AccountID const &ammAccount, AccountID const &lpAccount, beast::Journal const j)
Get the balance of LP tokens.
-bool expectAuctionSlot(std::uint32_t fee, std::optional< std::uint8_t > timeSlot, IOUAmount expectedPrice) const
+bool expectAuctionSlot(std::uint32_t fee, std::optional< std::uint8_t > timeSlot, IOUAmount expectedPrice) const
std::string to_string(Manifest const &m)
Format the specified manifest to a string for debugging purposes.
AccountID create(std::uint32_t tfee=0, std::optional< std::uint32_t > const &flags=std::nullopt, std::optional< jtx::seq > const &seq=std::nullopt, std::optional< ter > const &ter=std::nullopt)
Immutable cryptographic account descriptor.
const SF_ACCOUNT sfAccount
-void submit(Json::Value const &jv, std::optional< jtx::seq > const &seq, std::optional< ter > const &ter)
+void submit(Json::Value const &jv, std::optional< jtx::seq > const &seq, std::optional< ter > const &ter)
@@ -935,10 +948,10 @@
Json::Value rpc(std::unordered_map< std::string, std::string > const &headers, std::string const &cmd, Args &&... args)
Execute an RPC command.
std::optional< std::uint8_t > ammAuctionTimeSlot(std::uint64_t current, STObject const &auctionSlot)
Get time slot of the auction slot.
-std::tuple< STAmount, STAmount, STAmount > balances(Issue const &issue1, Issue const &issue2, std::optional< AccountID > const &account=std::nullopt) const
Get AMM balances for the token pair.
+std::tuple< STAmount, STAmount, STAmount > balances(Issue const &issue1, Issue const &issue2, std::optional< AccountID > const &account=std::nullopt) const
Get AMM balances for the token pair.
constexpr std::uint32_t tfLimitLPToken
-IOUAmount getLPTokensBalance(std::optional< AccountID > const &account=std::nullopt) const
+IOUAmount getLPTokensBalance(std::optional< AccountID > const &account=std::nullopt) const