@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.
- 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({
|
|
@@ -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
|
}
|