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
1answer
28 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
9 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
9 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. ...
1
vote
0answers
25 views

How to get method name from transaction history (since the beginning and news in realtime)

My job is to get all the method name from the token contract transactions from the beginning and to display the new transactions in realtime. 1) Get all events For the moment I can display the "...
0
votes
0answers
39 views

calculate automatic slippage for pancakeswap exchange like Poocoin.app does

I am trying to automate swap on pancakeswap but for some tokens manual slippage percent doesn't help and it fails. I need to set slippage automatically every time based on token requirement. In ...
0
votes
2answers
43 views

How to convert bignumber to normal number using ethers.js?

I am using ethers.js I can't figure out how do you convert a bignumber like 1252500000000000000 to 125.25 -Mike
0
votes
1answer
17 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
1answer
160 views

How to get always the right price for all BSC tokens? Ethers.js

I'm coding my small app and I'm having trouble getting BSC token prices. The problem is: I'm getting weird values for some specific pairs (eg. SHARD/WBNB, SAFEMARS/WBNB) How can I get a basic and ...
1
vote
0answers
40 views

Error: Only replay-protected (EIP-155) transactions allowed over RPC

When I try to send funds from a token address to another I encounter this error: only replay-protected (EIP-155) transactions allowed over RPC My Code: const contract = new web3.eth.Contract(ABI,...
0
votes
0answers
8 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 ...
1
vote
0answers
16 views

bsc get transaction list by address Web3 (realtime,socket)

How can I track transactions of a wallet in the bsc network instantly? (I am thinking of using web3 js.) I don't want to do it with the api on BSCscan. As far as I know, it does not show it instantly.
0
votes
0answers
190 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
14 views

Web3 sign promise won't resolve

I'm trying to build a login system using MetaMask. Everything is working thus far except for sending a signed message. The signed message goes through to MetaMask but then it gets stuck resolving the ...
0
votes
0answers
11 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
0answers
30 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
55 views

How do i get the amount of tokens received for a swap on Uniswap/Pancakeswap so i can exchange them back later

I have successfully used the swapExactTokensForTokens() and approve() functions on Pancakeswap with ethers js. Uniswap docs say that swapExactTokensForTokens() returns The input token amount and all ...
0
votes
0answers
17 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 ...
1
vote
2answers
308 views

PancakeSwap V2 swapExactTokensForTokens not working, getting stuck

I am unable to get this working with ethers.js. I know there are many similar questions for this specific topic, but none of the answers seem to work for me. My attempt is mostly based on Noob ...
0
votes
0answers
70 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
20 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
10 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
32 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
33 views

Object { code: -32000, message: “unknown account” } while sending transaction to smart contract

I know there are many questions revolving around same. But none of the answers are concrete. I have deployed my contract using remix on BSC test net and now making frontend to interact with my ...
1
vote
0answers
19 views

must be a lvalue, what's this error mean, precisely?

I am writing a few contracts and I'm all good to go until I migrate and hit this bump in the road, it has tormented me for 3 days I can't seem to figure out the issue I am thinking it is a camel case ...
1
vote
2answers
34 views

why do i get the error Contract Token“ and ”Ethswap" token contract is not deployed to detected network error

I deployed my contract sent my decentralized application to Github pages. (GH.pages) here is the link to see it, it will say error not deployed to the detected network if you want to see the ...
1
vote
1answer
55 views

get a list of all erc20 tokens including address and decimals

Is there a way to programmatically fetch a list of all erc20 tokens including contract addresses and decimals? Im using web3 but if there is any rest service I dont know Im happy to get to know about ...
0
votes
0answers
37 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 ...
3
votes
2answers
142 views

Find address of a contract before deployment in Hardhat and Ethers.js

I have 2 contracts which take each other's addresses as constructor arguments. Here's the pseudocode, constructor A(address B) constructor B(address A) I am deploying contracts using const Contract = ...
0
votes
1answer
17 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, ...
1
vote
1answer
20 views

Server firewall is blocking the Web3.js connection in NODE

My Centos server has running the "ConfigServer Security & Firewall" and its blocking the Web3.js connection with Ethereum node. The functions calls returns: "Error: Invalid JSON RPC ...
0
votes
0answers
8 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
27 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
28 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
15 views

get amount of transferred tokens from transaction receipt [duplicate]

Can someone explain to me how to get the amount of tokens that have been transfered from a transaction receipt? I came across some posts that said I can get it out of the data property from the ...
0
votes
0answers
11 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
64 views

web3 - get contract from transaction object

I am fetching the latest blocks transactions using web3 and then I use the getTransaction(txhash) function to get the transaction object. I was wondering, how could I get the information about which ...
1
vote
0answers
29 views

subscribe to address (wallet) and get transaction info including receiving token name (if token)

I just started playing arround with blockchain development and the use of web3 so I have more questions than my fingers are able to type, hope some of you are able to answer the first one I have. What ...
0
votes
1answer
19 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
73 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
0answers
15 views

How to transfer Bep20 token using web3.js [duplicate]

I want to transfer a Bep20 custom token from a wallet to another using web3.js in Binance Smart Chain. I can transfer BNB using this code: // Create transaction const myTransfer = async () => { ...
0
votes
1answer
16 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
1answer
27 views

Truffle cant find script file

I am trying to execute a script in my truffle project. The script is located in the scripts folder. But whether I run the command from within the root of the project or inside the scripts folder, it ...
0
votes
0answers
15 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 ...
1
vote
1answer
228 views

Subscribing to events using ethers / hardhat network

I have a basic node express application. It connects to my locally running hardhat network via ethers & websocket. The connection seems to work, since I can query the blockchain succesfully (for ...
0
votes
0answers
26 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
1answer
27 views

How to send erc20 tokens through web3 on nodejs

My transactions go through without errors, while they're pending the data field shows the amount of tokens I'm sending, but when the transaction goes through the data field is empty. Here is my code: ...
0
votes
0answers
24 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
15 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 ...
3
votes
2answers
100 views

How to hide the private key for sign trnx with NodeJS?

When I sign a transacction in a website I do it with Metamask and my private key is safe. Now I am signing transactions automatically from a NodeJS like the next code. Can I somehow hide my privateKey ...
0
votes
0answers
31 views

Decoding function from transaction input [duplicate]

I am looking at tracking ERC-20 token swaps. For example, this transaction hash "0xbcc5eeae8313f2c958b858f7ad6998935f1e74362289571110dc0930779effea" is swapping DAI for ether. I can see ...

1
2 3 4 5
12