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
6 views

Web3: Trace multiple transactions across multiple chains on NodeJS backend

I am trying to handle multiple chains in a single Node.js backend. When I was dealing with one chain, which is Ethereum, I just made sure my web3 was targeting that chain ID and doing the transfer. ...
0 votes
1 answer
16 views

Uniswap: Get Ticks Ranged within +- of a trade

I'm trying to grab all relavent ticks to a trade using uniswap. I have a function to retreive the ticks. const tradeAmount = CurrencyAmount(WETH_TOKEN, 1000 * 10 ** 18) const poolStateContract = ...
0 votes
0 answers
13 views

Big trouble in function execution order?

Hello every body i have a big big trouble i absolutly don't understand why it don't work correctly I just want launch a function true another example : let mempool = async () => { Buy(); } let Buy ...
0 votes
0 answers
7 views

ecrecover not returning expected public address in a solidity contract

so am trying to access an NFT contract using web3.js to automate the Mint process, and while testing on multiple projects, i came across this project KPR , after checking its a public mint function ...
0 votes
0 answers
30 views

Issues with Alchemy getContractMetadata endpoint

I have created a new ERC-1155 NFT collection for my project but for some reason Alchemy's getContractMetadata endpoint does not recognizes it at all. I'm filtering by contractAddress: ...
0 votes
1 answer
31 views

