Closed KRENERGY closed 2 years ago
You need to explicitly set the chainId
to null when you set featchChainIdFromNetworkId: true
, by default chainId
is set to 1.
Here is the line of code that is throwing https://github.com/simolus3/web3dart/blob/af4c3fb4a0c258f4146f051e4c27d1674046003b/lib/src/core/transaction_signer.dart#L19
client.sendTransaction(
EthPrivateKey.fromHex(privateKey),
transaction,
chainId: null,
fetchChainIdFromNetworkId: true,
);
Hello,
Perfect ! All transactions 'send' working :) Thanks a lot.
Regards, S.
Hello,
I have been using the following code to "send Transaction" without any problem, but with an 'old' version of Flutter (1.xx) :
#######
Future setEthClient() async {
Client httpClient;
Web3Client ethClient;
httpClient = Client();
ethClient = Web3Client(
"https://rinkeby.infura.io/v3/afc2….”, //note : partially erased here for privacy concerns :)
httpClient);
return ethClient;
}
Future cacheSend(
String receiverRequest,
String myPrivateKeyAddress_String,
Web3Client ethClient,
DeployedContract contract,
String functionName,
List args,
EthereumAddress myAddress,
int maxGasAmount) async {
} }
#######
Since I have upgraded to Flutter 2.xx , I have the following error message :
####### [ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: Invalid argument(s): You can't specify loadChainIdFromNetwork and specify a custom chain id! #######
Changing "fetchChainIdFromNetworkId : true" to "fetchChainIdFromNetworkId : false", I get another error message ####### Unhandled Exception: RPCError: got code -32000 with msg "invalid sender" #######
I use web3dart: ^2.1.4.
After trying to find out some answer with Google & Co, without any result, I am asking for your help. Thanks in advance.
Regards, S.