Issue Now I try to do the solidity to save the struct data, and retrieve the data by mapping string in web3 interface. Now I’ve finished the data saving part, and I can get the data in my Remix API,
Continue readingTag: web3js
web3.js: Estimate gas fee on usdt smart contract transfer
Issue I’m trying to estimate gas value in eth, for USDT transfer, but we3.js gives me only IVALID OPCODE error… code example const Web3 = require(‘web3’); const web3 = new Web3(‘https://cloudflare-eth.com/’); const token = new web3.eth.Contract([{ ‘constant’: false, ‘inputs’: [{
Continue readingIssue in calling a smart contract function with web3
Issue I’m trying to call the createCustomer function provided in this smart contract https://ropsten.etherscan.io/address/0xD3B462CbF6244ed21CD3cF334Bf8CB44A28795A9#code and we basically have to provide three parameters like string memory _hashedEmail, string memory _name and string memory _phone. So I’ve written the following program to
Continue readingError when calling contract method and signing it manually. SendTransaction works SendRawTransaction doesn't
Issue I’m writing a node API to expose methods on my blockchain (deployed and tested with truffle). I’m using web3.js, ethereumjs-tx, ethereum, truffle and solidity as my tech stack. var txMethodData = masterKeyContract.myMethod.getData(myParams); The transaction params are: const txParams =
Continue readingGetting Invalid number of parameters for "undefined" when deploying smart contract
Issue I’m trying to deploy my first Voting contract on the testRPC and the below is my code.. for some reason it’s complaining when I come to deploy. The error seems to be from the arguments parameter. I tried passing
Continue readingweb3 npm install fails
Issue I seem to be struggling with getting npm to install web3 Command used: npm install web3 Error: npm ERR! Path must be a string. Received undefined Logs: info it worked if it ends with ok 1 verbose cli [
Continue readingReact, Web3.js & Metaplex: Unable to import `programs.metadata.Metadata` from @metaplex/js
Issue Issue Attempting to follow the ‘your first request’ example here: https://docs.metaplex.com/sdk/js/getting-started#your-first-request The module referred to in the examples doesn’t contain the data needed. For context, I am using this example to develop the solution explained at step 5 of
Continue readingweb3js Batch Request response doesn't have any context
Issue I am sending batch requests to a moralis avalanche node which (half the time) returns token prices, but it only returns prices to the callback, I can’t see the token addresses or anything related to the request I sent.
Continue readingHow do you set types on getting Object.keys on JSON file in TypeScript?
Issue I am trying to access an object from a JSON file and the error I am getting: Element implicitly has an ‘any’ type because expression of type ‘any’ can’t be used to index type ‘{…}’. ts(7053) JSON file: "networks":
Continue readingNumerous errors when importing web3 into app.js
Issue Attempt to import web3 into App.js gives me 9 errors import React from "react"; import Web3 from "web3"; function App() { return ( <div className="App"> <h1>TEST APP</h1> </div> ); } export default App; Compiled with problems:X ERROR in ./node_modules/cipher-base/index.js
Continue readingHow can we get Data from web3 using Nodejs
Issue how can I get the token details like name, symbol, and decimals details using Nodejs and web3js Solution You’ll need to be connected to a node on the same network where the token is deployed. For example if you
Continue readingAngular + web3.js: Module not found: Error: Can't resolve 'crypto'
Issue I’m trying to get started with Angular and Web3.js to work with some Ethereum contracts. To reproduce: ng new npm install web3 –save ng serve package.json: { "name": "ng-eth", "version": "0.0.0", "scripts": { "ng": "ng", "start": "ng serve", "build":
Continue readingCommand 'Solidity: Compile Contract' resulted in an error (Cannot read properties of undefined(reading 'uri'))
Issue Good day everyone, I am working on a lottery smart contract. I am currently done with the remix VM tests and proceeded with the unit tests with JavaScript. The test.js file is shown below. const assert = require(‘assert’); const
Continue readingCommand 'Solidity: Compile Contract' resulted in an error (Cannot read properties of undefined(reading 'uri'))
Issue Good day everyone, I am working on a lottery smart contract. I am currently done with the remix VM tests and proceeded with the unit tests with JavaScript. The test.js file is shown below. const assert = require(‘assert’); const
Continue readingTypeError: Cannot read properties of undefined (reading 'call') on build but not dev
Issue I am running a vite.js app with web3 installed. When I run the app in dev mode, all works fine but when I run it in production mode (build) it fails with: "TypeError: Cannot read properties of undefined (reading
Continue readingSolana/Web3.js: Does @Solana/web3.js support the current price for Solana?
Issue I am currently using the @Solana/web3.js module and want to grab the current price for Solana in order to convert a user’s balance to USD .etc. Solution The @solana/web3.js module currently concerns itself solely with interacting with native Solana
Continue readingWeb3.js Script exits while listening to CreatedPairs
Issue I am trying to create a simple script to test the event listening functionality of Web3.js CreatedPairs. However, my script runs through the code once and then exits instead of continuing to listen for created pairs and I cannot
Continue readingHow can I validate a Solana wallet address with web3js?
Issue I’m trying to validate that the input text I get from a user is a valid Solana address. According to the web3.js documentation, the method .isOnCurve() does that: https://solana-labs.github.io/solana-web3.js/classes/PublicKey.html#isOnCurve I’ve managed to make it work with this code: import
Continue readingHow to subscribe to Multiple Eth addresses on USDT token transfer events
Issue I have a list of Eth user deposit addresses. They can make External USDT transfers to these addresses. How do I subscribe to the USDT contract and filter for all the User Addresses I have for deposits. My user
Continue reading