Robustly validate input to the 'ledger' RPC command