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

Method getBalance

src/quip_wallet.cpp:609–623  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

607 }
608
609 Amount getBalance() {
610 try {
611 // Use eth_getBalance on the contract address
612 nlohmann::json params = {contract_address_, "latest"};
613 auto response = sendJsonRpc("eth_getBalance", params);
614 std::string result = response["result"];
615 if (result.length() > 2) {
616 return std::stoull(result.substr(2), nullptr, 16);
617 }
618 return 0;
619 } catch (const std::exception &e) {
620 std::cerr << "Error in getBalance: " << e.what() << std::endl;
621 return 0;
622 }
623 }
624
625 // Get transfer fee from contract
626 Amount getTransferFee() {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected