impliments account RPC handlers

This commit is contained in:
Nathan Nichols
2021-04-26 10:36:02 -05:00
parent f540ceda35
commit 68a6933583
9 changed files with 585 additions and 54 deletions

View File

@@ -45,7 +45,10 @@ enum RPCCommand {
ledger_range,
ledger_entry,
account_channels,
account_lines
account_lines,
account_currencies,
account_offers,
account_objects
};
std::unordered_map<std::string, RPCCommand> commandMap{
{"tx", tx},
@@ -57,7 +60,10 @@ std::unordered_map<std::string, RPCCommand> commandMap{
{"ledger_data", ledger_data},
{"book_offers", book_offers},
{"account_channels", account_channels},
{"account_lines", account_lines}};
{"account_lines", account_lines},
{"account_currencies", account_currencies},
{"account_offers", account_offers},
{"account_objects", account_objects}};
boost::json::object
doAccountInfo(
@@ -95,6 +101,18 @@ boost::json::object
doAccountLines(
boost::json::object const& request,
BackendInterface const& backend);
boost::json::object
doAccountCurrencies(
boost::json::object const& request,
BackendInterface const& backend);
boost::json::object
doAccountOffers(
boost::json::object const& request,
BackendInterface const& backend);
boost::json::object
doAccountObjects(
boost::json::object const& request,
BackendInterface const& backend);
boost::json::object
buildResponse(
@@ -136,6 +154,15 @@ buildResponse(
case account_lines:
return doAccountLines(request, backend);
break;
case account_currencies:
return doAccountCurrencies(request, backend);
break;
case account_offers:
return doAccountOffers(request, backend);
break;
case account_objects:
return doAccountObjects(request, backend);
break;
default:
BOOST_LOG_TRIVIAL(error) << "Unknown command: " << command;
}