Hi everyone, I’m trying to integrate MetaMask SDK in my Unity project, it’s university project. I want to show the user current user his balance in ETH but the json rpc call fails and I don’t know why. I can’t find anything useful in the docs.
{
var wallet = MetaMaskUnity.Instance.Wallet;
var transactionParams = new MetaMaskTransaction
{
To = "0xbF09120dada33C13765671158bC0364ce4604b7C",
From = MetaMaskUnity.Instance.Wallet.SelectedAddress,
Value = "0x"
};
var request = new MetaMaskEthereumRequest
{
Method = "eth_getBalance",
Parameters = new MetaMaskTransaction[] { transactionParams }
};
var balance = await wallet.Request(request);
Debug.Log("Balance found: " + balance);
}