The issue with the checkBalance
function not appearing in the Candid UI or responding to CLI calls is likely due to its incorrect declaration using async
in a shared query
function, which isn't necessary and can cause it to be excluded from the generated interface. To fix this, change the method signature to public shared query func checkBalance(): Nat
(removing async
), then stop the DFX server, delete the .dfx
folder, and restart everything cleanly using dfx stop
, rm -rf .dfx
, dfx start --clean
, and dfx deploy
. After redeploying, the method should appear in the Candid UI and respond properly to dfx canister call
commands.