Web3js and EthereumJS-TX – Signing Transactions on BSC Testnet

bscethereumjsethereumjs-txsendtransactionweb3js

How do I sign and send a transaction using web3.js and ethereumjs-tx on the BSC testnet?

I have found this question and answer:

Is it possible to send transaction in Binance Smart Chain using web3 and ethereumjs-tx?

This only seems to cover the mainnet:

const common = Common.default.forCustomChain('mainnet', {
  name: 'bnb',
  networkId: 56,
  chainId: 56
}, 'petersburg');

If I substitute the chainId for 97 (BSC Testnet Id) and replace 'petersburg' with Chapel. I get 'Error: Chain with name Chapel not supported'

Any help is greatly appreciated. Thanks in advance.

Best Answer

I gave up trying to ethereumjs-tx in the end as I came across this:

https://stackoverflow.com/questions/64526925/how-to-swap-tokens-on-uniswap-using-web3-js

Managed to get that solution up and running it solved that particular error I was getting.