Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

invalid chain id for signer for #112

Open
yurenji opened this issue Mar 1, 2022 · 0 comments
Open

invalid chain id for signer for #112

yurenji opened this issue Mar 1, 2022 · 0 comments

Comments

@yurenji
Copy link

yurenji commented Mar 1, 2022

I tried to create a transaction following the sdk example:

  const hmy = new Harmony(
    'https://api.fuzz.fi/',
    {
        chainType: ChainType.Harmony,
        chainId: ChainID.Harmony,
    },
  );
  hmy.wallet.addByPrivateKey('');
  const txn = hmy.transactions.newTx({
    to: receiver_address,
    value: new Unit(1).asOne().toWei(),
    gasLimit: '21000',
    shardID: 0,
    toShardID: 0,
    gasPrice: new hmy.utils.Unit('31').asGwei().toWei(),
  });
  const signedTxn = await hmy.wallet.signTransaction(txn);
  const txnHash = await hmy.blockchain.sendTransaction(signedTxn);

but got the following error msg:

{
  jsonrpc: '2.0',
  id: 3,
  error: {
    code: -32000,
    message: 'blockchain chain id:1, given 2: invalid chain id for signer'
  },
  req: {
    payload: {
      jsonrpc: '2.0',
      id: 3,
      method: 'hmy_sendRawTransaction',
      params: [Array]
    },
    url: 'https://api.fuzz.fi/',
    options: {
      method: 'POST',
      timeout: 120000,
      headers: [Object],
      user: null,
      password: null
    }
  },
  responseType: 'raw'
}

Not sure why since only one chainId is provided.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant