Skip to content

Instantly share code, notes, and snippets.

View VanijaDev's full-sized avatar

Ivan Solo VanijaDev

View GitHub Profile
@VanijaDev
VanijaDev / getTransactionReceiptMined.js
Created April 19, 2018 12:16 — forked from xavierlepretre/getTransactionReceiptMined.js
Get the Promise of an Ethereum transaction receipt when it is finally mined
module.exports = function getTransactionReceiptMined(txHash, interval, blockLimit) {
const self = this;
var count = 0;
var blocks = blockLimit;
const transactionReceiptAsync = function (resolve, reject) {
if (count > blocks) {
reject('Contract transaction couldn\'t be found after ', blocks, ' blocks');
return;
}