Add handlers comments (#627)

Fixes #628
This commit is contained in:
cyan317
2023-05-09 14:02:01 +01:00
committed by GitHub
parent 6bc2ec745f
commit 02c0a1f11d
27 changed files with 166 additions and 0 deletions

View File

@@ -27,6 +27,14 @@
#include <vector>
namespace RPC {
/**
* @brief The account_channels method returns information about an account's Payment Channels. This includes only
* channels where the specified account is the channel's source, not the destination.
* All information retrieved is relative to a particular version of the ledger.
*
* For more details see: https://xrpl.org/account_channels.html
*/
class AccountChannelsHandler
{
// dependencies

View File

@@ -27,6 +27,13 @@
#include <set>
namespace RPC {
/**
* @brief The account_currencies command retrieves a list of currencies that an account can send or receive,
* based on its trust lines.
*
* For more details see: https://xrpl.org/account_currencies.html
*/
class AccountCurrenciesHandler
{
// dependencies

View File

@@ -25,6 +25,12 @@
#include <rpc/common/Validators.h>
namespace RPC {
/**
* @brief The account_info command retrieves information about an account, its activity, and its XRP balance.
*
* For more details see: https://xrpl.org/account_info.html
*/
class AccountInfoHandler
{
std::shared_ptr<BackendInterface> sharedPtrBackend_;

View File

@@ -28,6 +28,12 @@
namespace RPC {
/**
* @brief The account_lines method returns information about an account's trust lines, which contain balances in all
* non-XRP currencies and assets.
*
* For more details see: https://xrpl.org/account_lines.html
*/
class AccountLinesHandler
{
// dependencies

View File

@@ -25,6 +25,12 @@
#include <rpc/common/Validators.h>
namespace RPC {
/**
* @brief The account_nfts method returns a list of NFToken objects for the specified account.
*
* For more details see: https://xrpl.org/account_nfts.html
*/
class AccountNFTsHandler
{
std::shared_ptr<BackendInterface> sharedPtrBackend_;

View File

@@ -27,6 +27,15 @@
#include <set>
namespace RPC {
/**
* @brief The account_objects command returns the raw ledger format for all objects owned by an account.
* The results can be filtered by the type.
* The valid types are: check, deposit_preauth, escrow, nft_offer, offer, payment_channel, signer_list, state (trust
* line), and ticket.
*
* For more details see: https://xrpl.org/account_objects.html
*/
class AccountObjectsHandler
{
// dependencies

View File

@@ -25,6 +25,12 @@
#include <rpc/common/Validators.h>
namespace RPC {
/**
* @brief The account_offers method retrieves a list of offers made by a given account.
*
* For more details see: https://xrpl.org/account_offers.html
*/
class AccountOffersHandler
{
std::shared_ptr<BackendInterface> sharedPtrBackend_;

View File

@@ -26,6 +26,12 @@
#include <rpc/common/Validators.h>
namespace RPC {
/**
* @brief The account_tx method retrieves a list of transactions that involved the specified account.
*
* For more details see: https://xrpl.org/account_tx.html
*/
class AccountTxHandler
{
clio::Logger log_{"RPC"};

View File

@@ -27,6 +27,11 @@
namespace RPC {
/**
* @brief BookChangesHandler returns the order book changes for a given ledger.
*
* This API is not documented in the rippled API documentation.
*/
class BookChangesHandler
{
std::shared_ptr<BackendInterface> sharedPtrBackend_;

View File

@@ -24,6 +24,12 @@
#include <rpc/common/Validators.h>
namespace RPC {
/**
* @brief The book_offers method retrieves a list of Offers between two currencies, also known as an order book.
*
* For more details see: https://xrpl.org/book_offers.html
*/
class BookOffersHandler
{
std::shared_ptr<BackendInterface> sharedPtrBackend_;

View File

@@ -25,6 +25,13 @@
#include <rpc/common/Validators.h>
namespace RPC {
/**
* The gateway_balances command calculates the total balances issued by a given account, optionally excluding amounts
* held by operational addresses.
*
* For more details see: https://xrpl.org/gateway_balances.html#gateway_balances
*/
class GatewayBalancesHandler
{
std::shared_ptr<BackendInterface> sharedPtrBackend_;

View File

@@ -25,6 +25,12 @@
#include <rpc/common/Validators.h>
namespace RPC {
/**
* @brief Retrieve information about the public ledger.
*
* For more details see: https://xrpl.org/ledger.html
*/
class LedgerHandler
{
std::shared_ptr<BackendInterface> sharedPtrBackend_;

View File

@@ -25,6 +25,13 @@
#include <rpc/common/Validators.h>
namespace RPC {
/**
* @brief The ledger_data method retrieves contents of the specified ledger. You can iterate through several calls to
* retrieve the entire contents of a single ledger version.
*
* For more details see: https://xrpl.org/ledger_data.html
*/
class LedgerDataHandler
{
// dependencies

View File

@@ -26,6 +26,12 @@
namespace RPC {
/**
* @brief The ledger_entry method returns a single ledger object from the XRP Ledger in its raw format.
* The clio has not supported: nft_page
*
* For more details see: https://xrpl.org/ledger_entry.html
*/
class LedgerEntryHandler
{
std::shared_ptr<BackendInterface> sharedPtrBackend_;

View File

@@ -28,6 +28,11 @@
namespace RPC {
/**
* @brief The ledger_range command returns the index number of the earliest and latest ledgers that the server has.
*
* Not documented in the official rippled API docs.
*/
class LedgerRangeHandler
{
std::shared_ptr<BackendInterface> sharedPtrBackend_;

View File

@@ -23,6 +23,12 @@
#include <rpc/handlers/NFTOffersCommon.h>
namespace RPC {
/**
* @brief The nft_buy_offers method returns a list of buy offers for a given NFToken object.
*
* For more details see: https://xrpl.org/nft_buy_offers.html
*/
class NFTBuyOffersHandler : public NFTOffersHandlerBase
{
public:

View File

@@ -26,6 +26,12 @@
#include <rpc/common/Validators.h>
namespace RPC {
/**
* @brief The nft_history command asks the Clio server for past transaction metadata for the NFT being queried.
*
* For more details see: https://xrpl.org/nft_history.html#nft_history
*/
class NFTHistoryHandler
{
clio::Logger log_{"RPC"};

View File

@@ -25,6 +25,12 @@
#include <rpc/common/Validators.h>
namespace RPC {
/**
* @brief The nft_info command asks the Clio server for information about the NFT being queried.
*
* For more details see: https://xrpl.org/nft_info.html
*/
class NFTInfoHandler
{
std::shared_ptr<BackendInterface> sharedPtrBackend_;

View File

@@ -24,6 +24,11 @@
namespace RPC {
/**
* @brief The nft_sell_offers method returns a list of sell offers for a given NFToken object.
*
* For more details see: https://xrpl.org/nft_sell_offers.html
*/
class NFTSellOffersHandler : public NFTOffersHandlerBase
{
public:

View File

@@ -27,6 +27,13 @@
#include <set>
namespace RPC {
/**
* @brief The noripple_check command provides a quick way to check the status of the Default Ripple field for an account
* and the No Ripple flag of its trust lines, compared with the recommended settings.
*
* For more details see: https://xrpl.org/noripple_check.html
*/
class NoRippleCheckHandler
{
std::shared_ptr<BackendInterface> sharedPtrBackend_;

View File

@@ -23,6 +23,11 @@
namespace RPC {
/**
* @brief The ping command returns an acknowledgement, so that clients can test the connection status and latency.
*
* For more details see https://xrpl.org/ping.html
*/
class PingHandler
{
public:

View File

@@ -27,6 +27,12 @@
namespace RPC {
/**
* @brief The random command provides a random number to be used as a source of entropy for random number generation by
* clients.
*
* For more details see: https://xrpl.org/random.html
*/
class RandomHandler
{
public:

View File

@@ -239,6 +239,12 @@ private:
}
};
/**
* @brief The server_info command asks the Clio server for a human-readable version of various information about the
* Clio server being queried.
*
* For more details see: https://xrpl.org/server_info-clio.html
*/
using ServerInfoHandler = BaseServerInfoHandler<SubscriptionManager, ETLLoadBalancer, ReportingETL, Counters>;
} // namespace RPC

View File

@@ -295,6 +295,11 @@ private:
}
};
/**
* @brief The subscribe method requests periodic notifications from the server when certain events happen.
*
* For more details see: https://xrpl.org/subscribe.html
*/
using SubscribeHandler = BaseSubscribeHandler<SubscriptionManager>;
} // namespace RPC

View File

@@ -25,6 +25,12 @@
#include <rpc/common/Validators.h>
namespace RPC {
/**
* @brief The transaction_entry method retrieves information on a single transaction from a specific ledger version.
*
* For more details see: https://xrpl.org/transaction_entry.html
*/
class TransactionEntryHandler
{
std::shared_ptr<BackendInterface> sharedPtrBackend_;

View File

@@ -25,6 +25,12 @@
#include <rpc/common/Validators.h>
namespace RPC {
/**
* @brief The tx method retrieves information on a single transaction, by its identifying hash.
*
* For more details see: https://xrpl.org/tx.html
*/
class TxHandler
{
std::shared_ptr<BackendInterface> sharedPtrBackend_;

View File

@@ -210,6 +210,12 @@ private:
}
};
/**
* @brief The unsubscribe command tells the server to stop sending messages for a particular subscription or set of
* subscriptions.
*
* For more details see: https://xrpl.org/unsubscribe.html
*/
using UnsubscribeHandler = BaseUnsubscribeHandler<SubscriptionManager>;
} // namespace RPC