You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
var httpClient = http.Client();
var ethClient = Web3Client(apiUrl, httpClient);
EthPrivateKey credentials = EthPrivateKey.fromHex('0x$XXXMy_private_KeyXXX');
EtherAmount etherAmount = await ethClient.getBalance(credentials.address);
EtherAmount gasPrice = await ethClient.getGasPrice();
log('SSS amount is -= $etherAmount');
print('Balance in Wei: ${etherAmount.getInWei}');
print('Balance in Ether: ${etherAmount.getValueInUnit(EtherUnit.ether)}');
{
this is out put why is 0.0 ??
flutter: Balance in Wei: 0
flutter: Balance in Ether: 0.0
}
await ethClient.sendTransaction(
credentials,
Transaction(
to: EthereumAddress.fromHex(XXX_receiver_XXX),
gasPrice: gasPrice,
value: txValue,
),
chainId: 11155111,
);
{
error is => RPCError: got code -32000 with msg "insufficient funds for transfer".
}
but I have amount in wallet but it's showing 0.0 and get this error
The text was updated successfully, but these errors were encountered:
i have "total_balance_formatted": "0.000528902815064832",
here is code
double amount = 0.000128902815064832;
BigInt bigIntValue = BigInt.from(amount * pow(10, 18));
EtherAmount ethAmount =
EtherAmount.fromBigInt(EtherUnit.wei, bigIntValue);
var apiUrl =
"https://eth-sepolia.g.alchemy.com/v2/XXXmy_APi_KeyXXX";
this is out put why is 0.0 ??
flutter: Balance in Wei: 0
flutter: Balance in Ether: 0.0
}
await ethClient.sendTransaction(
credentials,
Transaction(
to: EthereumAddress.fromHex(XXX_receiver_XXX),
gasPrice: gasPrice,
value: txValue,
),
chainId: 11155111,
);
error is => RPCError: got code -32000 with msg "insufficient funds for transfer".
}
but I have amount in wallet but it's showing 0.0 and get this error
The text was updated successfully, but these errors were encountered: