We changed our privacy policy. Read more.

Questions tagged [nodejs]

Node.js is a platform built on Chrome's JavaScript runtime for easily building fast and scalable network applications.

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

MetaMask - Internal JSON-RPC error

i was developing a full stack nft marketplace, where i can mint nfts but when i try to buy it gives me this error :MetaMask - Internal JSON-RPC error code: 3, message: "execution reverted: Please ...
0
votes
2answers
8 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 ...
1
vote
0answers
14 views

Why does web3 say the transaction hasn't been mined in 750 seconds when the blockchain transaction says it was mined in 1:30 seconds

We keep getting an error from our node application with the following error: Transaction was not mined within 750 seconds, please make sure your transaction was properly sent. Be aware that it might ...
0
votes
0answers
5 views

How to take input in remix for 2D array in solidity?

My Contract code contract SomeTokenVesting { mapping(address => uint256[6]) public vestingAmounts; constructor() { // some code } function addSomeBeneficiaries(address[] ...
0
votes
0answers
8 views

Web3js Module Not Found

I'm using latest version of node, latest version of web3js. I'm pretty new to this and trying to test out some web3 stuff. I'm trying to use the getPendingTransactions as mentioned on the web3js ...
0
votes
0answers
7 views

Can you call a variable value with web3.js, without writing the function in solidity?

I have used remix and I can see that whenever I create a public variable, it also creates a function for the variable and when you press it, it shows the variable value but, when I want to call a ...
0
votes
0answers
15 views

Solidity ABI decode equivalent in web3js

This is the Solidity code from this oracle contract: function transmit(bytes calldata _report, ...) external { ... (r.rawReportContext, rawObservers, r.observations) = abi.decode( ...
0
votes
0answers
29 views

Deposit tokens to pool -> transaction reverted by the EVM

I`m trying to deposit funds from my wallet into a pool using the following Node.JS code. require('dotenv').config() const Web3 = require('web3') //WEB3 Config const web3 = new Web3(process.env....
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
0answers
5 views

predefined error in web3js like poocoin

Sometimes I need to check the error before sendSignedTransaction, like poocoin, they has predefined error before transaction send, how to make that with web3js?
0
votes
0answers
7 views

Error: Network not synced; last block was 1630630627.508 seconds ago

I checked eth.syncing in the console and it says false which should mean the blockchain is synced, but in my node script I get an error that blockchain is not done syncing: const fs = require('fs'); ...
0
votes
1answer
18 views

Is there a way to specific the block when buy BEP20 token?

To avoid bot, some of fairlaunch and dev make a 99% tax in 2 first block buying after liquidity, it called antibot system. https://bscscan.com/tx/...
0
votes
0answers
22 views

How to check if an address is included in a mapping of address' key from Web3?

I would like to check if a specific address is included in an address key mapping from web3? Here is my Solidity Smart Contract: pragma solidity >=0.4.21 <0.7.0; contract Election { //...
0
votes
0answers
15 views

What is the primary cause of error ECONREFUSED?

I have written a few small scripts using Node and Ethers to do simple buy and sell transactions through the PCS router and have had success when I write the code however, I am just learning and i have ...
0
votes
2answers
44 views

Signing transaction on frontend and sending on backend server

Hi I'm making an NFT auction site similar to OpenSea to learn blockchain technology. But I have some security concerns about sending transactions on the frontend of my application because if a user ...
0
votes
0answers
37 views

Insufficient funds for intrinsic transaction "response" "jsonrpc 2.0 method=sendTransaction

I have a problem, when i try to buy a token with my sniper bot have this error. I have > funds of gas require. this is my script (i use BNB) const ethers = require('ethers'); const prompt = ...
0
votes
0answers
14 views

Best practice for Single or Multiple instances of Provider for different types of block chain requests #

What the best practice is in terms of using the ethers provider as either a singleton (or persistent instance) in a module or to create a new instance every time a request is made. For example, for a ...
0
votes
1answer
72 views

Transaction reverted during swapExactTokensForTokens (UniswapV2Router02, web3.js)

I am attempting to swap ETH for DAI using the Uniswap Router, but am facing a problem where the transaction gets reverted, along with the following message: Transaction has been reverted by the EVM. I ...
0
votes
1answer
37 views

Setting the value of AmountOutIn

I have been running this small script to buy through the PCS router contract and as it works, the slippage is set to 0. I need to know how to find the value and what it expects so that i can set ...
0
votes
0answers
18 views

Must I have metamask installed in order to use Web3js

I forked the GitHub repository https://github.com/dappuniversity/price-bot and made some edits to the code. I used my laptop and ran the code using by typing the command npm run start in my terminal ...
1
vote
0answers
15 views

How to decode estimateGas Error

i'm having a problem with estimateGas function. var method = contract.methods.doSomething(); var estimateGas = await method.estimateGas({ from: address, to: toAddress, }).then(...
0
votes
1answer
17 views

Charge ecr20 token for network fee instead of eth [duplicate]

Is it possible to subtract the network fee from the user's ERC token instead of subtracting from the eth balance using web3js
0
votes
0answers
12 views

I am trying to deploy on Polygon network using truffle suite however during migration I am getting error!

Error message: truffle migrate --network matic --reset Compiling your contracts... =========================== / Fetching solc version list from solc-bin. Attempt #1 C:\Users\aryan\Documents\GitHub\...
0
votes
0answers
35 views

How do I get the token symbol, token name, and size of liquidity pool for a newly minted pair using Node.js and Web3?

//original code courtesy of EatTheBlocks factory.on('PairCreated', async (token0, token1, pairAddress) => { console.log(` New pair detected on PancakeSwap ================= ...
0
votes
1answer
196 views

How can I get the token symbol from the token contract address using Node.js?

PLEASE DO NOT HELP ME BY SUGGESTING PYTHON CODE. I'M ONLY INTERESTED IN SOLUTIONS THAT RELY EXCLUSIVELY ON NODE.JS. I am trying to build out a sniping bot in Node.js using a snippet from EatTheBlocks ...
1
vote
0answers
89 views

[ Web3.js on BSC ]: Returned error: unknown account

Here's the error: index.js:1 Error: Returned error: unknown account I'm getting this error while running this method: nftMintingContract.methods.mint(account, cid).send({from: account}) The ...
0
votes
1answer
28 views

The contract code couldn't be stored, please check your gas limit

I tried to deploy my contracts but every time I get this error. The first two contracts were deployed successfully, but the third contract, "PostFactory.sol" is facing this issue in loops. I ...
0
votes
1answer
13 views

index within block

is it possible to choose which index you want to aim for when sending a transaction? Lets say there are 100 transactions all with 5 gwei, if i want to be on index 25, would it be possible to send the ...
0
votes
0answers
95 views

MetaMask - RPC Error: Error: [ethjs-query] while formatting outputs from RPC

I am very new to Ethereum smart contract solidity programming. Currently, I have been facing this issue when I try to pass a variable from my Node.js servlet to the smart contract I deployed using ...
0
votes
0answers
13 views

Send different signed transactions in a batch?

I have signed transactions and want to make a batch request with all the different signed transactions. How can i achieve that?
0
votes
1answer
105 views

How to set private key for Ethers Signer

I would like to invoke a smart contract function using Ethers library. Since I have my own node I'm connecting using RPC connection and now I would like to invoke a transfer function (of an ERC20 ...
1
vote
2answers
185 views

Using solc to compile contract that imports local OpenZeppelin contracts

I am trying to compile and deploy a contract based on OpenZeppelin using Node.js app.get("/", (req, res) => { const input = fs.readFileSync("./BaseContract.sol", "utf8&...
0
votes
0answers
69 views

Connecting Metamask with Web3

I am relatively new to Solidity, Node.js, and Web3, and I am trying to create a simple betting platform that runs on the Ethereum blockchain. I have been digging around the internet for proper ...
0
votes
0answers
28 views

Truffle Compile Fails with Error " Expected pragma, import directive or contract/interface/library/struct/enum/constant/function definition"

When running truffle compile in the root directory of my project I get the following error: ParserError: Expected pragma, import directive or contract/interface/library/struct/enum/constant/function ...
0
votes
1answer
278 views

How to connect ethers.js with MetaMAsk and other Wallets?

const provider = new ethers.providers.Web3Provider(window.ethereum) while using this i am getting window is not defined error..and i dont know how to use it. Do anyone has idea how to do it
0
votes
0answers
13 views

Getting correct decimals in ethers.io library, using getAmountsOut() ABI

I am using the getAmountsOut() interface to get the current PancakeSwap price of a random BSC token that has 9 decimals in its smart contract, see https://bscscan.com/token/...
0
votes
0answers
53 views

web3js is not executing contract functions

I am trying to call the following simple function from web3.js but none of the function is being executed as I find no transaction entry in ganache. pragma solidity ^0.5.11; contract FirstContract { ...
1
vote
0answers
20 views

How to know the number of transactions sent to an address?

Ethereum assign random nonces to contract transacctions? I am trying to send my transacctions with web3js assigning a correlative nonce. I read the last nonce and increment it in one to send the tranx....
1
vote
0answers
22 views

How to query DyDx liquidations from ethereum blockchain?

As far as I understand, all the exchanges like DyDx, Uniswap, Sushiswap etc. are actually contracts deployed on blockchain. So their data should be accessible to anyone having the chain downloaded. (...
0
votes
0answers
15 views

web3js + nodejs: calls to methods.deposit() creates a transaction that is pending forever

I'm trying to make simple calls to a contract in order to harvest the acccumulated yield. To to that I'm performing this call: const h = await polycatFarm.methods.deposit(25, 0, walletAddress).send({ ...
2
votes
1answer
52 views

Get all ERC-20 token balances of address

What is the best way to get all the token balances of an address? I Monitor the while blockchain and got Like 6k token contracts Stored. IS there any way to get all token balances of an address ...
0
votes
0answers
17 views

I have a question/error 'invalid address' with javascript using web3 & ERC20 token

What I have working: connect to metamask, check wallet for balance, check if VIP But bulkSendCoinWithSameValue produces the error 'Uncaught (in promise) Error: invalid address' I am late to learning ...
0
votes
0answers
21 views

JSON Parse API response ends in unexpected token " " at position

Whenever I fetch the getContractABI Endpoint of etherscan and try to parse the response.data to JSON I get the error of unexpected tokens. exports.getContractABI = async (contractaddress) => { ...
0
votes
1answer
211 views

Retrieving the private/ public key with web3js for a specific wallet provided by truffle/hdwallet-provider

I can't find a way to retrieve the private key / public key / public address for a web3 account loaded via a provider. I have tried the web3.eth.accounts command but I am not getting the private key / ...
0
votes
0answers
14 views

Chainlink Initiators - Failed testing subscriber: unexpected end of JSON input

I am trying to customize Chainlink External Initiators, since the blockchain is fork of Ethereum. I am simulating the eth.go and created my own version. After updating the program, triggered the ...
0
votes
0answers
15 views

Truffle Test error, and problems with npm

this isn't so much a truffle question, but more of a dependency and npm question. whenever I try to test this smart contract, my terminal keeps telling me that there is an error with my babel config. ...
1
vote
0answers
181 views

How to get method name from transaction history (since the beginning and news in realtime)

My job is to get all the method name from the token contract transactions from the beginning and to display the new transactions in realtime. 1) Get all events For the moment I can display the "...
0
votes
0answers
600 views

calculate automatic slippage for pancakeswap exchange like Poocoin.app does

I am trying to automate swap on pancakeswap but for some tokens manual slippage percent doesn't help and it fails. I need to set slippage automatically every time based on token requirement. In ...
0
votes
2answers
2k views

How to convert bignumber to normal number using ethers.js?

I am using ethers.js I can't figure out how do you convert a bignumber like 1252500000000000000 to 125.25 -Mike
0
votes
1answer
41 views

quorum "gas price not 0" and "intrincis gas too low"

iam running quorum blockchain this my code if I put gasPrice as 0 the error it is showing "intrinsic gas too low" if I put gas Price higher the error it is showing "gas price not ...

1
2 3 4 5
13