@indexed-finance/indexed.js
Advanced tools
Comparing version 1.1.4 to 1.1.5
@@ -146,6 +146,7 @@ "use strict"; | ||
return __awaiter(this, void 0, void 0, function () { | ||
var calls, fromBlock, toBlock, MultiTokenStakingInterface, IERC20Interface, _i, _a, pool, multi, result, increment, i, rI, pool, poolInfo, allocPoint, userInfo, _b, _c, pool; | ||
var userAddress, calls, fromBlock, toBlock, MultiTokenStakingInterface, IERC20Interface, _i, _a, pool, multi, result, increment, i, rI, pool, poolInfo, allocPoint, userInfo, _b, _c, pool; | ||
return __generator(this, function (_d) { | ||
switch (_d.label) { | ||
case 0: | ||
userAddress = this.userAddress; | ||
calls = []; | ||
@@ -176,7 +177,7 @@ fromBlock = __spreadArrays(this.pools).sort(function (a, b) { return b.lastRewardBlock - a.lastRewardBlock; })[0].lastRewardBlock; | ||
}); | ||
if (this.userAddress) { | ||
if (userAddress) { | ||
calls.push({ | ||
target: this.meta.id, | ||
function: 'userInfo', | ||
args: [pool.id, this.userAddress], | ||
args: [pool.id, userAddress], | ||
interface: MultiTokenStakingInterface | ||
@@ -187,3 +188,3 @@ }); | ||
function: 'pendingRewards', | ||
args: [pool.id, this.userAddress], | ||
args: [pool.id, userAddress], | ||
interface: MultiTokenStakingInterface | ||
@@ -195,3 +196,3 @@ }); | ||
interface: IERC20Interface, | ||
args: [this.userAddress] | ||
args: [userAddress] | ||
}); | ||
@@ -202,3 +203,3 @@ calls.push({ | ||
interface: IERC20Interface, | ||
args: [this.userAddress, this.meta.id] | ||
args: [userAddress, this.meta.id] | ||
}); | ||
@@ -213,3 +214,3 @@ } | ||
this.meta.totalAllocPoint = 0; | ||
increment = this.userAddress ? 6 : 2; | ||
increment = userAddress ? 6 : 2; | ||
for (i = 0; i < this.pools.length; i++) { | ||
@@ -224,3 +225,3 @@ rI = i * increment; | ||
pool.totalStaked = bignumber_1.toBN(result[rI + 2]); | ||
if (this.userAddress) { | ||
if (userAddress) { | ||
userInfo = result[rI + 3]; | ||
@@ -227,0 +228,0 @@ pool.userStakedBalance = bignumber_1.toBN(userInfo[0]); |
{ | ||
"name": "@indexed-finance/indexed.js", | ||
"version": "1.1.4", | ||
"version": "1.1.5", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
361130
9577