Adds account_channels RPC

This commit is contained in:
Nathan Nichols
2021-04-23 18:41:47 -05:00
parent e7b212a05c
commit f540ceda35
5 changed files with 336 additions and 35 deletions

View File

@@ -43,7 +43,9 @@ enum RPCCommand {
ledger_data,
book_offers,
ledger_range,
ledger_entry
ledger_entry,
account_channels,
account_lines
};
std::unordered_map<std::string, RPCCommand> commandMap{
{"tx", tx},
@@ -53,7 +55,9 @@ std::unordered_map<std::string, RPCCommand> commandMap{
{"ledger_entry", ledger_entry},
{"account_info", account_info},
{"ledger_data", ledger_data},
{"book_offers", book_offers}};
{"book_offers", book_offers},
{"account_channels", account_channels},
{"account_lines", account_lines}};
boost::json::object
doAccountInfo(
@@ -83,6 +87,14 @@ boost::json::object
doLedgerRange(
boost::json::object const& request,
BackendInterface const& backend);
boost::json::object
doAccountChannels(
boost::json::object const& request,
BackendInterface const& backend);
boost::json::object
doAccountLines(
boost::json::object const& request,
BackendInterface const& backend);
boost::json::object
buildResponse(
@@ -118,6 +130,12 @@ buildResponse(
case book_offers:
return doBookOffers(request, backend);
break;
case account_channels:
return doAccountChannels(request, backend);
break;
case account_lines:
return doAccountLines(request, backend);
break;
default:
BOOST_LOG_TRIVIAL(error) << "Unknown command: " << command;
}