Skip to content

Instantly share code, notes, and snippets.

View DevlinDefi's full-sized avatar
🎯
Focusing

DevlinDefi

🎯
Focusing
View GitHub Profile
@dsemenovsky
dsemenovsky / getConfirmations.js
Created June 1, 2018 23:58
Get Ethereum transaction confirmations count
async function getConfirmations(txHash) {
try {
// Instantiate web3 with HttpProvider
const web3 = new Web3('https://rinkeby.infura.io/')
// Get transaction details
const trx = await web3.eth.getTransaction(txHash)
// Get current block number
const currentBlock = await web3.eth.getBlockNumber()