Questions tagged [ethereumjs-tx]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
4 views

Ethereumjs putContractStorage throws an error

I'm experimenting with Ethereumjs and having issues with the putContractStorage from vm.stateManager. The following code snippet: const { VM } = require('@ethereumjs/vm') const vm1 = new VM() const ...
Andreas Tzionis's user avatar
1 vote
0 answers
67 views

How to let client side sign the transaction and send it to blockchain

This mint function is giving me this error Uncaught (in promise) Error: Returned error: transaction could not be decoded: unsupported transaction type And if I use ethereum-js/tx module to serialize ...
kaan.py's user avatar
  • 11
0 votes
0 answers
134 views

Web3Js: TypeError: hexToBytes: expected string, got object

I am trying to sign a transaction, but I'm receiving this error: hexToBytes: expected string, got object TypeError: hexToBytes: expected string, got object at hexToBytes (~\node_modules\@noble\...
Shahrad Elahi's user avatar
1 vote
1 answer
746 views

Extracing v, r, s from signature and adding it to a transaction

I am trying to decode the v, r, s from a signature and add that to a transaction and broadcast at some point. When I convert the signature into v,r,s and build the raw tx the from: parameter does not ...
MisterBulle's user avatar
2 votes
1 answer
257 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 the transactionRoot stored in the block. My current logic is ...
Andreas Dilaveris's user avatar
1 vote
1 answer
701 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 ...
CoderApprentice's user avatar
1 vote
1 answer
505 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-...
Ani's user avatar
  • 123
0 votes
1 answer
474 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. ...
Surinder kumar's user avatar
0 votes
1 answer
4k 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 ...
Ryan Sea's user avatar
  • 608
1 vote
1 answer
308 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 ...
nania's user avatar
  • 31
1 vote
1 answer
3k 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 ...
forhas's user avatar
  • 765
3 votes
1 answer
5k 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('...
grok_j's user avatar
  • 33
0 votes
0 answers
54 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 ...
John's user avatar
  • 1
1 vote
3 answers
4k 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 ...
ImJhardy's user avatar
1 vote
3 answers
1k 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 = ...
Caelan Miron's user avatar
2 votes
2 answers
5k 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 ...
Cameron Honis's user avatar
0 votes
1 answer
439 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 { ...
bbnn's user avatar
  • 206
0 votes
1 answer
263 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....
Harshak Krishnaa's user avatar
3 votes
2 answers
20k 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\...
sultan's user avatar
  • 265
0 votes
0 answers
75 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....
Gagandeep Singh's user avatar
0 votes
1 answer
410 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 ...
ETHus's user avatar
  • 3
0 votes
1 answer
645 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....
ETHus's user avatar
  • 3
0 votes
1 answer
51 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; }...
Jahid Shohel's user avatar
1 vote
0 answers
31 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 ?
Shubham Singh's user avatar
0 votes
1 answer
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){ ...
Cryptoineer's 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 ...
Block Crasher's user avatar
1 vote
1 answer
3k views

How to use private blockchains in [email protected]?

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....
戴廷逸's user avatar
1 vote
1 answer
379 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; } ...
salgarji's user avatar
2 votes
2 answers
5k 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 ...
Zephyrus's user avatar
  • 350
6 votes
4 answers
2k 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 = ...
Sreesankar G Warrier's user avatar
0 votes
2 answers
401 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 ...
Dorel's user avatar
  • 1
0 votes
0 answers
388 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, ...
clement's user avatar
  • 4,292
0 votes
2 answers
139 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 ...
Mr. 124's user avatar
  • 65
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.
Amit Kumar's user avatar
0 votes
1 answer
1k 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 ...
Ishwar Chandra Tiwari's user avatar
0 votes
1 answer
1k 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' + ...
Haider Yaqoob's user avatar
2 votes
1 answer
2k 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 ...
Crypto's user avatar
  • 95
8 votes
3 answers
14k 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 ...
cryptoKTM's user avatar
  • 431
0 votes
1 answer
273 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 ...
Anthony's user avatar
  • 183
2 votes
0 answers
675 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 ...
Gem Cutter's 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 = '...
jfjobidon's user avatar
  • 763
1 vote
1 answer
880 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 ...
Steve Martin's 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 ...
Robsonsjre's user avatar
0 votes
0 answers
659 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 ...
JarethRader's user avatar
0 votes
1 answer
418 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="...
Ryan D's user avatar
  • 125
1 vote
2 answers
222 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#...
Oaks-view's user avatar
  • 135
2 votes
1 answer
908 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 ...
3mrsh's user avatar
  • 93
0 votes
1 answer
118 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', ...
nizzle's user avatar
  • 103
1 vote
0 answers
127 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 ...
king_geedorah's user avatar
1 vote
0 answers
122 views

Trying to iterate through an array to send signed transactions results in one failure and one success

I'm trying to iterate through an array of address/key pairs and send a transaction from each one. When I do this on testrpc with an array of the account info for two different accounts, one ...
king_geedorah's user avatar