All Questions
Tagged with transactions web3js
373 questions
0
votes
1
answer
495
views
Creating a transaction from a webform - invalid number of args
I have a HTML web page where I am feeding user entries into a smart contract that is designed to "store" the entries in transactions. I have most of the application working, but I'm having trouble ...
0
votes
2
answers
343
views
Unable to send ether to account
I am trying to send ehter using this code
web3.eth.accounts.wallet.add(privateKey);
web3.eth.sendTransaction({
to:someAddress,
from:onwer,
value:amount*1,
...
1
vote
1
answer
4k
views
differents between web3.eth.signTransaction And web3.eth.accounts.signTransaction
I don't understand the differents between these methods
web3.eth.signTransaction
and
web3.eth.accounts.signTransaction
And when I have to use.
If I try to use web3.eth.signTransaction with ganache ...
1
vote
1
answer
571
views
How to prevent user to change recipient address when MetaMask transaction window pops up?
I want to integrate MetaMask as one of payment methods on my website.
The idea is to lock my content, when user made a successful ETH payment so the content will be revealed.
This is the source code:
&...
0
votes
1
answer
694
views
'value at "/0" is required'
const {Web3} = require("web3");
require("dotenv").config();
const sPrivateKey = process.env.SENDER_PRIVATE_KEY;
const sPublicKey = process.env.SENDER_PUBLIC_KEY;
const rPublicKey =...
1
vote
2
answers
958
views
Sending entire ether balance to another wallet
I found the same question but it was asked over 4 years ago but it doesn't seem to work anymore?
How do I send the entire ether balance from one account to another account?
const Web3 = require('web3')...
0
votes
1
answer
390
views
Impossible to deals with big number in web3.js transacation :
I can't deals with big number (BN.js) with web3.js I have overflow error or i have execution reverted with BN.js library when I try add liquidity to pancakeswap pool.
By using BN.js
Without using BN....
0
votes
3
answers
539
views
how can i send a transaction in spesific block numbers with web3Js?
I wanna know how to send the transaction in spesific block numbers with web3js ( Yes its for sniping bot )
The purpose is to avoid the tax in 1-3 blocks since liquidity is added
For example :
New ...
0
votes
1
answer
641
views
Contract Interaction and Batch Transaction with Web3
I've reviewed most all of the posts on this topic, but none of the answers are doing exactly what I need.
I have an application that allows users to submit their tokens from their contract into my &...
0
votes
1
answer
452
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
1
answer
398
views
Transaction response doesn't contain "receipt" value
i'm doing this send function
let result = await myContract.methods.myMethod().send({from: account});
console.log("result:", result);
using web3.js ^1.2.2 on testRPC with Ganache, hardfork Byzantium, ...
0
votes
2
answers
1k
views
Get to and from address using Transaction hash
How can I get only to and from addresses from a transaction Hash using Web3.
I am unable to get details of to and from using web3.eth.getTransaction() method. Please help!!
0
votes
1
answer
3k
views
How get estimated gas before sending the transaction?
How do you get the "estimated gas" from a "swapExactETHForTokens" function? As shown in metamask (before one can accept the purchase)
Binance Smart Chain (BSC)
From the pancakeswap ...
1
vote
1
answer
2k
views
ERC20 tokens transactions' history from Ethereum node
I have a parity node. I developed a web3.js interface on top of it.
I have APIs whose job is to fetch addresses' balances and transactions.
Example response of transaction API:
{ tx_hash: '...
3
votes
1
answer
3k
views
How to send correct SwapExactEthForTokens params types on ethers/web3.js?
I need to know how to send correct paramaters / paramater types as in what does the parameter type has to be is it a hex number , a string ?
help would be massively appreciated.
Notes:
1)i cant set ...
2
votes
2
answers
480
views
Transmit array as first parameter in web3.js
When I develop in solidity combined with web3.js, I face some problem recently. I create a contract code below
//setContractDetail(index,bool isConsentItem,uint8[] detailItems)
function ...
2
votes
1
answer
480
views
How to retrieve transaction hash value from the Promise object using web3js?
I'm trying to retrieve the transaction hash value after I call my smart contract method.
My Promise object looks like below.
returnPromise:
Promise { "pending" }
<state>: "...
0
votes
1
answer
709
views
sendTransaction returns Invalid JSON RPC response
I am trying to send a transaction to a Besu node that I have running locally. However, from the following code, when I run npx ts-node myFile.ts, I get Error: Invalid JSON RPC response:
const Web3 = ...
0
votes
2
answers
540
views
transaction parameter value with Wei is different from Metamask
For example, I set a tParam as
value: web3.utils.toWei('0.01','ether'),
...
const txHash = await window.ethereum.request({
method: "eth_sendTransaction",
params: [tParam],
})...
1
vote
1
answer
954
views
Send transaction throw bsc with web3
i'm trying to send a transaction via bsc using WalletConnect and web3
This is the connection code
const provider = new WalletConnectProvider({
rpc: {
1: "https://bsc-dataseed.binance....
0
votes
1
answer
1k
views
Transaction hash is 'undefined' when running web3 code from command prompt
I wrote this java script code to send test ether to my other account:
var Tx = require('ethereumjs-tx').Transaction
var Web3 = require('web3')
web3 = new Web3('https://ropsten.infura.io/...
1
vote
1
answer
2k
views
How can I sign a transaction without a private key?
after connecting to the bag and signing the transaction, I want to do the transaction without requesting confirmation. My main goal is to make a transaction without asking for final confirmation to ...
0
votes
1
answer
500
views
How to extract revert message from this specific object?
I have the follow error object that was caught in a catch statement
Error: execution reverted: Auction owner is not authorized
{
"originalError": {
"code": 3,
"data&...
1
vote
1
answer
553
views
What does to way multi approval transaction?
I am going to running swap transactions.
At first, we are going to running an approval transaction.
And then we are going to running a swap transaction.
These repeat.
I made the transaction data.
...
1
vote
2
answers
823
views
How to track incoming to smart contract transactions using web3js?
I've got one Ethereum smart contract which calls functions of the other one. How could I track these calls using web3js or some other tool if it is possible at all? I need it because I want to execute ...
0
votes
1
answer
3k
views
Coinbase / Web3 - how are they connected? Where is my balance on Web3
I am brand new. I created a Coinbase Account and started investing. I heard someone say something about web3. I don't know what this is, but I think i have money in there. As I'm still waiting to be ...
0
votes
1
answer
43
views
Error during tokenization with the contract: 0xe83cE6bfb580583bd6A62B4Be7b34fC25F02910D
I have an Alchemy project through which I have received transactions. I would like to tokenize these transactions using the following Python script:
import json
from web3 import Web3
# Codes de ...
0
votes
1
answer
203
views
TransactionRevertInstructionError: Transaction has been reverted by the EVM
I am now trying to use addLiquidity with Uniswap V2 on sepolia testnet.
I am using web3.js in truffle, but there are some areas where errors keep occurring.
I have posted only the necessary code here.
...
2
votes
1
answer
4k
views
How to get transaction receipt using transaction hash?
I deployed a smart contract and done some transactions. Now I want to see the transaction receipt of the transactions. So I wrote this code:
var Web3 = require('web3');
var web3 = new Web3(new
...
1
vote
1
answer
682
views
How to simulate multiple consecutive transactions and get the resulting state?
I'm trying to simulate a transaction on the public blockchain that invokes a contract's method with certain parameters. Then I want to make a follow-up transaction with some other method call.
I ...
1
vote
1
answer
71
views
How to know why Uniswap cancelled my transaction?
I am not pro, but can someone check please why my transaction was cancelled on Ethereum after sending to Swap token on Uniswap v2?
https://etherscan.io/tx/...
0
votes
0
answers
83
views
web3.js wrong EIP-1559 transaction
I am currently working on a function (for educational purposes) that signs a hex message, extracts the signatures and create a signed transaction, but every time I add the signature, the from address ...
0
votes
0
answers
514
views
nonce too low , please help
please help, I have 1 transaction stuck 7 days, I have sent 1 transaction with 0 ETH and nonce to the same address, to cancel the stuck transaction but all the nonce too low error
1
vote
2
answers
42
views
web3.js Keccak256 giving different answer
Minimum reproducible example :
hash1 = "be516d52220ea58966754101dd7ee25be73a695febd2bca54145681e2cc72fe9"
hash2 = "edede15ad23aba32fd2613ffee105278e322b2d81314bcb66eb4c453ad072bd4"
...
7
votes
5
answers
27k
views
How to wait until transaction is confirmed web3.js?
I am new to web3. I am trying to connect UI with web3. Metamask version is 6.0.1 and web3 version injected by (don't know who), but it is 0.20.3.
Following is my code to send ethers to a function of ...
0
votes
1
answer
83
views
Is there Uniswap V2/V3 function to get initial token supply amount in pool?
I need to get initial token supply when liquidity pool was created by querying Ethereum node (RPC) or Uniswap contract and not Mint() function, is it possible to do (python)?
To get reserves on any ...
2
votes
3
answers
3k
views
Read Transaction History with ethers v6.1.0
I am trying to create a new wallet similar to Metamask. I have implemented few simple features and now I am looking to display transaction history for a particular wallet address. I have tried ...
1
vote
2
answers
551
views
Get Method ID from all transactions in a block
I ask for your help! How do I get the Method ID for each transaction in a block.
I can get the following information
block = w3.eth.get_block('latest', True)
print(list(block))
['difficulty', '...
0
votes
2
answers
666
views
I can't made web3 subscribe filter work
I'm trying to get a subscription to logs from a "target" address, but I wasn't able to make filters works.
Subscribe method works without filter but I wasn't able to print a result without ...
0
votes
0
answers
29
views
How to send entire account balance to another address on Base
The below code is what I used to transfer entire account balance to other address on the ERC20 network and it works fine on it, but not on Base. Maybe it's because Base has different transaction fee ...
0
votes
0
answers
164
views
Replacement fee too low, Base Sepolia
This is the code I have for sending a transaction on Base Sepolia. I am using this to split the balance in my account into two halves and sending each half to an address one by one.
export async ...
0
votes
1
answer
2k
views
How to send transactions Infura + Web3.js + WalletConnectProvider
I want to initiate transactions using the following stack. However, Infura doesn't support web3.eth.sendTransaction(tx) because it requires the server to hold private keys. Here is a link to how it ...
0
votes
2
answers
88
views
Is it possible to make an atomic transaction using web3.js only?
I am currently working on a project using web3.js that invloves making 2 transactions atomically. Is it possible to pass those 2 transactions in a single transaction object to make it atomic or is the ...
0
votes
1
answer
43
views
Etherscans ABI and transaction receipt topic[0] are different. Bug?
I need simply to get Transfer data values from transaction with 1 log https://etherscan.io/tx/0x6465187a7bb43a6db42ee63e5f5cc30fb094393957a7f1ce6c08b5afddf3e0bc. It sends +7,601.747 LINK.
The problem ...
1
vote
1
answer
196
views
Cannot send USDT on Polygon : Error happened while trying to execute a function inside a smart contract
//token_address is the adress of the contract : 0xc2132D05D31c914a87C6611C10748AEb04B58e8F
//because USDT on polygon is a Proxy contract, minABI is the abi of the contract where it redirect : https://...
1
vote
2
answers
4k
views
How to simulate buy / trade transactions on local without submitting them to blockchain?
I'm learning a little about blockchain and there is something i'm stucked with.
I'm working with pairs from BSC network, and I'd like to get some information if the token can be bought and sold before ...
0
votes
0
answers
64
views
Etherscan API doesn't return internal transaction (although it has)
Here is transaction https://etherscan.io/tx/0x33e0dab83aa27ba8b2a08b3c69d61a34911a4adb6e7a35dd30cf11383f43fcc3 with simple Transfer() some GALA tokens.
Etherscan shows 1 internal transaction:
But it'...
0
votes
1
answer
67
views
Why Etherscan's API missing ABI functions?
Here is transaction https://etherscan.io/tx/0x0db6f8036ca7ea58bf4a8799bbf62bb30e3431d644d37d4030c27ac0d22f7542#eventlog
In logs we can see 3rd function SendToInjectiveEvent(). It is interaction with ...
60
votes
6
answers
126k
views
error: replacement transaction underpriced
Im trying to send a raw transaction using web3 to ropsten testnet and Im getting this error:
replacement transaction underpriced
where sometimes my tx works and sometimes I get this error.
my tx ...
2
votes
1
answer
1k
views
How to get transaction failed reason with ethers.js
Using ethers' waitForTransaction(), getTransactionReceipt() or getTransaction() I can ask for transaction status,
but I need to know the cause of error (as this question: How to get transaction failed ...