web3dart icon indicating copy to clipboard operation
web3dart copied to clipboard

ALREADY_EXISTS: already known when sendTransaction()

Open junixapp opened this issue 2 years ago • 0 comments


const String rpcUrl = 'https://eth-goerli.api.onfinality.io/public';

var res = await client.sendTransaction(
      credentials,
      Transaction(
        to: EthereumAddress.fromHex('xxxxx'),
        gasPrice: EtherAmount.fromUnitAndValue(EtherUnit.kwei, 10),
        maxGas: 100000,
        value: EtherAmount.fromUnitAndValue(EtherUnit.gwei, 1000000), //0.0001eth
        // value: EtherAmount.fromUnitAndValue(EtherUnit.ether, 0.01),
      ),
      chainId : 5,
  );

error:

response: {jsonrpc: 2.0, id: 3, error: {code: -32000, message: ALREADY_EXISTS: already known}}
Unhandled exception:
RPCError: got code -32000 with msg "ALREADY_EXISTS: already known".
#0      JsonRPC.call (package:web3dart/json_rpc.dart:73:7)
<asynchronous suspension>
#1      Web3Client._makeRPCCall (package:web3dart/src/core/client.dart:53:20)
<asynchronous suspension>
#2      main (package:example/main.dart:41:13)
<asynchronous suspension>

junixapp avatar Mar 29 '23 06:03 junixapp