Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

web3.js get balance

// Get the Balance of an address on the Ropsten Ethereum TestNet
const Web3 = require('web3');
const infuraProjectId = "<INFURA_PROJECT_ID>";
const ropstenAddress = "<0xROPSTEN_ADDRESS>";
const web3 = new Web3(new Web3.providers.HttpProvider(
    'https://ropsten.infura.io/v3/' + infuraProjectId
));
web3.eth.getBalance( ropstenAddress ).then(console.log);

// REFERENCES:
// https://blog.infura.io/getting-started-with-infura-28e41844cc89/
 
PREVIOUS NEXT
Tagged: #balance
ADD COMMENT
Topic
Name
9+7 =