Comparing version 1.0.0 to 1.1.0
@@ -29,3 +29,3 @@ import { Provider } from "@ethersproject/providers"; | ||
private setValidPairs; | ||
setUserAddress(address: string): void; | ||
setUserAddress(address: string): Promise<void>; | ||
getTokenInfo(token: AddressLike): Token; | ||
@@ -32,0 +32,0 @@ getPairForToken(tokenB_: AddressLike): UniswapPairData; |
@@ -63,2 +63,3 @@ "use strict"; | ||
this.waitForUpdate = this.setValidPairs(); | ||
this.ethBalance = bignumber_1.toBN(0); | ||
} | ||
@@ -75,3 +76,3 @@ Object.defineProperty(UniswapHelper.prototype, "shouldUpdate", { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var uniData, ethBalance; | ||
var uniData; | ||
return __generator(this, function (_a) { | ||
@@ -82,7 +83,3 @@ switch (_a.label) { | ||
uniData = _a.sent(); | ||
return [4 /*yield*/, this.provider.getBalance(this.userAddress)]; | ||
case 2: | ||
ethBalance = _a.sent(); | ||
this.pairs = uniData.pairs; | ||
this.ethBalance = bignumber_1.toBN(ethBalance); | ||
this.tokenABalance = uniData.tokenABalance; | ||
@@ -132,4 +129,16 @@ return [2 /*return*/]; | ||
UniswapHelper.prototype.setUserAddress = function (address) { | ||
this.userAddress = address; | ||
this.waitForUpdate = this.update(); | ||
return __awaiter(this, void 0, void 0, function () { | ||
var ethBalance; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this.provider.getBalance(this.userAddress)]; | ||
case 1: | ||
ethBalance = _a.sent(); | ||
this.userAddress = address; | ||
this.ethBalance = bignumber_1.toBN(ethBalance); | ||
this.waitForUpdate = this.update(); | ||
return [2 /*return*/]; | ||
} | ||
}); | ||
}); | ||
}; | ||
@@ -136,0 +145,0 @@ UniswapHelper.prototype.getTokenInfo = function (token) { |
{ | ||
"name": "ndx-dummy", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
209366
5645