i try to get the contract balance and im using this
var Web3 = require('web3')
var web3 = new Web3('ropsten.infura.io/v3/123456789')
var abi = abi is here ;
var contractAddress = '0x31111.....';
var contract = new web3.eth.Contract(abi, contractAddress);
//var address = '0x31111......';
web3.eth.getBalance(contract.address, function (e, r) {
$('contractBalanceAgi').text(convertWeiToEth(r).toFixed(4))
})
and when running this i get following error in my console web3.eth.Contract is not a constructor
when i googled for it some said its because of the new web3 js version but the new web3 version requires this var contract = new web3.eth.Contract(abi, contractAddress) new and capital C
console.log("Web3 version", web3.version);
? I have a hunch you are running a different Web3 version than you think.