xclud / web3dart

Ethereum library, written in Dart.
https://pub.dev/packages/web3dart
MIT License
170 stars 94 forks source link

ALREADY_EXISTS: already known when sendTransaction() #100

Open junixapp opened 1 year ago

junixapp commented 1 year ago

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>