I am trying to use RPC to perform such actions as:
Check balance and make transfers using selected wallet
The needed wallet should be unlocked just before any tranfer and locked immediately after
monero-wallet-rpc (with --wallet-dir option) can do the first part, but I have some problems with the second.
When I start monero-wallet-rpc, no wallet is loaded and I should manually do that using "open_wallet" function with filename and password parameters. After that, I can request balance ("getbalance") or transfer ("transfer") funds, none of them needs password anymore. I tried to close wallet using "stop_wallet" command to "lock" the wallet, but it stops the entire monero-wallet-rpc daemon (so I can't anymore open wallets without restarting monero-wallet-rpc).
The only solution that I found to solve the problem is to use "open_wallet" on some temporary wallet, so that it replaces the "battle" one, but I am not sure, that "battle" wallet is fully closed and the whole solution doesn't seem to be correct.
What else can I do to achieve listed requirements? May be there are some other tools (or options) that can be used?