Implement amm_info handler (#1060)

Fixes #283
This commit is contained in:
Alex Kremer
2024-01-11 15:57:53 +00:00
committed by GitHub
parent 93d5c12b14
commit f4df5c2185
16 changed files with 1878 additions and 40 deletions

View File

@@ -36,6 +36,18 @@
[[nodiscard]] ripple::AccountID
GetAccountIDWithString(std::string_view id);
/**
* Create AccountID object with string and return its key
*/
[[nodiscard]] ripple::uint256
GetAccountKey(std::string_view id);
/*
* Gets the account key from an account id
*/
[[nodiscard]] ripple::uint256
GetAccountKey(ripple::AccountID const& acc);
/*
* Create a simple ledgerInfo object with only hash and seq
*/
@@ -284,8 +296,28 @@ CreateAMMObject(
std::string_view assetCurrency,
std::string_view assetIssuer,
std::string_view asset2Currency,
std::string_view asset2Issuer
std::string_view asset2Issuer,
std::string_view lpTokenBalanceIssueCurrency = "03930D02208264E2E40EC1B0C09E4DB96EE197B1",
uint32_t lpTokenBalanceIssueAmount = 100u,
uint16_t tradingFee = 5u,
uint64_t ownerNode = 0u
);
void
AMMAddVoteSlot(ripple::STObject& amm, ripple::AccountID const& accountId, uint16_t tradingFee, uint32_t voteWeight);
void
AMMSetAuctionSlot(
ripple::STObject& amm,
ripple::AccountID const& accountId,
ripple::STAmount price,
uint16_t discountedFee,
uint32_t expiration,
std::vector<ripple::AccountID> const& authAccounts = {}
);
[[nodiscard]] ripple::STObject
CreateDidObject(std::string_view accountId, std::string_view didDoc, std::string_view uri, std::string_view data);
[[nodiscard]] ripple::Currency
CreateLPTCurrency(std::string_view assetCurrency, std::string_view asset2Currency);