Categories
Cryptocurrency Ethereum Mastering Development

Web3.js error message in Chrome, “Uncaught ReferenceError, Web is not defined”

I get the following Chrome (console) error when loading a UI for my contract using Web3. Console should print the Web3.js version number. JS is pasted below. Thank you. index.html:76 Uncaught ReferenceError: Web is not defined at index.html:76 (anonymous) @ index.html:76 index.html:110 Using web3 version: 1.2.5 index.html:114 Uncaught ReferenceError: abi is not defined at index.html:114 […]

Categories
Mastering Development

How to store image fetch from url which requires Cookie in nodejs

I’m trying to scrap data from website while scrapping it i’m getting error like file “An error ocured while loading image” while opening image from my server directory.image is stored with extension but the image is not opening properly var request = require(‘request’); var cheerio = require(‘cheerio’); const fs = require(“fs”); function hello (){ url […]

Categories
Cryptocurrency Ethereum Mastering Development

getTransaction sometimes returns null when transaction is pending

I am looking to get real time transaction data as it is broadcasted to the ethereum network, so I have subscribed to pendingTransactions. This only returns the transaction hash though, so I have to call getTransaction on each hash to get more detailed data. const Web3 = require(‘web3’) const web3 = new Web3(‘ws://localhost:8546’); web3.eth.subscribe(‘pendingTransactions’, function(error, […]

Categories
Mastering Development

How to retrieve the final data using promises? [duplicate]

I know this is a duplicated question of How to return many Promises in a loop and wait for them all to do other stuff I did the same thing as thing as it did but im still getting all pending promises. Can someone help me with this? // http requests const getJSON = require(‘get-json’); […]

Categories
Mastering Development

How do i resolve all the collected data after being able to retrieve it? [duplicate]

I have a few issues with my code at the moment. In the init() function I am trying to get the details of each postal code however, its not getting a final accumulated array like i wanted it to be. It currently is able to get one by one. When i try to resolve it, […]

Categories
Mastering Development

Actually Download File from S3 bucket to local machine

I am trying to get an s3 file from my bucket using the following function: async Export() { const myKey = ‘…key…’ const mySecret = ‘…secret…’ AWS.config.update( { accessKeyId: myKey, secretAccessKey: mySecret } ); var s3 = new AWS.S3(); s3.getObject({ Bucket: ‘…bucket…’, Key: ‘…filepath…’ }, function(error, data) { if (error != null) { alert(“Failed to […]

Categories
Mastering Development

Nodemailer working on Localhost, not on live Netlify site

I have used nodemailer/axios to get information from a form to be sent to an e-mail address. When the site is run with localhost:3000 the mail gets sent no problem, although live it does not come through. I am assuming it has to be something to do with the proxy? This is what my code […]

Categories
Development

React – how to handle refresh token requests with nginx proxy

Background My dockerized app requires User Authorizaton in order to fetch his data from Spotify. For that I’m using Auhtorization Code, which needs server-to-server data exchange, that is: I make requests to Spotify’s account services from a backend server, and not from my Client. Examples of how to fetch access token are found everywhere, but […]

Categories
Development

object value coming undefined in node controller function

I’ve created a contact form with angular 7 and integrated it with nodemailer so that upon submitting the form the details of the form should be submitted to an specified email. The view is working fine and passing the values perfectly, but when the values are sent to the node backend it’s coming as undefined […]

Categories
Cryptocurrency Development Ethereum

How to code referral buys?

I have a buy function on my smart contract and this buy function works also with referals. Right now I have only the buy function which defaults to “0x0000…000” how can i make it accept refferals on my UI? async function buy() { var a = document.getElementById(“amount”).value; var b = a *100000000; var accounts= await […]