@gearbox-protocol/sdk 10.4.3 → 10.4.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.
@@ -172,14 +172,16 @@ class CreditAccountServiceV310 extends import_AbstractCreditAccountsService.Abst
172
172
  creditAccount: ca,
173
173
  minQuota,
174
174
  averageQuota,
175
- tokensToClaim
175
+ tokensToClaim,
176
+ forceCalls
176
177
  }) {
177
178
  const cm = this.sdk.marketRegister.findCreditManager(ca.creditManager);
178
179
  const router = this.sdk.routerFor(ca);
179
180
  const claimPath = await router.findClaimAllRewards({
180
181
  calls: legacyCalls,
181
182
  tokensToClaim,
182
- creditAccount: ca
183
+ creditAccount: ca,
184
+ forceCalls
183
185
  });
184
186
  if (claimPath.calls.length === 0) throw new Error("No path to execute");
185
187
  const priceUpdatesCalls = await this.getPriceUpdatesForFacade({
@@ -157,6 +157,11 @@ class RouterV310Contract extends import_AbstractRouterContract.AbstractRouterCon
157
157
  props.creditAccount.creditAccount,
158
158
  tData
159
159
  ]);
160
+ if (props.calls.length > 0 && result.length === 0 && !!props.forceCalls) {
161
+ return {
162
+ calls: [...props.calls]
163
+ };
164
+ }
160
165
  return {
161
166
  calls: [...result]
162
167
  };
@@ -149,14 +149,16 @@ class CreditAccountServiceV310 extends AbstractCreditAccountService {
149
149
  creditAccount: ca,
150
150
  minQuota,
151
151
  averageQuota,
152
- tokensToClaim
152
+ tokensToClaim,
153
+ forceCalls
153
154
  }) {
154
155
  const cm = this.sdk.marketRegister.findCreditManager(ca.creditManager);
155
156
  const router = this.sdk.routerFor(ca);
156
157
  const claimPath = await router.findClaimAllRewards({
157
158
  calls: legacyCalls,
158
159
  tokensToClaim,
159
- creditAccount: ca
160
+ creditAccount: ca,
161
+ forceCalls
160
162
  });
161
163
  if (claimPath.calls.length === 0) throw new Error("No path to execute");
162
164
  const priceUpdatesCalls = await this.getPriceUpdatesForFacade({
@@ -134,6 +134,11 @@ class RouterV310Contract extends AbstractRouterContract {
134
134
  props.creditAccount.creditAccount,
135
135
  tData
136
136
  ]);
137
+ if (props.calls.length > 0 && result.length === 0 && !!props.forceCalls) {
138
+ return {
139
+ calls: [...props.calls]
140
+ };
141
+ }
137
142
  return {
138
143
  calls: [...result]
139
144
  };
@@ -20,5 +20,5 @@ export declare class CreditAccountServiceV310 extends AbstractCreditAccountServi
20
20
  /**
21
21
  * Implements {@link ICreditAccountsService.claimFarmRewards}
22
22
  */
23
- claimFarmRewards({ calls: legacyCalls, creditAccount: ca, minQuota, averageQuota, tokensToClaim, }: ClaimFarmRewardsProps): Promise<CreditAccountOperationResult>;
23
+ claimFarmRewards({ calls: legacyCalls, creditAccount: ca, minQuota, averageQuota, tokensToClaim, forceCalls, }: ClaimFarmRewardsProps): Promise<CreditAccountOperationResult>;
24
24
  }
@@ -234,6 +234,7 @@ export interface ClaimFarmRewardsProps extends PrepareUpdateQuotasProps {
234
234
  */
235
235
  creditAccount: RouterCASlice;
236
236
  tokensToClaim: Asset[];
237
+ forceCalls?: boolean;
237
238
  }
238
239
  export interface EnableTokensProps {
239
240
  /**
@@ -188,6 +188,7 @@ export interface FindClaimAllRewardsProps {
188
188
  * Legacy property - array of MultiCall from getRewards
189
189
  */
190
190
  calls: Array<MultiCall>;
191
+ forceCalls?: boolean;
191
192
  }
192
193
  export interface FindBestClosePathProps {
193
194
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/sdk",
3
- "version": "10.4.3",
3
+ "version": "10.4.5",
4
4
  "description": "Gearbox SDK",
5
5
  "license": "MIT",
6
6
  "main": "./dist/cjs/sdk/index.js",