Skip to main content
Share Your Experience: Take the 2024 Developer Survey

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
0 answers
7 views

How to fetch the current price of GM token from GMX?

I would like to fetch the current prices of GM tokens from GMX V2 via Node.js. I have found the following info in here (https://gmx-docs.io/docs/api/contracts-v2/#getting-gm-token-price): Getting GM ...
Timofey Kupriyanov's user avatar
0 votes
0 answers
10 views

How to fetch the transaction amount from Arbiscan using Node.js

I am facing challenges when I try to fetch the transaction amount from Arbiscan (using Arbiscan API). I want to fetch the transaction amount of my latest transaction using Node.js. The following ...
Timofey Kupriyanov's user avatar
0 votes
1 answer
14 views

Hardhat, problem with uninstalled dependencies

I can compile my contracts successfully. I had some problems with some of the hardhat functions so i installed Waffle and its dependencies. However it doesn't work and throws an error stating missing ...
אליה שלמה's user avatar
0 votes
2 answers
29 views

JsonRpcProvider not Found in ethers.js

I'm building a JavaScript application where I'm trying to interact with the Ethereum blockchain using ethers.js. However, I'm encountering an error stating that JsonRpcProvider is not found. This ...
Kuldeep Sonara's user avatar
0 votes
1 answer
29 views

Set RPS with ethers.js

I wrote a code to check the pending transactions of a contract, but I would like to limit the RPS (requests per second) to 25 (I'm using a node with user free) how could I do it? Here is the code: ...
Loner's user avatar
  • 1
0 votes
0 answers
23 views

How to implement waiting for transaction validaton?

I'm running a bot that is making a series of smart contract calls on Avalanche c-chain from one account. I'm checking for transaction validation by waiting for a nonce increase with export async ...
kuco 23's user avatar
  • 278
0 votes
1 answer
42 views

I get this error when i try calling the getBalance function in node.js

eth_chainId eth_accounts eth_call WARNING: Calling an account which is not a contract From: 0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266 To: 0x5fbdb2315678afecb367f032d93f642f64180aa3 this is ...
Thato Bopape's user avatar
1 vote
1 answer
21 views

Getting method hardhat_impersonateAccount not supported when impersonating a WETH whale account on Arbitrum

Attempting to impersonate a WETH whale account on arbitrum and getting: ProviderError: method hardhat_impersonateAccount not supported The code is being run from a script using the following command ...
Ian Forsyth 's user avatar
0 votes
0 answers
16 views

Ethers giving Error: missing revert data in call exception for some pairs

I'm trying to get quote prices for pairs. Most of them end up being successful, but some number of them raise an error in code Error: missing revert data in call exception; What can be done about it? ...
Tester Tester's user avatar
0 votes
2 answers
26 views

storing login credentials, mySQL or IPFS

hi im very new to developing, total newbie here and im on my final year project on blockchain development. i want to ask if for creating a login session we must store the credentials (username & ...
rokuroxx's user avatar
0 votes
0 answers
10 views

How to save the values on smart contract by triggering the functions without using private key on Node js?

How do I save the values on a smart contract by triggering the functions without using a private key on Node.js? Only i have the contract address With only contract address, how can i save the values ...
AIT DEV's user avatar
  • 15
0 votes
1 answer
27 views

Fetch special position in JSON FORMAT

Hellp every body hope all are good today ? I need some help please ... This is my JSON with const = result : [ { asset: 'USDT', free: '35.00', locked: '0' }, { asset: 'USDC', free: '80.99', locked: ...
forexmp45's user avatar
0 votes
0 answers
12 views

Why does this error occur? Error when sending a transaction: cannot estimate gas; transaction may fail or may require manual gas limit?

There is enough balance, the network is also working correctly, the keys are also correct, the gas has been increased, but the error remains. const ethers = require("ethers"); const ...
web developer's user avatar
0 votes
0 answers
27 views

Can anyone figure out how this guy does arbitrage?

The owner of this tx record is constantly arbitraging for small amounts. It does these directly via pair. So it's not using a router. In my own testing I have always found that the amount of output is ...
Jack Suelman's user avatar
1 vote
1 answer
39 views

I'm having trouble sending token1 to a pair address and receiving token0

I am trying to make a swap directly via the pair address without a router. I'm trying to get token0 by sending token1. The amount of token0 I will receive does not matter, but when I run the node.js ...
Jack Suelman's user avatar
0 votes
0 answers
18 views

Can we send tokens to BSC pair address and receive tokens in return?

We're almost at war with ChatGPT :) For example, when we send 1 busd to a pair address, such as BUSD/WBNB, won't the pair address directly give us WBNB in return? Chatgpt says it gives one, it doesn't ...
Jack Suelman's user avatar
2 votes
1 answer
263 views

How to buy with ethers js using Uniswap Universal router on Base? calling execute function

I want to buy new tokens launched on base using Uniswap Universal router on Base with node js and ether js libraries. Im calling execute function but I'm having many problems. Here is the code: //...
Oriok's user avatar
  • 21
1 vote
1 answer
481 views

SyntaxError: Cannot convert 0.0 to a BigInt

What, is this? SyntaxError: Cannot convert 0.0 to a BigInt JS being JS. What else should we expect from the creators of NaN === NaN; // -> false ? This is one of the worst error reasons I've ...
carlosN's user avatar
  • 11
0 votes
0 answers
57 views

I get an error when there is another tx record related to the target token in the same block

I create a smart contract and interact with node.js and buy and sell a token. Here is part of my smart contract: // TokenBuy Function -> function buyToken(address token, uint amountOutMin, uint ...
Jack Suelman's user avatar
0 votes
1 answer
76 views

Differentiate a swap and normal transfer on erc-20 token transaction

Hey i’ve been following this guild (https://stackoverflow.com/questions/67998154/how-to-calculate-the-total-volume-transacted-for-a-token-on-rsk) in the ✔️ answer section to calculate the volume for ...
irregular's user avatar
0 votes
1 answer
57 views

Why is contract deploying, but giving an error on console

So I'm using ganache client and deploying the contract. I can see the contract on ganache and also the transaction. But on the console I'm getting following error: ... code: 'UNKNOWN_ERROR', ...
MySti's user avatar
  • 1
0 votes
0 answers
71 views

How to ABI encode a contract function using ethers

The following function sends a transaction using ethers. Running this gives the error TypeError: func.format is not a function. What am I doing wrong? import { Contract, getDefaultProvider, AbiCoder, ...
Pål Thingbø's user avatar
0 votes
1 answer
42 views

Find ERC20/Polygon address with the beginning and end

I found this post: Find the address of the wallet know almost all the letters I'm looking for a code to find an address on Polygon with a beginning and the end. I have this information: 0x858b...4B7d. ...
Naografix's user avatar
  • 181
1 vote
1 answer
26 views

unable to get trade data using @sushiswap/core-sdk

I am trying to get trade information based on user provided information, but code is failing at building Trade. here is code const sellAssetValue = { decimal: 18, symbol: 'ETH', } const ...
Faizan Ul Haq's user avatar
0 votes
0 answers
102 views

Timeout Error: eth_callBundle . Flashbot

Hi I am having an issue in flashbotsProvider.simulate() while pushing a transaction to the miners to be send to the block without sending it to the mempool. Below is my source code // 1. Import ...
hammad ali's user avatar
0 votes
1 answer
74 views

Error "could not detect network" when using WebSocket provider with Alchemy

I have a file with over 1 million+ ethereum addresses and private keys grouped together in a single file separated only using a ','. Example: 0x7256bCf73C2309893AA12d6b26A142AB3097560c,...
Nikhil Meena's user avatar
0 votes
0 answers
61 views

Getting error when connecting my ether js websocket provider to local node web socket server

So I am building my backend to listen for events. So I used the websocket provider of ether js to listen. Since it requires a websocket server url so I built my local websocket server. But I am ...
Arnab Chatterjee's user avatar
0 votes
1 answer
28 views

Eth price dont update after another function iteration

Hi i have an issue i created a function that fetches prices from dex.This is looped every 5 sec and the prices should be up to date every 5 sec.The issues start because the price refreshes every few ...
Xardesso's user avatar
0 votes
0 answers
28 views

Javascript FundMe Solidity Test code troubleshooting

Code 1 returns error while Code 2 doesn't, why? CODE 1 const { assert, expect } = require("chai") const { ethers } = require("hardhat") describe("FundMe", function () { ...
Samuel Aniss's user avatar
0 votes
2 answers
167 views

How to Import OpenZeppelin Contracts with Node.js Environment

I'm having an issue. I'm attempting to compile my contract with Node.js inside of a VSCode terminal, but my openzeppelin imports aren't being seen, and I'm not sure how to handle them with Node.js. ...
user185543's user avatar
0 votes
0 answers
138 views

How to swap tonkens in pancakeSwap using nodeJS

I need to write a script to swap tokens in PancakeSwap using NodeJS. I'm new to web3 development, so maybe I'm misunderstanding some of what I'm seeing in the various docs. I know PancakeSwap doesn't ...
Oleh's user avatar
  • 1
0 votes
0 answers
16 views

How to make many transactions in one transaction to pay less gas

Web3.js Good afternoon, can you please tell me how I can make several transactions from different wallets to one wallet? We have conditionally realized system of deposit and main wallet. When the ...
Meliodas's user avatar
0 votes
0 answers
59 views

InvalidResponseError: Returned error: The method eth_sendTransaction does not exist/is not available

I'm trying to interact with a smart contract on BSCtest using web3. I think the error occurs in this line rs = await TokenContract.methods.transfer(receiverAddress, 100000).send({ from: myAddress, ...
Ngọc Minh Nguyễn's user avatar
0 votes
2 answers
38 views

Js result into HTML

Hello hope everybody is good ? I need some help please .. I run my JS file and it return in my console with await function = 56 How can i parse the return (56) into my HTML in a <div ? This is my ...
forexmp45's user avatar
0 votes
1 answer
690 views

Error with npm run start. code: 'MODULE_NOT_FOUND',

npm run start > [email protected] start > react-scripts --openssl-legacy-provider start node:internal/modules/cjs/loader:1051 throw err; ^ Error: Cannot find module './nodes' Require ...
imbot's user avatar
  • 11
0 votes
1 answer
112 views

How to get rid of the gas estimation error in ethers.js

const fs = require("fs-extra"); const { ethers, JsonRpcProvider } = require("ethers"); async function main() { const provider = new ethers.providers.JsonRpcProvider( "...
Mahami's user avatar
  • 1
0 votes
2 answers
27 views

Trying to deploy simple smart contract in a local nodejs, mocha environment but receiving error from: 'npm run test'

I am trying to deploy a simple smart contract for testing. Attached are the output of: 'npm run test' as well as my test.js file and my package.json file I hope its something obvious sorry if this is ...
bakayaro's user avatar
0 votes
0 answers
12 views

web3 module takes nearly 500ms to load

I noticed my web3 scripts are very slow and after doing some testing I noticed that the web3 module takes 470ms alone to load. Other modules only take 1 ms. Is this normal? I have the latest version ...
wbinky's user avatar
  • 1
0 votes
1 answer
33 views

Problems installing hardhat using npm and node

I really need to be able to use hardhat on vscode and I am having so many problems trying to use node and npm. Does anyone know how to solve these errors? I know node and npm are installed because I ...
auditor_chick's user avatar
0 votes
1 answer
122 views

ethers SERVER_ERROR that cannot be catched with try/catch

I am facing strange server error while trying to send eth transaction. It happens not every time and I cannot catch it with try/catch. Is there any known issue? /root/app/node_modules/ethers-new/src....
gabbi's user avatar
  • 1
0 votes
1 answer
81 views

Ethers.js recovers wrong address when signing its transactions with elliptic.js

Can someone show me how to correctly sign an ether's unsigned transaction hash using elliptic npm package. Below is my attempt (with some random private key) and transaction should ideally fail with &...
kuco 23's user avatar
  • 278
0 votes
1 answer
395 views

Is there any way to send a raw signed transaction via ethers?

I want to send a signed transaction with ethers through a provider, but the sendTransaction method does not exist anywhere besides the Wallet object. I basically want to do something like this: ...
kuco 23's user avatar
  • 278
0 votes
0 answers
104 views

Uniswap 'interface' cannot resolve 'fs' polyfill

I've just installed the uniswap interface project i've run the following: yarn yarn postinstall yarn graphql yarn contracts yarn ajv yarn i18n When I got to yarn start, I'm receiving the following ...
Ritzy Dev's user avatar
  • 283
1 vote
1 answer
77 views

What causes this error? NFT Minting via Piniata - fails transaction

Every time i submit my form from my frontend, MM opens up so i can pay my fee, i click confirm, the transaction fails with the error: {"blockHash":"...
Aleksander Morawski's user avatar
1 vote
1 answer
21 views

VM Exception while processing transaction: revert while buy token

I built a token based on ERC20, when I try to buy tokens I get this error In the truffle console Quinn.deployed().then(function(ins){token=ins}) QuinnSale.deployed().then(function(ins){tokenSale = ins}...
Mizanur Rahman Sohan's user avatar
0 votes
2 answers
211 views

Get multiple ETH transactions

I'm a little new to Web3, and in NodeJS I'm trying to create a deposit-aware system. Today I'm doing the following: ETH Transactions: Get it through getBlock, and check whether the "to" of ...
Alison Silva's user avatar
1 vote
0 answers
52 views

Why does snarkjs running on Node.js throw an instance of std::bad_alloc?

I'm running snarkjs over Node.js on a linux x64 machine with 256GB RAM and I have a zk-SNARK circuit composed by ~28M constraints. I want to execute the command snarkjs zkey new to generate a zkey ...
Leonardo Vona's user avatar
1 vote
1 answer
67 views

nothing to compile in hardhat(yarn)

I have created a project in VS Code and I'm using Hardhat with Yarn for it. However, when I run the compile command yarn hardhat compile, I encounter an issue where I receive a "nothing to ...
Elyas Sarjoghi's user avatar
0 votes
1 answer
282 views

ECONNREFUSED with Ethers.js and Node.js

const { ethers } = require("./node_modules/ethers/lib"); require("dotenv").config({ path: "./.env" }); const provider = new ethers.providers.WebSocketProvider( ...
Sinners's user avatar
1 vote
1 answer
41 views

Why does deploying programatically through nodejs cost more than deploying through remix?

I've written code to deploy contracts programatically. However when I set the same settings as remix ("gas price, gas limit, etc). The transaction mines but I get the error: Warning! Error ...
learningAsIGo's user avatar

1
2 3 4 5
16