Error: invalid BigNumber value (argument="value", value=undefined during a exactOutputSingle swap

I'm facing a problem who's driving me crazy I'm trying to create a swap with this code : my_tx = await routerV3.exactOutputSingle({ tokenIn: '0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6', ...
1 vote
2 answers
48 views

Gnosis Safe create safe app template failing

I am trying to run npx create-react-app my-safe-app --template @gnosis.pm/cra-template-safe-app but I am getting this error. I'm just following the instructions at https://github.com/safe-global/...
0 votes
0 answers
20 views

Keep encounterint insufficient funds for intrinsic cost despite sufficient funds

I am doing some work with the pancakeswap predictions smart contract (https://bscscan.com/address/0x0E3A8078EDD2021dadcdE733C6b4a86E51EE8f07#code) and am trying to make a transaction using the betBull ...
0 votes
1 answer
56 views

How to listen to smart contract events using nodejs server?

I am currently trying to 'listen events' emitted from my smart contract. I am able to run my scripts created by using the node command and it works as intended, and I want to host it on a server. I ...
2 votes
1 answer
57 views

How to create a web3.js provider with chainID?

I want to create a web3 provider on a Node.js application with a specific chainID and URL. How can I do it? const chains: Chain[] = await this.chainRepository.find({ relations: ['currencies']...
0 votes
1 answer
20 views

Cannot read property 'Contract' of undefined. Node api can't interact with smart contract

I'm using web3 version 1.8.0 it always shows this error "Uncaught TypeError: Cannot read properties of undefined (reading 'Contract')"
  • 3
0 votes
0 answers
26 views

How to calculate the estimated gas of a smart contract method like MetaMask?

I deployed a smart contract on testnet and used the following method to estimate the gas of a method: web3.eth.getGasPrice((err, gasPrice) => { if (err) { // Error handler } ...
0 votes
0 answers
16 views

How to store Smart Contract events data in mongodb using nodejs

I just want to create a node app which listens to smart contract events and whenever the event is emitted, the data should be stored in my mongodb database.
0 votes
2 answers
68 views

Testing smart contact with hardhat

I try to test my smart contract with hardhat. At first I am forking the polygon mainnet like this: npx hardhat node --fork https://polygon-mainnet.g.alchemy.com/v2/... after this I can run the test ...
  • 11
0 votes
1 answer
18 views

Balancer Flashloan Polygon

I am a beginner in node.js and try to understand this github repo, but I do have a question. I am looking at this file and I try to translate it to node.js and run it on my pc. In this file there is ...
  • 11
0 votes
1 answer
37 views

How to get wallet private key by password using Ethers npm module

I am using 'ethers' for wallet. And I want private key for login to wallet by password. How can I get that.
1 vote
1 answer
67 views

Installing hardhat and git repository get a lot of vulnerabilities. Npm audit fix and npm audit fix --force not working

I git clone this repository: https://github.com/jamesbachini/DEX-Arbitrage After running npm install get a lot of vulnerabilities. Run npm audit fix and npm audit fix --force, but vulnerabilities are ...
  • 27
0 votes
0 answers
27 views

TypeError: ethers.Contract is not a constructor - Trying to wrap an ethers contract but getting an error

i am getting this error trying to wrap a contract using ethers: const wrappedP1Contract = new ethers.Contract(p1address, p1Abi) I am importing ethers from hardhat import ethers from "hardhat&...
1 vote
1 answer
88 views

Optimizing Backend with a lot of Ethers.js Event listeners

I've been building an nft marketplace backend, on top of a manager contract that manages all the permissioned nft collections. The idea is that, manager can create erc721 or erc1155 contracts via this ...
  • 13
0 votes
0 answers
54 views

Web3.eth.subscribe stuck

Try to explain what my problem is, hope someone will help me with that web3.eth.subscribe('newPendingTransactions', (error, result) => { ...do something }) There is .subcribe in web3 (nodejs). ...
0 votes
0 answers
781 views

MetaMask - RPC Error: Internal JSON-RPC error. {code: -32603, message: 'Internal JSON-RPC error.'

This is my first question to community :) I understand the same question has been asked multiple times, but in most of them I either see no solution to this or its not the problem I am facing. I am ...
0 votes
2 answers
74 views

ethers.js swapExactTokensForTokens not happening (no errors)

Been stuck on swapping tokens using ethers js, here's the code I'm using: const https_provider = new ethers.providers.JsonRpcProvider(https_provider_addres) const wallet = new ethers.Wallet....
0 votes
0 answers
10 views

Node js: Error [OpenError]: IO error: /var/task/matic/exceptions/eth/LOCK: Read-only file system

Can someone help me? I am using node.JS 16.17.0 (includes npm 8.15.0). The code is working locally without errors, but not when I deploy it on Cyclic and Vercel. This is the code - const fs = require(&...
0 votes
0 answers
55 views

Got this Error by interacting with my first smart contract: ReferenceError: ethers is not defined

Hello I try to interact with my smart contract which I deployed before. I follow the tutorial und Web3 University but at the last step I get this Error: ReferenceError: ethers is not defined. And even ...
0 votes
1 answer
329 views

Console Goerli not functioning on Truffle - This version of µWS is not compatible with your Node.js build

When i try to run npx truffle console --network goerli to start the console and then migrate my contracts on goerli testnet using truffle, I get the following error. MacBook-Pro sample-nftrender % npx ...
0 votes
1 answer
50 views

How to connect ethereum node through proxy agent using ethers.js?

I am trying to connect an Ethereum node which is outside of my organisation. So that's why I need to use a proxy agent to connect external URLs. I am looking for a way to configure the proxy agent ...
  • 190
1 vote
1 answer
28 views

npm global truffle install error

I just got Node Js and npm yesterday and I'm new to this. When I try to install Truffle I get this error: C:\Users\chris>npm install -g truffle npm WARN deprecated mkdirp-promise@5.0.1: This ...
  • 11
0 votes
0 answers
101 views

NEW Error: cannot estimate gas; transaction may fail or may require manual gas limit

The following error appears Error: cannot estimate gas; transaction may fail or may require manual gas limit (error={"reason":"processing response error","code":"...
2 votes
2 answers
517 views

Error : call revert exception

Error var error = new Error(message); ^ Error: call revert exception [ See: https://links.ethers.org/v5-errors-CALL_EXCEPTION ] (method="retrieve()", data="...
0 votes
0 answers
12 views

Private network load testing script help

I'm trying to write load/stress testing scripts for a private network. However, in doing so I remembered the nonce is going to be an issue for a basic NodeJS automation script. I'd like to send a ...
  • 121
1 vote
2 answers
465 views

Listen for all the events of a smart contract with ethers.js polygon

What I would like to know is if there is a way to continuously listen for a single contract and fetch all the events emitted in real time. What I was able to find right now are ways of listening for ...
  • 13
1 vote
1 answer
64 views

Uncaught (in promise) Error: 'args.method' must be a non-empty string

This is the error I am getting in my console.. I am unable to understand the bug inpage.js:8 Uncaught (in promise) Error: 'args.method' must be a non-empty string. at o (inpage.js:8:31826) at ...
0 votes
0 answers
60 views

Creating a secure web3 tokens deposit mechanism for users using metamask and VanillaJS at the frontend and nodejs in the backend

I am creating a dummy crypto exchange for the practice where users sign up, sign in, trade assets and etc just like a regular exchange. When the user deposits the funds using metamask I store all of ...
1 vote
1 answer
35 views

Why don't I have "Create a basic sample project" in HardHat?

The situation is like this. I watched the tutorial and it came to "Deploy Smart Contract". I create a folder and open it in Visual studio. I activate the command "npm i -D hardhat" ...
  • 11
0 votes
2 answers
82 views

Integrate smart contract on backend (without metamask and wallet signing transaction)

i have a working dapp on frontend sending transactions and signing them through connected wallet (metamask). I want to transfert this logic of sending transactions to my backend (nodejs). so there ...
  • 101
0 votes
2 answers
125 views

Error HH8: There's one or more errors in your config file

MY hardhat.config.js require("@nomicfoundation/hardhat-toolbox"); require("dotenv").config(); require("@nomiclabs/hardhat-etherscan"); const Goerli_RPC_URL = process.env....
0 votes
0 answers
16 views

Multiple transactions

I there a possible way to perform multiple transactions, using any 0x services. example: token before after eth 10$ 20$ usdt 20$ 10$ btc 20$ 50$ ...
0 votes
0 answers
24 views

unable to create a raw transaction

This is my deploy.js file where i created a raw transaction but when deployed on ganache the new block was created but there was not any console.log() in the terminal pls help me up with const ethers =...
0 votes
1 answer
62 views

How to use Moralis Plugins in NodeJS?

I'm currently using Moralis version 2.0.1 and await Moralis.initPlugins(); doesn't seem to work on my end. I logged the Moralis package and I found this: default: { Core: MoralisCore { ...
0 votes
0 answers
10 views

How to decrease computation time of generating addresses

I tried to create a mass wallet generator for a vanity address but it only checks 33 wallets a second. Is there any optimizations or bad practices you see? const cluster = require("node:cluster&...
1 vote
2 answers
80 views

Can I know in real time when ether is coming into my account from Ethereum?

I would like to create a feature in my Dapp(nodejs) that notifies me when ether is coming into my account in real time. For example, is there a way to use websockets or APIs? Can anyone give me some ...
  • 153
0 votes
1 answer
22 views

Calling multiple contract methods in nodejs returns error

I'm developing a crypto bot with node and ethers. Had faced a lot of erros but was able to overcome till this one. I'm not a huge experienced dev and don't feel confortable with this architeture yet ...
1 vote
1 answer
130 views

web3.eth - getBlock FetchError: request to https://eth-mainnet.g.alchemy.io/v2/api_key failed, reason: getaddrinfo ENOTFOUND eth-mainnet.g.alchemy.io

I'm trying to get Eth blocks by blockNum using Alchemy's apis. The docs mention two methods: getBlockByHash and getBlockByNum, but those methods don't exist on the web3.eth object. Here are the ...
1 vote
1 answer
204 views

Why are all ethersjs & web3js calls to BSC network failing?

All calls using "wss://bsc-ws-node.nariox.org:443" and other RPC/WSS endpoints have been failing throughout this week. It just hangs and doesn’t return anything. This is happening in BSC ...
  • 13
0 votes
0 answers
119 views

Get pending transaction in Golang?

I know how to get pending transaction, from Mempool that is, in JS/NodeJs. I want to do the same thing in Golang, though. How to do it? I haven't found any example.
  • 45
0 votes
2 answers
80 views

tried running the contract but always getting the same error

//SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.9; import "opezeppilines/openzeppelin-contracts-master/contracts/token/ERC20/ERC20.sol"; contract currency is ERC20 { ...
0 votes
1 answer
29 views

Send token from owner account from backend (Custom ERC20 token)

I made a smart contract for token on the Polygon network. The server part is NodeJS. Now I'm trying to implement the functionality of sending tokens to the recipient's wallet from the token creator's ...
0 votes
1 answer
47 views

How to extend functionality of geth (module, addon)?

Is there a way to extend functionality of geth using some sort of plugins, modules or addons? However, I haven't found any information about the topic. How to do it?
0 votes
1 answer
137 views

I am getting this error everytime i test my contract using hardhat

This is the error i am getting while testing my contract with hardhat pls help me to get this PS E:\vs code files> npx hardhat test npm WARN config global `--global`, `--local` are deprecated. Use `...
0 votes
0 answers
30 views

Attempting to deploy to ganache CLI says out of gas for test account

I am trying to deploy an Ethereum contract to a test network - the ganache CLI - but I am getting the following error: VM Exception while processing transaction: out of gas however when I call the ...

1
2 3 4 5
15