MCPcopy Create free account
hub / github.com/WaykiChain/WaykiChain / getdexoperator

Function getdexoperator

src/rpc/rpcdex.cpp:1119–1142  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1117
1118
1119extern Value getdexoperator(const Array& params, bool fHelp) {
1120 if (fHelp || params.size() != 1) {
1121 throw runtime_error(
1122 "getdexoperator dex_id\n"
1123 "\nget dex operator by dex_id.\n"
1124 "\nArguments:\n"
1125 "1.\"dex_id\": (numeric, required) dex id\n"
1126 "\nResult: dex_operator detail\n"
1127 "\nExamples:\n"
1128 + HelpExampleCli("getdexoperator", "10")
1129 + "\nAs json rpc call\n"
1130 + HelpExampleRpc("getdexoperator", "10")
1131 );
1132 }
1133
1134 uint32_t dexOrderId = params[0].get_int();
1135 DexOperatorDetail dexOperator;
1136 if (!pCdMan->pDexCache->GetDexOperator(dexOrderId, dexOperator))
1137 throw JSONRPCError(RPC_INVALID_PARAMS, strprintf("dex operator does not exist! dex_id=%lu", dexOrderId));
1138
1139 Object obj = DexOperatorToJson(*pCdMan->pAccountCache, dexOperator);
1140 obj.insert(obj.begin(), Pair("id", (uint64_t)dexOrderId));
1141 return obj;
1142}
1143
1144extern Value getdexoperatorbyowner(const Array& params, bool fHelp) {
1145 if (fHelp || params.size() != 1) {

Callers

nothing calls this directly

Calls 10

HelpExampleCliFunction · 0.85
HelpExampleRpcFunction · 0.85
JSONRPCErrorFunction · 0.85
DexOperatorToJsonFunction · 0.85
PairClass · 0.85
get_intMethod · 0.80
GetDexOperatorMethod · 0.80
sizeMethod · 0.45
insertMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected