Say you are trying to program monero-wallet-cli
for the first time.
You've got a Monero daemon running that affords you this API: https://www.getmonero.org/resources/developer-guides/daemon-rpc.html
What set of RPC calls do you need to make to calculate the final balance of the address that you have private keys to?