Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const { Transaction } = require('@ethereumjs/tx');
- async function run() {
- const txParams = {
- from: "0xb1C3C636576910195B322407CB037AA39CFc3704",
- to: "0x0EefF8299B50111b0414D55a7A351A0b02d2529A",
- nonce: '0x00',
- gasPrice: "0x09184e72a000",
- }
- // privkey to the `from` address
- const privateKey = Buffer.from('d05ed1ad7027c78aa1f0a55f1b135ff1ba9abbb571457673126e3950c1a927a0', 'hex')
- const tx = Transaction.fromTxData(txParams);
- const signedTx = tx.sign(privateKey);
- const tx2 = Transaction.fromTxData(txParams);
- const signedTx2 = tx.sign(privateKey)
- console.log(signedTx.hash().toString("hex"));
- console.log(signedTx2.hash().toString("hex"));
- }
- run();
Advertisement
Add Comment
Please, Sign In to add comment