Questions tagged [nodejs]

Node.js is a platform built on Chrome's JavaScript runtime for easily building fast and scalable network applications.

258 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
0
votes
0answers
173 views

I am trying to deploy on Polygon network using truffle suite however during migration I am getting error!

Error message: truffle migrate --network matic --reset Compiling your contracts... =========================== / Fetching solc version list from solc-bin. Attempt #1 C:\Users\aryan\Documents\GitHub\...
0
votes
0answers
302 views

How do I get the token symbol, token name, and size of liquidity pool for a newly minted pair using Node.js and Web3?

//original code courtesy of EatTheBlocks factory.on('PairCreated', async (token0, token1, pairAddress) => { console.log(` New pair detected on PancakeSwap ================= ...
0
votes
1answer
1k 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 ...
0
votes
1answer
43 views

The contract code couldn't be stored, please check your gas limit

I tried to deploy my contracts but every time I get this error. The first two contracts were deployed successfully, but the third contract, "PostFactory.sol" is facing this issue in loops. I ...
0
votes
1answer
15 views

index within block

is it possible to choose which index you want to aim for when sending a transaction? Lets say there are 100 transactions all with 5 gwei, if i want to be on index 25, would it be possible to send the ...
0
votes
0answers
162 views

MetaMask - RPC Error: Error: [ethjs-query] while formatting outputs from RPC

I am very new to Ethereum smart contract solidity programming. Currently, I have been facing this issue when I try to pass a variable from my Node.js servlet to the smart contract I deployed using ...
0
votes
0answers
18 views

Send different signed transactions in a batch?

I have signed transactions and want to make a batch request with all the different signed transactions. How can i achieve that?
0
votes
0answers
266 views

Connecting Metamask with Web3

I am relatively new to Solidity, Node.js, and Web3, and I am trying to create a simple betting platform that runs on the Ethereum blockchain. I have been digging around the internet for proper ...
0
votes
1answer
80 views

Truffle Compile Fails with Error " Expected pragma, import directive or contract/interface/library/struct/enum/constant/function definition"

When running truffle compile in the root directory of my project I get the following error: ParserError: Expected pragma, import directive or contract/interface/library/struct/enum/constant/function ...
0
votes
1answer
739 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
1answer
190 views

Getting correct decimals in ethers.io library, using getAmountsOut() ABI

I am using the getAmountsOut() interface to get the current PancakeSwap price of a random BSC token that has 9 decimals in its smart contract, see https://bscscan.com/token/...
0
votes
0answers
107 views

web3js is not executing contract functions

