diff --git a/lib/index.js b/lib/index.js index ec08100..6054f39 100644 --- a/lib/index.js +++ b/lib/index.js @@ -13,16 +13,15 @@ class TokenTracker extends SafeEventEmitter { this.includeFailedTokens = opts.includeFailedTokens || false this.userAddress = opts.userAddress || '0x0' - this.provider = opts.provider const pollingInterval = opts.pollingInterval || 4000 this.blockTracker = new PollingBlockTracker({ - provider: this.provider, + provider: opts.provider, pollingInterval, }) - this.eth = new Eth(this.provider) - this.contract = new EthContract(this.eth) - this.TokenContract = this.contract(abi) + const eth = new Eth(opts.provider) + const contract = new EthContract(eth) + this.TokenContract = contract(abi) const tokens = opts.tokens || [] this.balanceDecimals = opts.balanceDecimals