@gearbox-protocol/sdk 10.4.3 → 10.4.4

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({
@@ -146,6 +146,11 @@ class RouterV310Contract extends import_AbstractRouterContract.AbstractRouterCon
146
146
  * Implements {@link IRouterContract.findClaimAllRewards}
147
147
  */
148
148
  async findClaimAllRewards(props) {
149
+ if (props.calls.length > 0 && !!props.forceCalls) {
150
+ return {
151
+ calls: [...props.calls]
152
+ };
153
+ }
149
154
  const tData = props.tokensToClaim.map((a) => ({
150
155
  balance: 0n,
151
156
  claimRewards: true,
@@ -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({
@@ -123,6 +123,11 @@ class RouterV310Contract extends AbstractRouterContract {
123
123
  * Implements {@link IRouterContract.findClaimAllRewards}
124
124
  */
125
125
  async findClaimAllRewards(props) {
126
+ if (props.calls.length > 0 && !!props.forceCalls) {
127
+ return {
128
+ calls: [...props.calls]
129
+ };
130
+ }
126
131
  const tData = props.tokensToClaim.map((a) => ({
127
132
  balance: 0n,
128
133
  claimRewards: true,
@@ -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.4",
4
4
  "description": "Gearbox SDK",
5
5
  "license": "MIT",
6
6
  "main": "./dist/cjs/sdk/index.js",