MCPcopy Create free account
hub / github.com/QuipNetwork/cpp-sdk / getTransferFee

Method getTransferFee

src/quip_factory.cpp:245–259  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

243 }
244
245 Amount getTransferFee() {
246 // Call the contract's transferFee() getter
247 nlohmann::json params = nlohmann::json::array();
248 std::string params_json = params.dump();
249 std::string data = abiEncode("transferFee", abi_json, params_json);
250 nlohmann::json call_object = {{"to", contract_address_}, {"data", data}};
251 nlohmann::json params_call = {call_object, "latest"};
252 auto response = sendJsonRpc("eth_call", params_call);
253 std::string result = response["result"];
254 if (result.length() >= 66) { // 0x + 64 hex chars
255 // Parse uint256 from hex
256 return std::stoull(result.substr(2), nullptr, 16);
257 }
258 return 0;
259 }
260
261 Amount getExecuteFee() {
262 // Call the contract's executeFee() getter

Callers

nothing calls this directly

Calls 1

abiEncodeFunction · 0.85

Tested by

no test coverage detected