I am trying to call the following simple function from web3.js but none of the function is being executed as I find no transaction entry in ganache. pragma solidity ^0.5.11; contract FirstContract { ...
0
votes
0answers
29 views

web3js + nodejs: calls to methods.deposit() creates a transaction that is pending forever

I'm trying to make simple calls to a contract in order to harvest the acccumulated yield. To to that I'm performing this call: const h = await polycatFarm.methods.deposit(25, 0, walletAddress).send({ ...
0
votes
0answers
34 views

I have a question/error 'invalid address' with javascript using web3 & ERC20 token

What I have working: connect to metamask, check wallet for balance, check if VIP But bulkSendCoinWithSameValue produces the error 'Uncaught (in promise) Error: invalid address' I am late to learning ...
0
votes
0answers
34 views

JSON Parse API response ends in unexpected token " " at position

Whenever I fetch the getContractABI Endpoint of etherscan and try to parse the response.data to JSON I get the error of unexpected tokens. exports.getContractABI = async (contractaddress) => { ...
0
votes
1answer
605 views

Retrieving the private/ public key with web3js for a specific wallet provided by truffle/hdwallet-provider

I can't find a way to retrieve the private key / public key / public address for a web3 account loaded via a provider. I have tried the web3.eth.accounts command but I am not getting the private key / ...
0
votes
0answers
22 views

Chainlink Initiators - Failed testing subscriber: unexpected end of JSON input

I am trying to customize Chainlink External Initiators, since the blockchain is fork of Ethereum. I am simulating the eth.go and created my own version. After updating the program, triggered the ...
0
votes
0answers
26 views

Truffle Test error, and problems with npm

this isn't so much a truffle question, but more of a dependency and npm question. whenever I try to test this smart contract, my terminal keeps telling me that there is an error with my babel config. ...
0
votes
1answer
152 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 ...
0
votes
0answers
24 views

web3 subscribe produces duplicates

I am using web3 with an infura enterprise account to store tx data into a mongodb. Ive noticed that I have many duplicate transactionhashes stored and just can not figure out why. Is this a known ...
0
votes
0answers
797 views

Error using ethers.js and Pancakeswap router (UNSUPPORTED_OPERATION: cannot override)

I am very noob on ethers and can't fix this error. The code initially finds a new pair with PairCreated and exchanges it for WBNB with the router. However, when I run the code I get an override error ...
0
votes
0answers
42 views

How to sign tx with privatekey in etherjs(nodejs)

How can i sign a transaction with etehrejs with a privatekey only? The code i have requires mnemonic, which i dont want to use, i want to sign tx with privatekey //const mnemonic = 'Mnemonic goes here'...
0
votes
1answer
59 views

web3.eth.contracts.myMethod().call() returns nothing

I'm still new to ethereum development, and when trying to execute call() on a created contract, I'm receiving varying results. Sometimes the call works, and other times it returns the error Returned ...
0
votes
0answers
27 views

Detect new smart contracts deployed to the Ethereum Mainnet

Is there a way (perhaps using a combo of Node + Web3 + Infura) to detect the deployment of new smart contracts to the Ethereum mainnet? If not using that combo, is there another way please? Maybe a ...
0
votes
0answers
467 views

Attempting to create a transaction on BSC via Ethers.js

I've been trying to create a transaction using Pancakeswap's V2 router and Ether.js but been having little success with SwapExactETHForTokens: I've created the function with: const pancakeswap = new ...
0
votes
0answers
37 views

how can i show the value(uint256) in contract

I made a webapp by modifying it from https://github.com/RedSquirrelTech/hoscdev/tree/master/chapter-10%2B11 for newFundraiser.js I have it sent in monetary value, it will be msg.value and saved as ...
0
votes
0answers
30 views

Eth or USD values of token transfers/transactions

Is there any way to retrieve the eth or dollar amount of a Transaction Like etherscan shows on their Website when clicking on a Transaction? Are they pulling price data of the transferred tokens the ...
0
votes
1answer
82 views

Query for DeFi/ETH/BSC wallets, transactions, balances

I'm looking for a way to monitor wallet balances or otherwise somehow query the mainnet for ETH or BSC (or a DeFi contract on either network), but I feel like I "don't know what I don't know"...
0
votes
0answers
177 views

Monitor transfers to given addresses

I have a program that monitors all token transfers going out from a set of addresses I have. That works fine, I get the transactions, the tokens, the amount etc. But now when I apply the whole logic ...
0
votes
2answers
291 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
0answers
12 views

value property from decoded txreceipt logs appending zeros

I wrote a program that scans all transaction for token transfers and logs the amounts transfered. I am using node package abi-decoder to decode the transaction receipt logs for this. My question is, ...
0
votes
0answers
137 views

Executing the Truffle console script:Error: ENOENT: no such file or directory,

I am trying to execute the following script: module.exports = (callback)=> { Message.setProvider(web3.currentProvider); const MyContract = require("~/Truffle programs/...
0
votes
0answers
79 views

Web3js works in my localhost NODE server but return an error in my remote webserver

All Web3js functions works correctly in my NODE (10.7.0) localhost server but the same configuration return the next error in my remote NODE webserver (same configuration and versions). Any idea? ...
0
votes
0answers
130 views

web3 transaction value always 0

Can anyone explain to me, why the transaction object I receive via web3 always has a value of 0? When I open up the transactionhash in etherscan, it shows under the to field which is named "...
0
votes
1answer
27 views

Calling smart contracts with value using web3js and galanche

I'm fairly new to Ethereum smart contracts, so this might be a stupid question, but I need someone to help me out. I've set up Galanche on my machine (MacOS 11) and written a very simple currency ...
0
votes
0answers
384 views

Listing NFT on OpenSea via JS API: Failed to extract transfer calldata Error 400

I am trying to use the OpenSea JavaScript API in order to list NFTs for sale automatically. I can't seem to figure out why I keep getting the error Error: API Error 400: ['Failed to extract transfer ...
0
votes
1answer
25 views

Secure data for NodeJs interface

I want to secure data for my NodeJs+Express+Mongodb website : ABI Contract address Infura.io API key Those data are very important because if an attacker can change them, it can steal ETH from my ...
0
votes
0answers
18 views

Use Web3js library

I am new to the use of blockchain we are building an application where I have the following problem to solve: Users when registering in our system will create a wallet of an ethereum token Be able to ...
0
votes
0answers
77 views

Web3.js call() on view function on Smart Contract is failing

I am trying to access a simple variable on my smart contract, locally inside my nodejs application. The relevant parts of my contract look like this import "@openzeppelin/contracts/utils/Counters....
0
votes
0answers
39 views

Nodejs API to Solidity data transfer

I want to know that how can I transfer Nodejs API call response to Html, where for every call or response gas will be consumed by help of Solidity from the Ganache Ethereum account.
0
votes
0answers
53 views

Send web3js event to webhook when it happens

I have a transfer method that transfers a token using the deployed smart contract in Web3JS. I have to return the values to the customer, so I subscribe to the transfer event and wait for it to ...
0
votes
0answers
14 views

Serialized abi was altered during trasmission from Nodejs server

Here is the a text file when it is console out on Nodejs (12.16) server: forsale abi : [ { "inputs": [ { &...
0
votes
0answers
725 views

IPC Connection not work on Node.js (web3)

I have a geth node launch on linux, I want to access it through the IPC connection in a Node.js application. I am getting this error : /home/**/node_modules/web3-core-helpers/lib/errors.js:66 ...
0
votes
0answers
40 views

Problem reading chaindata that generated by ganacha gui

my intention is to write a script to analysis eth data from scratch. i run ganache gui in window with about 200 blocks up to now, and i quite sure that chaindata is keep growing big, then i simply run ...
0
votes
0answers
64 views

Script for running permutations of seed phrases and finding corresponding ethereum address

My metamask extension was deleted and what I thought was the correct ordering of the seed phrase turns out not to be so. I have all 12 BIP39 phrases and am looking to run a 12! permutation to find the ...
0
votes
0answers
282 views

Getting undefined transactions with web3.js

I use the following script to monitor pending transactions for a certain account: const sub = web3.eth.subscribe('pendingTransactions', (err, res) => { if (err) console.error(err) }) sub.on('...
0
votes
0answers
21 views

Withdraw ETH from Keythereum wallets

So I was using keythereum to generate public and private keys. const dk = ethereum.create(); parameters.address = ethereum.privateKeyToAddress(dk.privateKey); parameters.pKey = dk.privateKey.toString('...
0
votes
0answers
202 views

Programmatically convert log data (hexadecimal) into negative decimal value

I'm having some trouble converting negative numbers in the log data of an Ethereum transaction. In this transaction, log index 192, topic 3 is listed as "...
0
votes
0answers
82 views

What is the best practice when storing a custodial wallet with node.js and mysql?

I'm using Adonis.js v4 (it's node.js) and mysql (on RDS) as my database. I need to create an ethereum wallet for each of my user's and I need to make transaction on their behalf with their wallet (...
0
votes
0answers
86 views

How can I make Withdrawal with Metamask api?

I have a system, people buy my erc20 tokens through this system. I want to automatically transfer the token to their wallet address when they buy it. how can I do that? Can this be done with the ...