Questions tagged [web3js]

Javascript API and library for Ethereum To develop applications on Ethereum, you can use the web3 object provided by the web3.js library. Under the hood it communicates to a local node through RPC calls. web3.js works with any Ethereum node, which exposes an RPC layer. https://github.com/ethereum/wiki/wiki/JavaScript-API

Filter by
Sorted by
Tagged with
0
votes
0answers
17 views

Json RPC eth_sendTransaction data parameter

I have a question concerning the data parameter of the json RPC method eth_sendTransaction. Is it possible to send any kind of data structure with this method to a smart contract? Is it possible to ...
1
vote
0answers
15 views

Interaction between 2 nodes of ganache

I am making a project on blockchain where in I am using ganache for private blockchain, meta mask to interact with the same. Since ganache provides 10 nodes in the private blockchain, I want all the ...
1
vote
0answers
8 views

Calling smart contract on private Geth network using Esp32/arduino

I'm trying to call smart contract deployed on private geth blockchain. I couldn't find relevant library on ESP32/Arduino to interact with smart contract. What should I do?
1
vote
1answer
23 views

Without a block explorer API, can I programmatically determine if an address has a contract deployed at it (eg using Web3 or call to a node)?

Given an address, from a web application I'm attempting to determine if there's a contract deployed at the address. There are some ways to do this with etherscan or other block explorer APIs, but I'm ...
0
votes
0answers
10 views

During eth transfer in nethreum

