Questions tagged [nodejs]
Node.js is a platform built on Chrome's JavaScript runtime for easily building fast and scalable network applications.
783
questions
0
votes
0
answers
5
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 ...
0
votes
1
answer
19
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 ...
0
votes
0
answers
7
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 () {
...
0
votes
2
answers
44
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. ...
0
votes
0
answers
38
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 ...
0
votes
0
answers
15
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 ...
0
votes
0
answers
17
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,
...
0
votes
2
answers
24
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 ...
0
votes
1
answer
30
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 ...
0
votes
1
answer
36
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(
"...
0
votes
2
answers
19
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 ...
0
votes
0
answers
10
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 ...
0
votes
1
answer
16
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 ...
0
votes
1
answer
37
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....
0
votes
1
answer
19
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 &...
0
votes
1
answer
84
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:
...
0
votes
0
answers
21
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 ...
1
vote
1
answer
64
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":"...
1
vote
1
answer
16
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}...
0
votes
2
answers
109
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 ...
1
vote
0
answers
24
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 ...
1
vote
1
answer
33
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 ...
0
votes
1
answer
166
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(
...
1
vote
1
answer
33
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 ...
0
votes
1
answer
56
views
Reading from a nodejs object
I try to read data from this node js object (I got it from sequencer feed on arbitrum):
data = [
BigNumber { _hex: '0x0f634d1e114f4d', _isBigNumber: true },
BigNumber { _hex: '0x01', _isBigNumber: ...
2
votes
1
answer
363
views
Reading transactions from arbitrum sequencer feed
I try to read transactions from arbitrum sequencer feed and decode the transaction data to get information about the transaction, therefore I try to check which function is called for the transaction ...
1
vote
0
answers
22
views
Transaction failed [ See: https://links.ethers.org/v5-errors-CALL_EXCEPTION ] - Gas fee
I'm trying to create new safe wallet for my current wallet using deploySafe method. Following is my implementation:
const provider = new ethers.providers.JsonRpcProvider('https://polygon-rpc.com);
...
1
vote
1
answer
125
views
Returned error: unknown account Web3.js
I'm trying to create new safe wallet for my current wallet using deploySafe method.
Following is my implementation:
import Safe, {
SafeAccountConfig,
SafeFactory,
Web3Adapter,
...
0
votes
0
answers
26
views
We have an own wallet but we don't have an idea how to connect this to other sites?
I had an Wallet created by Own.I need to connect that wallet with active sites like Metamask.If we want to connect the Metamask with Site means we call window.ethereum default as a trigger comment.
...
1
vote
1
answer
268
views
How to access the Event args while testing using ethers v6?
I am trying to access an events argument(s) while running tests for my smart contract using node.js/chai. Recently moved to using ethers v6, and the code that works on v5 is no longer valid.
Namely:
...
0
votes
0
answers
19
views
Get value between 160-208 bits in uint256 by web3
I have uint256 representation of hex string 0x0064ababe1000000000700001ca050ee97607a20445e11b012877b0a4e113388
uint256 some1 = uint48(someAddress >> 208);
uint256 some2 = uint48(someAddress &...
0
votes
1
answer
171
views
TypeError: no matching function (argument="key", value="deployContract", code=INVALID_ARGUMENT, version=6.6.1)
javascript
const { ethers } = require("hardhat")
async function main() {
const SimpleStorageFactory = await ethers.deployContract("SimpleStorage")
console.log("...
1
vote
3
answers
289
views
CALL_EXCEPTION in estimateGas with local ganache
I am trying to deploy a contract to a local ganache network using Nodejs v20. Nodejs is able to connect with local Ganache but the deploy() method is giving following error:
Error: missing revert ...
0
votes
1
answer
318
views
How to sign a meta-transaction using ethers?
I am trying to sign a meta-transaction so I can execute a function from a smart contract with 1 account but pay for gas fees with another.
This is the code I have (this works when using MetaMask in a ...
0
votes
1
answer
104
views
@safe-global/protocol-kit Create2 error using deploySafe and nodejs
I'm using nodejs and deploying the createSafe function as so:
async function createSafe(ethAdapter) {
try {
const safeFactory = await SafeFactory.create({ ethAdapter });
const ...
0
votes
0
answers
112
views
Using Web3 the value sent as payable (msg.value) is equal to 0
We have a smart contract that is supposed to receive payments in order to mint token; it follows the ERC1155 standards as it extends ERC1155URIStorage.
Here is a sample of the contract we deploy:
// ...
0
votes
0
answers
153
views
I am Getting this error ProviderError: Must be authenticated!
ProviderError: Must be authenticated!
at HttpProvider.request (/workspaces/Decentralized-Voting-Application-on-Ethereum-Blockchain/node_modules/hardhat/src/internal/core/providers/http.ts:88:21)
...
0
votes
1
answer
90
views
Deployment Issue in Hardhat using `module.exports.tags`
I can't seem to deploy my "deploy-mocks.js" file using yarn hardhat deploy --tags mocks. Here's my code if you want to take a look. I have searched everywhere but can't find the answer. Any ...
0
votes
0
answers
29
views
React Native and Hardhat
I can't seem to find much documentation on this topic, but I am building a Dapp in React Native with Expo. However, I know that Expo is hard to work with when it comes to libraries with dependencies ...
0
votes
0
answers
31
views
Sending aggressive/instant transaction, setting gas
I'm trading through the 1inch API and I want to speed up my transactions. I need my transactions to be completed in <10 seconds, like the aggressive mode in the 1inch interface, but I'm not sure ...
0
votes
0
answers
11
views
Why is it not showing any results in the Table / Collection Section?
this is my transport.request.model
import mongoose from "mongoose";
const schema = new mongoose.Schema({
Transport : String,
Product : String,
Material : String,
Capacity : Number,
...
0
votes
1
answer
297
views
Error: Returned error: sender account not recognized
this contract for Deploys instances of other smart contracts and i'm using ganache
contract Contracts_Factory {
// Common Section
uint256 SIZE = 10;
uint index = 0;
string[] accounts = ...
0
votes
1
answer
86
views
hy, I am learning solidity, and am deploying a contract with local javascript, and encounter a problem in the powershell:
here the error:
PS C:\Users\mitro\OneDrive - 365education\Documents\a_progra\31_hrs_blockchain\ethers-simple-storage> node deploy.js
Deploying, please wait...
TypeError: no matching function (...
0
votes
0
answers
457
views
Cannot listen to contract events with ethers.js
Trying to track token transfer events but it only works initially when the server is starts. After 5mins, it stops listening to any Transfer events even when the websocket is still active. I've ...
0
votes
1
answer
136
views
Programmatically verification of a smart contract on a Nextjs component
I have come across a situation in my project ( Hardhat, Nextjs, TailwindCSS ) where I need to verify my smart contracts right after their deployment. Clearly, we have a mother smart contract that ...
0
votes
1
answer
564
views
How to create a uniswap pool on goerli with two custom created tokens, tokenA and tokenB?
I am trying to create a node script to create a pool and add liquidity to uniswap with two custom tokenA and tokenB by utilizing the goerli network.
I created the pool using,
const { ethers } = ...
0
votes
1
answer
594
views
Error: Returned error: nonce too low
const Web3 = require('web3');
const { ethers } = require('ethers');
const { Web3Provider } = require('@ethersproject/providers');
// Virtual addresses
const fromAddress = '...
0
votes
1
answer
379
views
Using hardhat to fork a node but getting 'Missing Trie Node'
Im using hardhat to fork a node in the command line.
cmd> npx hardhat node --fork https://therpcnodehere.com
After about 10 minutes or so the fork starts responding to requests with 'missing trie ...
0
votes
0
answers
121
views
Error: Invalid JSON RPC response: "" at Object.InvalidResponse
I am trying to make a voting system using blockchain. I am using ganache to deploy the smart contracts.
I made connection using web3.ts
import Web3 from "web3";
import data from "../...
1
vote
1
answer
26
views
sending a method on nodejs with admin account
I want to send a method from the owner's account to which I have the private key.
I tried adding the private key int he red rectangle but when I run it I get this error: