Questions tagged [ethereumjs-tx]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
10 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 ...
0
votes
1answer
94 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 ...
1
vote
1answer
428 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('...
0
votes
0answers
31 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 ...
1
vote
1answer
741 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 ...
1
vote
1answer
187 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 = ...
2
votes
2answers
765 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 ...
0
votes
1answer
67 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 { ...
0
votes
1answer
74 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....
2
votes
2answers
5k 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\...
0
votes
0answers
27 views

data in ethereumjs-tx

I am trying to create a tx to interact with one of smart contract function. function withdraw(uint withdraw_amount) public { } I tried declaring the params for ethTx as this : const params = {...
0
votes
0answers
26 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....
0
votes
1answer
159 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 ...
0
votes
1answer
182 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....
0
votes
1answer
40 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; }...
1
vote
0answers
21 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 ?
0
votes
0answers
658 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){ ...
1
vote
1answer
1k 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 ...
0
votes
1answer
746 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....
1
vote
1answer
182 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; } ...
2
votes
1answer
2k 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 ...
3
votes
4answers
680 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 = ...
0
votes
2answers
156 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 ...
0
votes
0answers
176 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, ...
0
votes
2answers
62 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 ...
3
votes
1answer
527 views

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

I am using web3 and want to sign transactions made with ERC20 contract.
0
votes
1answer
513 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 ...
0
votes
1answer
307 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' + ...
2
votes
1answer
489 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 ...
6
votes
3answers
7k 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 ...
0
votes
1answer
121 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 ...
1
vote
0answers
432 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 ...
0
votes
0answers
2k 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 = '...
1
vote
1answer
431 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 ...
1
vote
1answer
929 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 ...
0
votes
0answers
397 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 ...
0
votes
1answer
307 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="...
1
vote
2answers
199 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#...
1
vote
1answer
560 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 ...
0
votes
1answer
93 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', ...
1
vote
0answers
84 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 ...
1
vote
0answers
36 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 ...
3
votes
1answer
1k views

ganache-cli doesn't have enough funds to send tx – number increases proportionally to however much I initialize a wallet with

I'm trying to write a simple function to send a transaction using web3 and ethereumjs-tx that empties the wallet of an account (call this account A) into another account (account B). However, no ...
4
votes
0answers
496 views

How to use ethereumjs-vm to find the internal transactions for a transaction/block using infura.io

I am using infura.io as my node and trying to get the internal transactions (i.e. transfers initiated by smart contract) for a specific transaction (or its parent block). I have two attempts (both ...
4
votes
2answers
3k views

RangeError: private key length is invalid (In New ETH Transaction pragmatically)

Followed this Ans Ans1 and Ans2 but no solution got. const web3 = new Web3('https://ropsten.infura.io/v3/3c52917848e945229c0d33d632b10490'); const account1 = '...
0
votes
1answer
723 views

Problem with sending ERC20 token using web3@1.0.0

Circumstance I have followed all indications from this GH issue and from other SO posts. The transaction gets successfully broadcasted but no tokens are transferred. When I check the balance before ...
0
votes
1answer
1k views

Transaction signing fails Invalid RLP.","data":"RlpExpectedToBeList"

I'm trying to sign and push a transaction using ethereumjs and Infura. It seems to be working and I'm getting a transaction hash back, but the transaction is not visible on Etherscan, and when I'm ...
0
votes
2answers
1k views

web3.js library not loading properly

I am trying to load web3 library after installing it via command prompt. However, looks like it is not loading properly as it is not showing all the details for Ethereum ecosystem (ex. unitmap of ...
0
votes
1answer
676 views

transaction stuck in txpool as pending

I have a geth node, and using truffle-hd-wallet. I am trying to create a transaction between coinbase and the account created by hd-wallet.Created a raw transaction and signed it with privatekey of ...
1
vote
0answers
97 views

Unhandled promise rejection (rejection id: 100): TypeError: Invalid hex string

Getting this error when calling a write function in the smart contract. Please find the code below. getListedAsValidator: function(address,sender, callback) { var self = this; var config = ...