You can have methods canDeposit and canWithdraw in your interface. This makes it possible for your ui to adapt, like not showing a window for entering a deposit amount when you can’t deposit. 

And you can have methods deposit() and withdraw() which assert when you call them when the call isn’t allowed (because that’s a programming error) and do the right thing otherwise.