@gearbox-protocol/sdk 11.1.4 → 11.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -146,9 +146,16 @@ class RouterV310Contract extends import_AbstractRouterContract.AbstractRouterCon
|
|
|
146
146
|
* Implements {@link IRouterContract.findClaimAllRewards}
|
|
147
147
|
*/
|
|
148
148
|
async findClaimAllRewards(props) {
|
|
149
|
-
const
|
|
149
|
+
const record = props.tokensToClaim.reduce(
|
|
150
|
+
(acc, a) => {
|
|
151
|
+
acc[a.token.toLowerCase()] = a;
|
|
152
|
+
return acc;
|
|
153
|
+
},
|
|
154
|
+
{}
|
|
155
|
+
);
|
|
156
|
+
const tData = props.creditAccount.tokens.map((a) => ({
|
|
150
157
|
balance: 0n,
|
|
151
|
-
claimRewards:
|
|
158
|
+
claimRewards: !!record[a.token.toLowerCase()],
|
|
152
159
|
leftoverBalance: 0n,
|
|
153
160
|
numSplits: 1n,
|
|
154
161
|
token: a.token
|
|
@@ -123,9 +123,16 @@ class RouterV310Contract extends AbstractRouterContract {
|
|
|
123
123
|
* Implements {@link IRouterContract.findClaimAllRewards}
|
|
124
124
|
*/
|
|
125
125
|
async findClaimAllRewards(props) {
|
|
126
|
-
const
|
|
126
|
+
const record = props.tokensToClaim.reduce(
|
|
127
|
+
(acc, a) => {
|
|
128
|
+
acc[a.token.toLowerCase()] = a;
|
|
129
|
+
return acc;
|
|
130
|
+
},
|
|
131
|
+
{}
|
|
132
|
+
);
|
|
133
|
+
const tData = props.creditAccount.tokens.map((a) => ({
|
|
127
134
|
balance: 0n,
|
|
128
|
-
claimRewards:
|
|
135
|
+
claimRewards: !!record[a.token.toLowerCase()],
|
|
129
136
|
leftoverBalance: 0n,
|
|
130
137
|
numSplits: 1n,
|
|
131
138
|
token: a.token
|