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

eth.sendTransaction() does not send type 2 EIP 1559 transaction from node.js #4364

Closed
david03g opened this issue Sep 24, 2021 · 2 comments
Closed
Labels
1.x 1.0 related issues

Comments

@david03g
Copy link

Expected behavior

WEB3.eth.sendTransaction({
          from: address,
          to: to,
          value: value,
          type:'0x2',
          gas: 21000,
          maxFeePerGas: maxFeePerGas,
          maxPriorityFeePerGas: maxPriorityFeePerGas,
      })

EIP 1559 type 2 transactions sends perfectly from browser environment but not from node.js.

Actual behavior

Only type 0 (legacy) transaction is sent.

Environment

truffle/[email protected]
node.js@12
[email protected]

Goerli test network

@david03g david03g changed the title eth.sendTransaction() does not send ype 2 EIP 1559 transaction from node.js eth.sendTransaction() does not send type 2 EIP 1559 transaction from node.js Sep 24, 2021
@jdevcs jdevcs added the 1.x 1.0 related issues label Sep 27, 2021
@jdevcs
Copy link
Contributor

jdevcs commented Sep 27, 2021

@david03g could you check and verify? , Seems related with this

@david03g
Copy link
Author

@jdevcs it was related to that issue. Replacing @truffle/hdwallet-provider fixed the problem.

const wsProvider = new Web3.providers.WebsocketProvider('wss://...');
const web3 = new Web3(wsProvider);
web3.eth.accounts.wallet.add(web3.eth.accounts.privateKeyToAccount('0x' + <private key>)); 

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

No branches or pull requests

2 participants