| 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() { |
nothing calls this directly
no outgoing calls
no test coverage detected