@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 tData = props.tokensToClaim.map((a) => ({
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: true,
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 tData = props.tokensToClaim.map((a) => ({
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: true,
135
+ claimRewards: !!record[a.token.toLowerCase()],
129
136
  leftoverBalance: 0n,
130
137
  numSplits: 1n,
131
138
  token: a.token
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/sdk",
3
- "version": "11.1.4",
3
+ "version": "11.1.5",
4
4
  "description": "Gearbox SDK",
5
5
  "license": "MIT",
6
6
  "main": "./dist/cjs/sdk/index.js",