@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.
- package/dist/cjs/sdk/accounts/CreditAccountsServiceV310.js +4 -2
- package/dist/cjs/sdk/router/RouterV310Contract.js +5 -0
- package/dist/esm/sdk/accounts/CreditAccountsServiceV310.js +4 -2
- package/dist/esm/sdk/router/RouterV310Contract.js +5 -0
- package/dist/types/sdk/accounts/CreditAccountsServiceV310.d.ts +1 -1
- package/dist/types/sdk/accounts/types.d.ts +1 -0
- package/dist/types/sdk/router/types.d.ts +1 -0
- package/package.json +1 -1
|
@@ -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
|
}
|