Closed dvalevv closed 2 years ago
I am closing the issue as after long search in the documentation I found that it can be done using TransactionOverride.
@dvalevv Do you know how to get the balance of an account on something like the Gnosis Chain ? I keep getting the error that my provider is undefined or null, I created an issue here explaining more information https://github.com/y-pakorn/flutter_web3/issues/43
Usually it must work like this:
<script src="https://cdn.ethers.io/lib/ethers-5.4.umd.min.js" type="application/javascript"></script>
<script src="https://cdn.jsdelivr.net/npm/@walletconnect/web3-provider@1.6.5/dist/umd/index.min.js" type="application/javascript"></script>
For native token:
final rpcProvider = JsonRpcProvider('https://rpc.gnosischain.com/');
var balance = await rpcProvider.getBalance("your_wallet_address");
For ERC20 token you can:
Contract(address, abi, provider)
and then await contract.call<BigInt>("balanceOf", ["wallet_address"])
ContractERC20(address, provider)
and await contract.balanceOf("wallet_address")
If you give me more info I can try it and send you the working code.
Hello, I am trying to execute transaction using the private wallet key instead of Metamask.
Simply my question is: