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

Unknown error when running the project

I am deploying my application put an error keeps stops the initialization, I have tried some solutions but none has worked link to repo for codes - https://github.com/Demiladekusa/Evoting-dapp this ...
0 votes
0 answers
13 views

How to run node js file in next js to store emited events into the database?

I want to create node js file in my next js project which is listening for emitted events from my solidity contract and and store it into my mongo db database. How can I run this node js file ...
  • 43
0 votes
1 answer
26 views

Hardhat node doesn't work on typescript

Lets say I have a 00-mocks.ts file inside a deploy folder(hardhat project) and the code looks ok: const { ethers, newtwork } = require('hardhat') module.exports = async function () { try { ...
  • 290
0 votes
0 answers
16 views

Call a Smart contract function using ethers.js. Trying to request the ABI of the contract with etherscan api and call its method

I'm trying to call mint function using ABI of my test smart contract on goerli - ([https://goerli.etherscan.io/address/0x636c6090348b03a46d73ecc40f005e43662f515d#code]) . I'm sending request using ...
0 votes
1 answer
25 views

Error on WebSocket connection

i want to retrive data from this websocket api, where is my code import { WebSocketServer } from 'ws' let socket = new WebSocketServer('wss://ws.blockchain.info/inv'); socket.on('error', console....
  • 1
0 votes
1 answer
11 views

Uniswap API - getAmountsIn function returning incorrect result

I'm quite a rookie in using the uniswap API. What I have is the following. Let's say I want to know how much WETH I need to 100 dydx tokens amountOut = BigInt(100).toString() let result = await ...
0 votes
0 answers
14 views

how to get results from an event

Let's say I have this smart contract code // SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.7; import "@openzeppelin/contracts@4.4.2/token/ERC721/ERC721.sol"; import "@...
  • 1
0 votes
0 answers
28 views

Run express api with hardhat and ethersJS

I am trying to call the ethers js functions which in turn call my smart contract using an express API. I created the APIs but I'm unable to run the server and get the response for the API request. I ...
0 votes
1 answer
28 views

const provider= new ethers.provider.JsonRpcProvider('https://goerli.infura.io/ws/v3/48e3dcb8dcc3420fa8c765b7c04a75f8'); TypeError:

const provider= new ethers.provider.JsonRpcProvider('https://goerli.infura.io/ws/v3/48e3dcb8dcc3420fa8c765b7c04a75f8'); ^ TypeError: Cannot read properties of undefined (reading 'JsonRpcProvider') I ...
0 votes
1 answer
26 views

web3 and some math

There is a transaction that is in pending. In which the user gives 0.02 WBNB (2000000000000000000) to get at least 35460 TM (35460000000000000000000). If he gets less than that the transaction will be ...
user avatar
0 votes
0 answers
24 views

Error: Returned error: execution reverted / Uniswap Js Bot

I want to work with the price-bot by DAPP University, here is the github repo: https://github.com/dappuniversity/price-bot When I run index.js the following error occures: Error: Returned error: ...
2 votes
1 answer
15 views

Getting error while reading the contract data using signer "TypeError: checkProvider(...).call is not a function"

I am creating an instance of singer by passing the pvkey and provider, but after creating the instance of the contract i am not able to interact with it. const signer = new ethers.Wallet(pvKey,apiKey)...
  • 294
1 vote
1 answer
27 views

BSC: CONNECTION ERROR: Couldn't connect to node

I use this tutorial for run BSC node: https://docs.bnbchain.org/docs/beaconchain/light-client But with web3 I get error: Uncaught (in promise) Error: CONNECTION ERROR: Couldn't connect to node My ...
0 votes
1 answer
14 views

asking funding while installing solc?

asking for funding while installing solc cant we insatll by skiping it npm install -g solc changed 9 packages in 9s 1 package is looking for funding run npm fund for details
0 votes
0 answers
13 views

Unable to get the logs when deploying the deploy.js file

my 01_deploy.js const {networks} = require("../hardhat.config") const {developmentchains} = require("../helper-hardhat.config") module.exports = async function ({getNamedAccounts,...
0 votes
1 answer
38 views

How to Get All NFTs Owned by an Address on my custom blockchain

on mumbai lets say, i can use the alchemy sdk, where i input the network name and then call the functions easilly, however if the network is testnetwork with a chain id of 1234 and public RPC of : &...
0 votes
1 answer
23 views

Please help me with this events error with HttpProvider

I have encountered this error while trying to put my oracle online. Please, help!
0 votes
3 answers
38 views

Next Halving BlockChain BlockNumber?

Hello every hope all are good ? I'm asking where can you get the block halving number from a BlockChain ? Is there a way in web3 ? Can i find it in WhitePaper for each BlockChain ? Need i check block ...
0 votes
0 answers
33 views

New Set function doesn't work, ethers js Listening to the event for the contract and displaying from depending on the earlier one

I have a problem with the code that listens to a given contract then depending on whether it was in the same block wants to display the event or not. Unfortunately it does not work and all ...
  • 1
1 vote
1 answer
93 views

Ethers How to get token address from uniswap transaction data

I am creating a nodejs script using Ethers that is broadcasting new transactions. I can not find out how to get information about token address. transaction.data is encoded. I am enclosing the below ...
  • 133
1 vote
1 answer
1k views

EthersJS Listening to events with NodeJS Strange Errors

I am trying to listen to blockchain events using ethers on NodeJS. I've looked around for few tutorials and copied the code from one of them. Currently the code i have is: const ethers = require("...
  • 343
1 vote
1 answer
46 views

getting an error in ethers.js deploy script

My code is const path = require("path") const { ethers } = require("@nomiclabs/hardhat-ethers") const fs = require("fs") require("dotenv").config() module....
  • 95
0 votes
1 answer
26 views

i cant run my Deploy.js

So i currently learn to become web3 developer. so i follow tutorial from yt and i got stuck. I try to run Deploy.js using command PRIVATE_KEY_PASSWORD = password node Deploy.js. i am using windows 10. ...
  • 1
2 votes
1 answer
42 views

process.env.key is showing the actual api key in source code

In my js file I am using: const apikey = process.env.REACT_APP_API_KEY; In the .env file I have: REACT_APP_API_KEY = 123456789 Everything is working fine BUT, when I start (npm run start) and then go ...
  • 21
0 votes
2 answers
73 views

Can I connect an address and sign a transaction from nodejs without a browser in Wagmi core

I'm building a nestjs backend and I want to execute a write transaction to the contract as the contract owner, I couldn't find anyway to connect my address and sign the transaction programmatically to ...
  • 103
0 votes
1 answer
51 views

the method eth_blockNumber does not exist/is not available

Hello hope are good ? I have my own full node with a ssh tunnel My code is : async function test (){ const url = 'ws://localhost:8546'; const web3 = new Web3(new Web3.providers.WebsocketProvider(...
0 votes
2 answers
68 views

Error: connection not open on send() when trying to connect NodeJs to my Private Geth Node

hope all are good ? I have a pb with my FULL NODE i can't connect it with my nodeJs files I can use my node if file's url is localhost:8546, i'm able to run my script from my server only but i want ...
0 votes
0 answers
12 views

How do I retrieve the account balances for proof of solvency?

I read Vitalik’s article “Having a safe CEX” and got curious about builting my own proof of solvency program. I understand how the merkle sum tree works in theory but I am having issues understanding ...
0 votes
0 answers
33 views

Getting this error on deploy "Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'context')"

I'm getting this error Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'context') When i deploy my next js Dapp on localhost it's running perfectly! And i really don't ...
1 vote
0 answers
20 views

Problem running ethernaut hacks locally

link here is the link of the video which I was watching for running ethernaut locally. At 5 min when running the command yarn start:ethernaut I came across a error: Starting the development server... ...
0 votes
1 answer
36 views

Provided address undefined is invalid, the capitalization checksum test failed, or it's an indirect IBAN address which can't be converted

I'm building a Dapp and when i im click the mint button i get this error Error: Provided address undefined is invalid, the capitalization checksum test failed, or it's an indirect IBAN address which ...
0 votes
1 answer
58 views

How to send BNB to multiple address without using for loop

I need to send BNB or BSC tokens to multiple addresses. I saw some answers but they are used for loop. I can't use a loop because it takes a lot of time and the server is not responding. Is there any ...
0 votes
1 answer
55 views

I can't transfer web3js forward contract (USDT)

I am trying to write rpc api via web3 with nodejs. I made ETH transfers somehow, but I couldn't make contract (USDT) transfers in particular. web3 : I am using version 1.8.1. Can you send sample code? ...
0 votes
1 answer
36 views

is it possible to make a whole blockchain from scratch using javascript?

I was wondering if javascript has alot of tools of doing stuff and help with hashing and helper nodejs modules that help with web3 development but my question is it possible to make something like ...
0 votes
1 answer
63 views

Execution reverted when trying pair.getReserves()

Here is the code I've wrote: Swap Token Gist Here's one of the TxId with the revert: BSC Scan Tx Id And here is a screenshot with the revert message: Why is the contract reverting if there are ...
1 vote
3 answers
255 views

Cannot estimate gas; transaction may fail

I wrote a smart contract, that is able to borrow a flashloan, make a few trades and pays the flashloan back after that. I tested the smart contract with hardhat on a mainnet fork and everything worked ...
  • 21
1 vote
0 answers
27 views

Error: Cannot find module 'merkle-patricia-tree/secure'

I am trying to run the following script using NodeJS to interface with the LevelDB files stored by Geth: //Just getting the requirements var Trie = require('merkle-patricia-tree/secure'); var levelup =...
0 votes
0 answers
18 views

web3.min.js undescriptible bug

i'm working on a react project and when I run it with npm run start from react-scripts it works but when i use npm run build and test it on a local express server, i got this : Uncaught TypeError: ...
1 vote
0 answers
22 views

NodeJS doesn't log any thing on the console for contract deployment

I'm deploying smart contract into a private Ethereum network by web3js and the web3 provider is a Geth node. According to the deployment code, NodeJS should log the deployed contract address on the ...
  • 481
0 votes
1 answer
123 views

How to create and use a moralis server in the newer version to listen to events?

I am following the blockchain tutorial by Patrick Collins. For the NFT Marketplace frontend, to listen to the events emitted, moralis server is to be used. This is the video with the required ...
0 votes
1 answer
70 views

Why would someone want to run an Ethereum node?

Is there any financial incentive to run an Ethereum node, or is it primarily for data gathering? Does running a node always preclude the responsibility of validating blocks? If someone's only ...
  • 1,334
0 votes
2 answers
115 views

I'm a bit new to this, how can I send BUSD instead of using BNB?

I am looking for a way that when you make the purchase with a fixed amount of BUSD to a smart contract address that I already have implemented. My problem is that I can't find the way to send BUSD ...
1 vote
1 answer
85 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
232 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 = ...
  • 139
0 votes
0 answers
12 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
69 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
248 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
78 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
80 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 ...
2 votes
1 answer
483 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 ...
  • 23

1
2 3 4 5
16