Getting error: erc20 transfer amount exceeds allowance. My source code is:: public async Task<string> TransferAsync(string from, string to, decimal amount) { DefaultAccount = new Account(...
1
vote
0answers
15 views

How to store each new transaction in multiple/different blocks

How can I connect to Ganache so each time I add to the blockchain the transaction is stored in the next block. I have an issue that each time I add to the blockchain it gets added to the same block ...
1
vote
1answer
31 views

Why doesn't web3.js/metamask have a decrypt with private key function yet?

For smart-contracts and dApps it is in many cases important to put encrypted data on the blockchain, encrypted with the public key. I have been searching, but there doesn't seem to be a way to decrypt ...
0
votes
0answers
10 views

clone pancakeswap but it's show error Unhandled Rejection (Error)

I clone pancakeswap-frontend. when run I got above error. But I can't solve this problem. Unhandled Rejection (Error): invalid address (argument="address", value=undefined, code=...
0
votes
0answers
29 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 ...
1
vote
0answers
19 views

Event Ordering in Ethereum

I am developing an application using solidity, web3js and eventeum. I am testing it locally using ganache-cli. I use Kafka to store all the events to process them at convenience instead of processing ...
0
votes
0answers
13 views

I can't call my functions in the components which I can improve to make web3 work correctly?

I'm having a problem with components, I'm using truffle unbox / react, I created a BuyForm.js component that will be the purchase form but I have problems trying to make the purchase I'm not able to ...
-2
votes
0answers
23 views

What's the best place to hire Eth dev? [closed]

What's the best place to hire Eth dev?
0
votes
0answers
13 views

Is there any way to browse DeFi apps with “watch-only address” wallet?

I like to sign my transactions with a offline computer, then broadcast on the network with an online computer. This way I never get hacked. With MEW, it is possible to send ETH to another address like ...
0
votes
1answer
17 views

`.at()` function no longer available for web3.eth.Contract?

I'm following a guide that uses some web3 code written 3 years ago. I am trying to use the TimeLockedWallet.info() call to get information about a wallet. Below are my two smart contracts. ...
1
vote
1answer
19 views

How to use Trust Wallet instead of Metamask on mobile browser?

Most DApps makes use of meta mask to sign transactions. I want my dApp to Make use of trust wallet when its opened on a mobile browser. How do I do this
0
votes
0answers
16 views

Eth internal txn sent but not credited my wallet [closed]

I sent some 1.43 eth to Wazirx exchange which is showing that an internal txn balance was accrued but my exchange wallet is not updated after 3 days. Anyone could help adding the txn amount to my ...
1
vote
0answers
20 views

Can't connect to geth JSON RPC from React Native Expo

I am using the ethers library on npm to connect. My code for testing the connection is as follows let result = await ethers.utils._fetchData( { url: "https://MY_URL", ...
0
votes
0answers
21 views

data in ethereumjs-tx

I am trying to create a tx to interact with one of smart contract function. function withdraw(uint withdraw_amount) public { } I tried declaring the params for ethTx as this : const params = {...
0
votes
1answer
29 views

Uncaught (in promise) TypeError: work.methods.workCount is not a function

Describe the bug I am trying to call the public variable "workCount" from a smart contract using web3 Steps to reproduce: const work = new web3.eth.Contract(ABI,Address) const workCount = ...
1
vote
0answers
27 views

MetaMask no longer working on my Chrome browser [closed]

I have learned that MetaMask no longer automatically links up to Web3 sites. Every time I now try to use my MetaMask to transfer fund from MyEtherWallet, I see that it is not connected to whatever ...
0
votes
2answers
46 views

how to interact with Back-end of a dapp?

I am trying to build a dapp but I am having problems. My idea is: I have a front-end written in html / css and a backend implemented with web3.js thanks to which it is possible to connect to a ...
0
votes
1answer
19 views

TypeError [ERR_INVALID_ARG_TYPE] web3.js error

Can anyone help me fix this problem? I keep getting 'throw new ERR_INVALID_ARG_TYPE( ^ TypeError [ERR_INVALID_ARG_TYPE]: The first argument must be one of type string, Buffer, ArrayBuffer, Array, or ...
0
votes
0answers
25 views

Issue sending ETH to smart contract with web3js/metamask

So I have a simple smart contract (shown below). // SPDX-License-Identifier: MIT pragma solidity >=0.4.22 <0.9.0; contract Casino { function pay() external payable{ } ...
0
votes
0answers
19 views

web3.eth.sendSignedTransaction returns undefined [duplicate]

Please look into the below Web3 script, this is returning undefined, but it must have returned the transaction hash and its related meta data. Code: const Tx = require('ethereumjs-tx').Transaction ...
0
votes
2answers
49 views

Web3 how to send ether from client Metamask to contract address native receive function?

I wonder how can I natively pop-up the MetaMask window to send specific amount of ether as a donation to already defined SC address and ABI? Short code intro: pragma solidity >=0.7.0 <0.8.6; [......
-1
votes
0answers
48 views

Add liquidity to Uniswap pool with Web3

I am trying to add liquidity to Uniswap on the Ropsten network using Web3. My JavaScript code is as follows: (async () => { console.log("account: ", this.state.account); const ...
0
votes
1answer
49 views

“txHash: undefined” error using web3.js

Can anyone help me fix this problem? I get 'txHash: undefined' error in terminal var Tx = require('ethereumjs-tx').Transaction const Web3 = require('web3') const web3 = new Web3('https://ropsten....
0
votes
1answer
25 views

Calling view functions when user does not have a web3 provider

I am building a React App. I built it using a truffle box. The first thing the app does is try and get Web3, I understand that this allows the app to communicate with the blockchain. This works well ...
0
votes
0answers
15 views

Error: No “from” address specified in neither the given options, nor the default options. When tried swap token to ETH

I get the following error: "Error: No "from" address specified in neither the given options, nor the default options." when I try to use this function from Uniswap: ...
0
votes
0answers
46 views

web3 not working because of some deprecated library

May be this is some stupid question to ask but I'm absolute beginner. Guide me what changes I need to do. Thank you. App = { web3Provider: null, contracts: {}, account: '0x0', hasVoted: ...
0
votes
0answers
30 views

Add Custom Network(BNB) in Meta Mask Using web3

I am trying to add Binance Main and test net Network through web3 js. I don't want that user to setup it manually. Did you guys any idea about that how to handle it?
0
votes
1answer
19 views

User experience while using sendTransaction

What is best practice for user experience when sending a transaction? I was blocking UI with a spinner. I am doing this: //BlockUI const sentTransaction = await sendTransaction(transaction) ...
0
votes
0answers
52 views

Fail with error 'Ownable: caller is not the owner'

Hi I am new community member and learning smart contract and trying to develop a forked project. When I try to migrate my contract to kovan network, I have this error. I am not sure what I am missing ...
0
votes
0answers
10 views

Getting only confirmed past events

I am going to get past events which are only confirmed using web3. In tronweb, we can get by specifying onlyConfirmed parameter in getEventResult function. this.tronWeb.getEventResult(CONTRACT_ADDR ,...
1
vote
0answers
18 views

Opening GETH Websocket to Specific IP (remote connection)

I'm trying to connect to a GETH node of mine from a different location. Currently I'm using the following settings: geth --syncmode "fast" --maxpeers 100 --cache 32000 --txpool.pricebump 1 ...
0
votes
0answers
23 views

Where should I put the estimate gas produced by the remix IDE in my code?

I'm creating the ERC20 smartcontract transfer with web3. I just want to use gas optimally so that users want to do token transfer. From the Remix IDE I got the GASESTIMATES. But I don't know where to ...
0
votes
0answers
12 views

Find ETH address with amount range (Query Big Data)

I'm trying to run a query similar to this: https://medium.com/google-cloud/how-to-query-balances-for-all-ethereum-addresses-in-bigquery-fb594e4034a7 But I would like to find ETH address: Ending with ....
0
votes
0answers
12 views

How Do I Call a Function If I Know Only One ABI Function?

OpenSea published a token contract without verifying the source code in which I know the token functions of the contract from the log (Its an ERC1155 contract). How do I transact with the contract ...
1
vote
1answer
46 views

Experiencing an “invalid signature error” when trying to use the “permit” feature of ERC20 tokens that support EIP712

I'm currently writing a few smart contracts in solidity and interacting with them through web3. The premise being that a token can be deposited into a pool and can then subsequently withdraw at a ...
0
votes
1answer
60 views

web3.js Proxy Contract Error Handling

I have been working on error handling recently using the event emitter. If I call a function directly from a contract (using contract.methods.myMethod().send{from: Ganache supplied account}) with an ...
0
votes
0answers
11 views

Get balance in fast node by Geth

Is it possible to get account Balance in fast node with Geth ? and what is the size of fast node currently?
2
votes
1answer
19 views

How to check whether the keystore file has been tampered?

The format of the keystore is shown below. In the project, there is a requirement to save the keystore file from the front end to the back end. How can the back end check whether the keystore file has ...
0
votes
0answers
23 views

Detect Lock/Unlock actions in MetaMask

I want my dApp to detect Lock/Unlock actions in MetaMask, just like in: Remix=>"Deploy & Run transactions"=>"Injected Web3" ethereum.on('accountsChanged'... - is not ...
1
vote
1answer
22 views

Exchange Deposit Smart Contract

I'm developing ETH and ERC20 tokens deposit service. for every user I need unique wallet address, Can I develop a smart contract to generate unique wallet address for every user? Can I transfer ...
0
votes
1answer
35 views

web3.js not able to interact with smart contract

web3.js and general ethereum noob here. I have a smart contract written in solidity with a bunch of getter methods, for example: contract mycontract { uint XYZ = 2; ... ... ... function ...
0
votes
0answers
43 views

How to access window.BinanceChain object like window.ethereum object on page load

I am trying to initiate provider from the window.BinanceChain object injected by Binance Wallet chrome extension as I did it with the MetaMask extension before: let provider = new ethers.providers....
0
votes
1answer
14 views

Why is my approve() function using incorrect token_id

I have created an ERC20 token using openzeppelin and web3. I am then trying add some of this new token to a contract (An instance of UniswapV2Router02.sol) in order to add liquidity to a liquidity ...
1
vote
0answers
27 views

Signed Message Using EIP712 Specification Does Not Return Correct Address

I sign the typed data value with types data structure for domain using the EIP-712 specification by study and following https://docs.ethers.io/v5/api/signer/ and in my solidity code, I followed the ...
0
votes
0answers
22 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
10 views

Get past events or store them in traditional databases

I have a question about showing some results to users. I have a smart contract which has multiple arrays and mappings. I use events to store their data when I set data in functions. is it better to ...

1
2 3 4 5
85