The wallet is where you store the private key which is stored encrypted.
This private key is then un-encrypted temporarily and used to sign transactions which are then sent to an API node which forwards the trx assuming it meets all the necessary resource constraints and does not encounter a smart contract assertion.
Like all blockchain accounts, whoever ...
You can use eosjs to solve this.
According to the documentation here: https://developers.eos.io/manuals/eosjs/latest/how-to-guides/how-to-stake
You can stake for resources. The example below is staking for NET and CPU for the user "mynewaccount" in the name of "useraaaaaaaa". I assume if you provide the "stake_ram_quantity" it ...
it seems you do not have the keys for the account you are trying to refund.
here you can see the keys for the account:
and it seems you provided these keys instead (they are different):
I think these threads will answer your question in detail (see the other questions linked in the initial question as well):
Transfer tokens inside a smart contract from an account to another account
here you get more detailed explanations as well: