I am able to call Smart contract methods from client machine in development env:
example:
contract.methods.allowance
contract.methods.approve
and I can see the transactions in Ganache UI returned from contract.methods.approve
Which is fine. However, what I am expecting to see in the browser is a prompt in the connected wallet to approve the transaction, similar to the prompt I get when calling:
window.ethereum.request({ method: 'eth_requestAccounts' });
or
window.ethereum.request({ method: 'eth_sendTransaction', params});
The account I am using is one I used provided by Ganache UI where I imported the private key into metamask.
I must be misunderstanding something because there is no point in an "approve" feature conceptually if there is no "approving" taking place by the owner of the address apart from the client machine calling "approve". Does this have something to do with the fact the the dev env already knows what the private key is?
When switching metamask account to an account outside of the development network (my actual account), I get "sender account not recognized" error. But why isn't default behaviour to ask the unrecognised account to approve the transaction?
example, I can call: window.ethereum.request({ method: 'eth_sendTransaction', params}); with the "unrecognised" account and approve the transaction but I can't make a SC call and approve it with this account.