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

Function DexOperatorToJson

src/rpc/rpcdex.cpp:86–106  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

84}
85
86static Object DexOperatorToJson(const CAccountDBCache &accountCache, const DexOperatorDetail &dexOperator) {
87 Object result;
88 CKeyID ownerKeyid;
89 accountCache.GetKeyId(dexOperator.owner_regid, ownerKeyid);
90 CKeyID feeReceiverKeyId;
91 accountCache.GetKeyId(dexOperator.fee_receiver_regid, feeReceiverKeyId);
92 result.push_back(Pair("owner_regid", dexOperator.owner_regid.ToString()));
93 result.push_back(Pair("owner_addr", ownerKeyid.ToAddress()));
94 result.push_back(Pair("fee_receiver_regid", dexOperator.fee_receiver_regid.ToString()));
95 result.push_back(Pair("fee_receiver_addr", feeReceiverKeyId.ToAddress()));
96 result.push_back(Pair("name", dexOperator.name));
97 result.push_back(Pair("portal_url", dexOperator.portal_url));
98 result.push_back(Pair("order_open_mode", kOpenModeHelper.GetName(dexOperator.order_open_mode)));
99 result.push_back(Pair("maker_fee_ratio", dexOperator.maker_fee_ratio));
100 result.push_back(Pair("taker_fee_ratio", dexOperator.taker_fee_ratio));
101 result.push_back(Pair("order_open_dexop_list", json::ToJson(dexOperator.order_open_dexop_set)));
102 result.push_back(Pair("memo", dexOperator.memo));
103 result.push_back(Pair("memo_hex", HexStr(dexOperator.memo)));
104 result.push_back(Pair("activated", dexOperator.activated));
105 return result;
106}
107
108namespace RPC_PARAM {
109

Callers 2

getdexoperatorFunction · 0.85
getdexoperatorbyownerFunction · 0.85

Calls 7

PairClass · 0.85
HexStrFunction · 0.85
push_backMethod · 0.80
ToAddressMethod · 0.80
ToJsonFunction · 0.70
GetKeyIdMethod · 0.45
ToStringMethod · 0.45

Tested by

no test coverage detected