Questions tagged [ethereumjs-tx]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2 votes
0 answers
15 views

prove transactionHash of block using ethereumjs-tx and merkle-patricia-tree

As an exercise I want to retrieve all transactions from a block and rebuild the merkle patricia trie, then compare the root hash with that stored in the block. My current logic is receive block with ...
user avatar
0 votes
0 answers
40 views

How to send a pre-EIP155 transaction from transaction data

Suppose I have some transaction data that is compatible with pre-EIP155 ethereum (before the spurious dragon hardfork) and therefore also (hopefully ?) backward compatible with all the updated ...
user avatar
  • 177
0 votes
0 answers
49 views

Deployment of a contract via the sendRawTransaction RPC-call avoiding EIP155 reverts

I want to send a contract deployment transaction just through the raw signed transaction data. Here is what i have done: import { ethers } from "hardhat"; import { Transaction } from '...
user avatar
  • 177
0 votes
1 answer
126 views

Recover Y-parity from DER-signature for EIP-1559

I have a software system where signing ETH transactions happens in a black box. I give the information required, and it returns to me a DER-signature (30|totalLen|02|lenR|R|02|lenS|S). Now I'm aware ...
user avatar
0 votes
0 answers
22 views

different between offline transaction raw and online

i use this code : const EthereumTx = require('ethereumjs-tx').Transaction const privateKey = Buffer.from( '2EE0C********', 'hex', ) const txParams = { nonce: 686, gasPrice: ...
user avatar
0 votes
1 answer
227 views

SendSignedTransaction TIMEOUT

I'm trying to sign data offline and then send signed transaction via web3.js Here's my code snippet: const {sign} = require('@warren-bank/ethereumjs-tx-sign'); const {Loader} = require("loader-in-...
user avatar
  • 113
0 votes
1 answer
152 views

@ethereumjs/tx Error: Returned error: Insufficient funds. The account you tried to send transaction from does not have enough funds

Moving to @ethereumjs/tx npm package after ethereumjs-tx has been marked as deprecated. My from address has sufficient Kovan network balance, but the following code throwing Insufficient funds error. ...
user avatar
0 votes
1 answer
703 views

I'm getting 'error: exceeds block gas limit' despite my gas limit being very low

I am trying to create a simple transaction in the Rinkeby testnet using Web3.js, Ethereumjs-tx, and an Alchemy node. I've only managed to push transactions through at 0.001 Gwei in gas and it's been ...
user avatar
0 votes
0 answers
396 views

How to sign transaction using web3.eth.personal.sign, through Walletconnect

I am using the package Web3Modal to connect to different Ethereum Providers. And one of those providers is WalletConnect. Because it uses a Infura ID, I cant just sendTransaction(). First I need to ...
user avatar
1 vote
1 answer
228 views

Error while signing ethereum transaction with Private key and Infura URL

Unable to decode sender address from transaction: Incompatible EIP155-based V 37 and chain id 3. See the Common parameter of the Transaction constructor to set the chain id Please suggest me where i ...
user avatar
  • 31
0 votes
0 answers
445 views

Why do we convert private key to hexadecimal via the Buffer module in a transaction performed in Node.js with ethereumjs-tx & Web3?

I'm following a tutorial on how to send a signed transaction in Node.js with Web3 and the ethereumjs-tx module. My code works fine, but I don't understand the use of the Buffer module for my private ...
user avatar
0 votes
1 answer
2k views

How to sign a transaction for a smart contract call using Ethers? [duplicate]

I'm looking for a complete example of a javascript/typescript based code for signing a transaction for a smart contract function call (that changes the contract state) and also the broadcast of the ...
user avatar
  • 501
3 votes
1 answer
3k views

Web3js Error: transaction type not supported - How to know supported transaction type?

I'm trying to send a test transaction but am getting a "transaction type not supported" error, and I tried every transaction type supported in the @ethereumjs/tx docs. const Web3 = require('...
user avatar
  • 33
0 votes
0 answers
49 views

How do I deploy this code to the eth block

please I need help on this, this code works well on my local machine but doesn’t work on infura main net. I need it done to avoid stress in my business. To automatically transfer my work eth to my ...
user avatar
  • 1
1 vote
2 answers
3k views

How to sign a transaction using web3.js and ethereumjs-tx on the BSC testnet

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 ...
user avatar
1 vote
3 answers
745 views

unsigned transactions not supported - web3, infura, @ethereumjs/tx

I am working on sending signed transactions using web3, @ethereumjs/tx, and infura. However, I am getting an error "unsigned transactions not supported". Here my code, credit: const Web3 = ...
user avatar
2 votes
2 answers
3k views

"Invalid Chain Id" on Kovan testnet

I'm attempting to initiate a transaction (transfer of ETH) from my main account to a test account on the Kovan Testnet, but I'm getting the error Returned error: Invalid chain id. from the following ...
user avatar
0 votes
1 answer
227 views

Is it safe to publish a raw signed transaction in etherscan?

I'm making a flow of creating a transaction offline, and publish it using external node (etherscan.io). So the flow will go from here: I will use this code to generate a signed raw tx var { ...
user avatar
  • 196
0 votes
1 answer
170 views

Tx stuck even after using gasestimation for gas limit

I am trying to sign a manual transaction using ethereumjs-tx to interact with a smart contract. This is how I am getting my gaslimit, nounce and data for the params var GAS = await cont.methods....
user avatar
2 votes
2 answers
14k views

Expected private key to be an Uint8Array with length 32

i am trying to send a transaction but it throws an error. still i am not sending any transaction just signing it... Error: Expected private key to be an Uint8Array with length 32 at assert (C:\web3\...
user avatar
  • 135
0 votes
0 answers
50 views

ETH sent to an address that was generated for contracts, how can I recover?

I have transferred money to an ethereum address that belongs to the smart contracts. const priv = "0x" + crypto.randomBytes(32).toString("hex"); const pub = "0x" + util....
user avatar
0 votes
1 answer
276 views

TypeError [ERR_INVALID_ARG_TYPE] web3.js error

Can anyone help me fix this problem? I keep getting 'throw new ERR_INVALID_ARG_TYPE( ^ TypeError [ERR_INVALID_ARG_TYPE]: The first argument must be one of type string, Buffer, ArrayBuffer, Array, or ...
user avatar
  • 3
0 votes
1 answer
469 views

“txHash: undefined” error using web3.js

Can anyone help me fix this problem? I get 'txHash: undefined' error in terminal var Tx = require('ethereumjs-tx').Transaction const Web3 = require('web3') const web3 = new Web3('https://ropsten....
user avatar
  • 3
0 votes
1 answer
45 views

Not persisting value with transaction

I have a contract that looks like this - contract Calculator { uint public result; event Added(address caller, uint a, uint b, uint res); constructor() public { result = 777; }...
user avatar
1 vote
0 answers
27 views

Reading gas limit inside solidity smart contract? [duplicate]

As we can read the gas left and the gas price inside solidity smart contract, is there any way that I can read the gas limit set for the transaction inside the solidity ?
user avatar
0 votes
0 answers
1k views

ethereumjs-tx Returned error: invalid sender

When i am trying to send signed transaction via ethereumjs-tx. I get this Returned error: invalid sender web3Http.eth.getTransactionCount(myAddress,"pending").then(function(blockcount){ ...
user avatar
1 vote
1 answer
3k views

Transactions stuck at pending on ropsten test net from one day

I am Writing a simple script for ERC20 token transfer method. which sign transaction offline and then submit it to network. Transfer method encoded data : var encoded = await MyContract.methods ...
user avatar
0 votes
1 answer
2k views

How to use private blockchains in ethereumjs-tx@2.1.2?

I know this method var transaction = new Tx(rawTransaction, {chain:'ropsten'}); I tried var transaction = new Tx(rawTransaction, {chain:'192.168.XX.XX:8545'}); But get Error: Chain with name 192.168....
user avatar
1 vote
1 answer
323 views

Automatically register number into Kovan test net with signed transaction (Infura API + NodeJS)

I have a very simple Smart Contract deployed using remix.ethereum which is: pragma solidity ^ 0.6.0; contract primerContrato { uint storeddata; function set(uint x) public{ storeddata = x; } ...
user avatar
2 votes
1 answer
3k views

Error: "invalid sender" from web3.eth.sendSignedTransaction()

I have a client running a private blockchain. It was started with the following command: geth --datadir private-chain --mine --miner.threads 4 --http --http.addr 127.0.0.1 --http.port 8545 --http.api ...
user avatar
  • 190
4 votes
4 answers
1k views

TypeError: EthereumTransaction is not a constructor

var EthereumTransaction = require("ethereumjs-tx") var Web3 = require('web3') var web3 = new Web3('http://127.0.0.1:7545') //Setting Receiving and Sending Address var sendingAddress = ...
user avatar
0 votes
2 answers
339 views

Signature test failed at Truffle js

I'm trying to test validAddress function from my contract ValidationUser, using truffle and test with JS. I checked the V value from the signature and its 27,28 so it is not the problem. Also, I have ...
user avatar
  • 1
0 votes
0 answers
259 views

ethereumjs-tx : sign transaction using unlocked account

Web3js has the following method : web3.eth.signTransaction(transactionObject, address [, callback]) to sign a transaction using an unlocked account. Can we sign a transaction in a similar way, ...
user avatar
  • 3,747
0 votes
2 answers
100 views

Transaction won't be mined / Failed signing of transaction

I'm trying to send a transaction that writes somesthing on ethereum(kovan) but it seems my transaction is not mined and probably not even send to the network? All my view requests to ethereum work, so ...
user avatar
  • 55
3 votes
1 answer
1k views

Do we need to sign transaction for totalSupply also? [closed]

I am using web3 and want to sign transactions made with ERC20 contract.
user avatar
0 votes
1 answer
891 views

how to send erc20 token without using smart contract abi?

How to transfer erc20 token without using contract or contract abi? The below script i have used to create Signed Raw Transaction to send Ether(ETH). How can i create Signed Raw Transaction to send ...
user avatar
0 votes
1 answer
769 views

Why do we use `serialize` function of `ethereumjs-tx` package before broadcasting a transaction

I just want to know the purpose/functionality of serialize function which we use before broadcasting a transaction: const serializedTransaction = tx.serialize() const raw = '0x' + ...
user avatar
2 votes
1 answer
1k views

What does it mean to serialize a transaction?

In tx library there is a function: serialize() that "serializes" your transaction object. You can then convert that serialization into hexa decimal string, and use it to send the transaction with the ...
user avatar
  • 95
7 votes
3 answers
12k views

What is the networkid and chain id of truffle cli?

I am using truffle console to deploy contracts and using Nodejs/web3js to interact with it. I wanted to use ethereumjs-tx for signing transactions, here is the reference link. I am not sure how can I ...
user avatar
  • 363
0 votes
1 answer
177 views

Transaction being reverted by EVM during contract creation (Web3 / ethereumjs-tx)

Hey guys I am running into an issue deploying a smart contract with Web3 to the Ropsten network. The code is running seemingly correctly, and there is a contract address being created, but if I check ...
user avatar
  • 183
1 vote
0 answers
613 views

raw_tx_demo.js of "Mastering Ethereum" : TypeError: ethTx is not a constructor

I ran raw_tx_demo.js, an example code on page 119 of "Mastering Ethereum" by Antonopoulos and Wood, but got an error message below: $ node raw_tx_demo.js /Users/gemcutter/raw_tx_demo.js:22 tx = new ...
user avatar
0 votes
0 answers
3k views

intermediate value is not iterable

I try to construct a transaction with Node (11.4.0), ethereumjs-tx (1.3.7) and web3 (1.0.0-beta.55) and Infura. Infura gives me '0x35b' for the nonce, then I create the tx: amount = 0.001; nonce = '...
user avatar
  • 743
1 vote
1 answer
610 views

How create transaction raw data for using "eth_sendRawTransaction" in C#

My IoT device connects to another computer via Wi-Fi on which Ethereum (Truffle/Ganache) is running which receive a RPC from the IoT. My task is to create raw transaction data on this IoT Device, so ...
user avatar
1 vote
1 answer
1k views

Error: types/values length mismatchProblem when calling payable contract function with web3

Enviroment Node version: v10.15.3 Web3: ^1.0.0-beta.50 Net: Ropsten My smart contract is a very simple payable/balance one and my goal is to contribute 0.1 ETH to raise the contract balance using ...
user avatar
0 votes
0 answers
523 views

Sign a transaction locally and send it

I'm using Infura as my web3 provider, and have MetaMask installed to connect to the blockchain. I'm trying to send a transaction, but have learned that Infura is read-only, and doesn't support the ...
user avatar
0 votes
1 answer
355 views

Trying to send signed transaction through web browser using ethereum-tx

I am working on signing and sending a transaction using web3 v1.0 and Infura.io. I have setup a script to run the TX but cannot seem to get ethereum-tx to connect in the browser. <script src="...
user avatar
  • 125
1 vote
2 answers
210 views

Read state from smart contract deployed to azure proof of authority ethereum network

I deployed a smart contract to an azure proof of authority network(ethereum). Following the instructions here https://docs.microsoft.com/en-us/azure/blockchain/templates/ethereum-poa-deployment#...
user avatar
  • 135
2 votes
1 answer
784 views

Unable to Generate Same Account from MetaMask Mnemonic in EthereumJSWallet

I've been unable to generate the Account I see in MetaMask in EthereumJSWallet even if I use the same mnemonic. Due to the lack of documentation, I may be misunderstanding how to do so. I have run ...
user avatar
  • 83
0 votes
1 answer
107 views

transaction value does not match signed transaction params in ethereumJS-TX

I sign this transaction with Ethereumjs-tx: { nonce: 8, gasPrice: 20, gasLimit: 25000, to: '0x45cc01d4b9ad49b81527d5b6629da8664bb525d3', value: 1000000, data: '0x00', ...
user avatar
  • 103
1 vote
0 answers
100 views

When trying to perform sendSignedTransaction iteratively on wallets in an array, an undefined error is returned

I'm trying to write a script that takes as input a JSON array where each element of the array has an address and a corresponding private key. I'd like to have a function that iterates through this ...
user avatar