2022 Developer Survey is open! Take 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
1 answer
646 views

Error: `Invalid JSON RPC response` when running estimateGas on Infura

Why am I getting an error when doing a gas estimation on infura. I am using web3 v1.0 and here is my code: let Web3 = require('web3'); var web3 = new Web3(new Web3.providers.HttpProvider('http://...
0 votes
1 answer
22 views

Unable to install WalletConnect through npm

I'm trying to add Wallet Connect to our project(Vue.js), form here: https://docs.walletconnect.com/quick-start/dapps/web3-provider, I used this command to install it. npm install --save web3 @...
0 votes
1 answer
17 views

swapTokensForExactETH, execution reverted: null

I m trying to estimate gas for a swapTokensForExactETH transaction with pancakeswap contract (similar to uniswap one) When i do, i get the following error: Error: Returned error: execution reverted ...
0 votes
0 answers
4 views

Is there a multi-call equivalent for calls that aren't made to a smart contract?

I have an array with a bunch of events. I get the block number from these events but I also need the block.timestamp which isnt returned in the event object, its returned by getting the block. So I am ...
0 votes
2 answers
424 views

Getting stuck in truffle testing

I am trying to run a test and I am getting the following message; I have tried the following; npm install scrypt npm install web3 as to solve the yellow message and when running truffle test ...
1 vote
1 answer
186 views

How to use web3.js in node.js web server

I am wondering how to use web3.js in my node.js web server in the correct way. I have a button in the homepage where allows users to connect to their wallet, and it is done in my front end. After ...
2 votes
6 answers
5k views

Can't install Truffle Framework to Mac OS Big Sur

so I checked to see if I had the latest version of nodejs, and it turns out that I do. kalebamarante$ node -v v15.5.0 then I tried installing a version of Truffle and it didn't work ~ kalebamarante$ ...
0 votes
0 answers
15 views

about Swap tokens on Uniswap using a smart contract

I would like to build a bot (using VS code) that swaps ETH for other tokens and swap other tokens for ETH using a smart contract.I read the code in this article:https://cryptomarketpool.com/how-to-...
0 votes
0 answers
35 views

Getting "Expected private key to be an Uint8Array with length 32" when running a transfer function on ropsten testnet through my terminal

i am trying to send a transaction but it throws an error. MY CODE: var Tx = require('ethereumjs-tx').Transaction const Web3 = require('web3') const web3 = new Web3('https://ropsten.infura.io/v3/...
1 vote
1 answer
577 views

Running ethereumjs/testrpc from a Docker container

I'm taking a stab at creating a set-up where I have a Docker container from which I run ethereumjs/testrpc (an Ethereum testing environment) and another Docker container running an Express app. I then ...
0 votes
0 answers
24 views

openseaJs SDK error TypeError: Cannot read properties of undefined (reading 'target')

I am receiving this error from openseaJs while calling fullfillorder TypeError: Cannot read properties of undefined (reading 'target') at computeOrderParams (/…/node_modules/opensea-js/src/seaport.ts:...
0 votes
0 answers
22 views

Error by npm run deploy_contract

am having an issue! I am getting a catch error ( catch ERROR: ERROR STATUS: 403) when I ran "npm run deploy_contract" 10k-collection-video@2.0.0 deploy_contract node utils/nftport/...
0 votes
0 answers
7 views

Returned error: replacement transaction underpriced and Returned error: exceeds block gas limit

I'm trying to send a Web3JS transaction for a SmartContract (BSC) but it always returns Returned error: replacement transaction underpriced and if I increase the Gas it generates Returned error: ...
0 votes
0 answers
12 views

Linking OpenSea live-price from an auction to personal website

I want to auction on OpenSea. I am building a custom website to promote my NFT. On it, I have currently a listing price, but I would like to link a live-price via OS API. Is there a tutorial / simple ...
2 votes
2 answers
2k views

Make offer to opensea asset through opensea-js

I'm using opensea-js alongside with nodejs to make offer on opensea testnet assets. The code is following: process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'; const Web3 = require('web3') const opensea = ...
0 votes
1 answer
853 views

Sending value to a solidity contract method from web3 results in `Invalid Tuple Value` error

I'm sending values to a solidity 0.5.1 method using web3 and keep getting an invalid Tuple value error. Here's the relevant contract code: struct mystruct { bytes32 id; string str; } ...
0 votes
1 answer
2k 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
1 answer
195 views

How to get connected wallet address in node.js server side

I couldn't find a way to obtain accounts the user connected in my website in my node.js web server. This is what I've tried const express = require('express'); const Web3 = require('web3'); const web3 ...
2 votes
1 answer
607 views

How to call the functions of Ethereum Smart Contract from Android/iOS application?

I've been learning solidity & viper for some time now but i am wondering if it's possible to call the functions/methods of a smart contract (already deployed on Ethereum Network) from an Android/...
0 votes
1 answer
25 views

I am following the Wormhole SDK to bridge from Fantom to Terra. and while I try to get signedVAA I got < ReferenceError: self is not defined>

const WORMHOLE_RPC_HOSTS = 'https://wormhole-v2-testnet-api.certus.one' const { signedVAA } = await getSignedVAA( WORMHOLE_RPC_HOSTS, CHAIN_ID_TERRA, emitterAddress, ...
0 votes
1 answer
18 views

UniswapV3 price calculated using sqrtPriceX96 is wrong

I'm calculating a UniswapV3 pool's token0 price in Node.js. Using UniswapV3 SDK gives correct result, but manual calculation isn't. From the docs - sqrtPriceX96 = sqrt(price) * 2 ** 96 # divide both ...
10 votes
7 answers
21k views

Solc --version: command not found

I'm trying to use solc with no success. I download solc with npm install solc but when I run solc --version the console output is: command not found. If I list packages npm list I'm able to see ...
0 votes
2 answers
29 views

Web3 make NodeJS wait until a promise gets resolved inside a subscription?

I have the following code: import Web3 from 'web3'; function waitForFunds() { let web3 = new Web3(new Web3.providers.HttpProvider('http://localhost:7545')); return new Promise((resolve, ...
0 votes
0 answers
157 views

How to programmatically swap tokens using a smart contract with NodeJS and Solidity

I would like to build a bot (using VS code) that swaps ETH for other tokens and swap other tokens for ETH using a smart contract. I have used Remix IDE but I get errors that I can't fix. For example, &...
0 votes
1 answer
46 views

How to confirm a transaction in backend in behavior of the user?

I am developing an application where the front-end does not talk directly to the blockchain. Back-end does that instead, due to some proccesses that can only be done in the back-end (file manipulation,...
0 votes
0 answers
52 views

Uncaught TypeError: Cannot read properties of undefined

I keep getting this error message in my browser inspect element console. 2shortenAddress.js:1 Uncaught TypeError: Cannot read properties of undefined (reading 'slice') at shortenAddress (...
0 votes
2 answers
992 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
1 answer
52 views

I keep getting this error while trying to compile my contract trough the HardHat feature

Here is the script in my deploy.js: const main = async () => { // We get the contract to deploy const Transactions = await hre.ethers.getContractFactory("Transactions"); const ...
0 votes
1 answer
39 views

ReferenceError: Process is not defined

Here is the script in my deploy.js: const main = async () => { // We get the contract to deploy const Transactions = await hre.ethers.getContractFactory("Transactions"); const ...
0 votes
1 answer
20 views

ReferenceError: greeter is not defined

Here is the script in my deploy.js: const main = async () => { // We get the contract to deploy const Transactions = await hre.ethers.getContractFactory("Transactions"); const ...
0 votes
1 answer
2k views

How do I load the `web3` module using the html `script` element?

How do I load the web3 module into the frontend of my application using the html script element? I have already installed the web3 module using npm. This is the path to the web3 module in my app ...
1 vote
1 answer
814 views

API node js with call and send to a contract without metamask

I am new in Solidity. I'm trying to create a API in node js, which can be use without a navigator like chrome with MetaMask. I would like to test it with postman. But i have some problems with web to ...
2 votes
2 answers
197 views

NodeJs & Web3 having problem with VS Code IntelliSense (autocomplete)

I'm having issue with autocomplete of Web3 module members in the VS Code. As can be noticed on the screen below web3.eth. not proposing any member of the module. web3 module has been installed over ...
0 votes
1 answer
51 views

error: Invalid JSON RPC response: "" when trying to transfer testnet token

I am trying to transfer testnet tokens using Node.js, Web3.js, Ethers, and Alchemy but I am receiving Invalid JSON RPC response: "" whenever I deploy my code to Railway. Is this an issue of ...
0 votes
1 answer
13 views

What Database (or maybe the whole stack) should I use for a webapp?

I am thinking of making a webapp where I have to save some private data and other data that could be public. For simplicity let's say it's a quizzes page but it logs in with Metamask. We are going to ...
0 votes
1 answer
248 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 ...
2 votes
1 answer
2k views

Using AbiEncoderV2 for encoding data in raw transactions

I've come across a use-case to need to pass a struct into a Solidity function. I know this can be done via tuples. However, I need to sign and send this transaction from my node.js back-end using ...
2 votes
1 answer
3k views

Module not found: Error: Can't resolve 'stream' in React project including web3

When I include web3 in a project I am getting node compile errors like this... ERROR in ./node_modules/cipher-base/index.js 3:16-43 Module not found: Error: Can't resolve 'stream' in '/Users/xxx/dev/...
0 votes
2 answers
690 views

format transfered value with contracts decimals

I have the amount of transfered tokens converted from a transactionreceipts log data. for example USDT the value I got is 500000000 , USDT has 6 decimals. The actual transfered value is only 500 USDT, ...
0 votes
1 answer
30 views

BIP32 Extended Public Key Generate Ethereum Address

BIP32 Extended Public Key How can I generate an address with node js? Is something like this possible
0 votes
0 answers
6k 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
1 answer
718 views

getPastEvents on localhost is not a function error

Now, I'm working on an Ethereum Blockchain project to transfer the ownership of stored devices by using local web3 provider at the truffle environment. Truffle v5.0.27 (core: 5.0.27) Solidity v0.5....
0 votes
1 answer
42 views

i have problem installing truffle ,when i try npm truffle -v i get this error message

truffle : File C:\Users\hp\AppData\Roaming\npm\truffle.ps1 cannot be loaded. The file C:\Users\hp\AppData\Roaming\npm\truffle.ps1 is not digitally signed. You cannot run this script on the current ...
0 votes
1 answer
25 views

Sending big values to wallet

I want to send big value (10000000) for example to other wallet but i have error like this: UnhandledPromiseRejectionWarning: Error: Error: [number-to-bn] while converting number 3.0244e+22 to BN.js ...
0 votes
0 answers
46 views

Invalid Arrayify Value when querying Uniswap v3 Quoter contract

Does anyone know why my code for passing an array of pool addresses into the QuoterV2 quoteExactInput function is returning an 'invalid arrayify value' error? async function main() { var amt = ...
0 votes
1 answer
594 views

BEP20: transfer amount exceeds allowance

I want to swap bep20 tokens like BUSD - BNB and BNB - BUSD, i already approved tokens for the swapping but while i try to swap BNB - BUSD it's throw error like BEP20: transfer amount exceeds allowance ...
0 votes
1 answer
597 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
0 answers
21 views

Block capacity - Hyperledger Besu

Good afternoon, I am trying to perform a transaction capacity test on my network with Hyperledger Besu with 4 validator nodes and a time per block of 4seconds. I have created a script with NodeJS that ...
0 votes
1 answer
625 views

ipfs.files.add(Buffer) function causing TypeError: Cannot read property 'add' of undefined

I am trying to upload an image to ipfs using ipfs.files.add() function but it is causing me this error Uncaught TypeError: Cannot read property 'add' of undefined at App.onSubmit (App.js:70) at ...
0 votes
1 answer
318 views

end process after web3 sendTransaction return transactionHash

I want to end the process after sendTransaction return transactionHash. Here is my code currently : const Web3 = require('web3'); const web3 = new Web3("http://127.0.0.1:8545"); async function task(...

1
2 3 4 5
14