Comparing version 1.6.0 to 1.7.0
@@ -15,3 +15,3 @@ import { InitializedPoolUpdate, UniswapPairData } from './types'; | ||
}; | ||
export declare function getUniswapData(provider_: any, tokenA_: AddressLike, tokens: AddressLike[], userAddress?: AddressLike): Promise<UniswapMultiCallReturn>; | ||
export declare function getUniswapData(provider_: any, tokenA_: AddressLike, tokens: AddressLike[], userAddress?: string): Promise<UniswapMultiCallReturn>; | ||
export {}; |
@@ -179,5 +179,5 @@ "use strict"; | ||
return __awaiter(this, void 0, void 0, function () { | ||
var provider, ierc20Abi, pairAbi, multi, calls, tokenA, tokenAddresses, pairAddresses, response, ethBalance, tokenABalance, i, _a, chunks, incr, pairs, j, chunk, tokenB, pairAddress, token0, balanceB, allowanceA, allowanceB, reservesA, reservesB, rI, _b, reserves0, reserves1; | ||
return __generator(this, function (_c) { | ||
switch (_c.label) { | ||
var provider, ierc20Abi, pairAbi, multi, calls, tokenA, tokenAddresses, pairAddresses, response, ethBalance, tokenABalance, i, balance, chunks, incr, pairs, j, chunk, tokenB, pairAddress, token0, balanceB, allowanceA, allowanceB, reservesA, reservesB, rI, _a, reserves0, reserves1; | ||
return __generator(this, function (_b) { | ||
switch (_b.label) { | ||
case 0: | ||
@@ -209,11 +209,12 @@ provider = provider_1.toProvider(provider_); | ||
case 1: | ||
response = _c.sent(); | ||
response = _b.sent(); | ||
ethBalance = bignumber_1.toBN(0); | ||
i = 0; | ||
if (!userAddress) return [3 /*break*/, 3]; | ||
return [4 /*yield*/, provider.getBalance(userAddress)]; | ||
case 2: | ||
balance = _b.sent(); | ||
tokenABalance = bmath.bnum(response[i++]); | ||
_a = bignumber_1.toBN; | ||
return [4 /*yield*/, provider.getBalance('0xccCbF98AE04fD57810F4833fE6a9a5726A162a01')]; | ||
case 2: | ||
ethBalance = _a.apply(void 0, [_c.sent()]); | ||
_c.label = 3; | ||
ethBalance = bignumber_1.toBN(balance); | ||
_b.label = 3; | ||
case 3: | ||
@@ -243,3 +244,3 @@ chunks = []; | ||
console.log("J " + j + " RI " + rI); | ||
_b = chunk[rI], reserves0 = _b[0], reserves1 = _b[1]; | ||
_a = chunk[rI], reserves0 = _a[0], reserves1 = _a[1]; | ||
if (token0 == tokenA) { | ||
@@ -246,0 +247,0 @@ reservesA = bmath.bnum(reserves0); |
@@ -64,3 +64,2 @@ "use strict"; | ||
this.userAddress = userAddress; | ||
this.ethBalance = bignumber_1.toBN(0); | ||
} | ||
@@ -67,0 +66,0 @@ Object.defineProperty(UniswapHelper.prototype, "shouldUpdate", { |
{ | ||
"name": "ndx-dummy", | ||
"version": "1.6.0", | ||
"version": "1.7.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
209320