@gearbox-protocol/sdk 8.4.1 → 8.4.3
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/plugins/V300StalenessPeriodPlugin.js +3 -0
- package/dist/cjs/sdk/router/RouterV310Contract.js +8 -13
- package/dist/esm/sdk/plugins/V300StalenessPeriodPlugin.js +3 -0
- package/dist/esm/sdk/router/RouterV310Contract.js +9 -14
- package/dist/types/sdk/plugins/V300StalenessPeriodPlugin.d.ts +1 -0
- package/package.json +1 -1
|
@@ -36,6 +36,9 @@ class V300StalenessPeriodPlugin extends import_BasePlugin.BasePlugin {
|
|
|
36
36
|
super.sdk = sdk;
|
|
37
37
|
this.#syncedTo = import_constants.ADDRESS_PROVIDER_BLOCK[sdk.provider.networkType] - 1n;
|
|
38
38
|
}
|
|
39
|
+
get sdk() {
|
|
40
|
+
return super.sdk;
|
|
41
|
+
}
|
|
39
42
|
get loaded() {
|
|
40
43
|
return !!this.#syncedTo;
|
|
41
44
|
}
|
|
@@ -146,23 +146,18 @@ class RouterV310Contract extends import_AbstractRouterContract.AbstractRouterCon
|
|
|
146
146
|
*/
|
|
147
147
|
async findClaimAllRewards(props) {
|
|
148
148
|
const tData = props.creditAccount.tokens.map((a) => ({
|
|
149
|
-
balance:
|
|
149
|
+
balance: 0n,
|
|
150
150
|
claimRewards: true,
|
|
151
|
-
leftoverBalance:
|
|
152
|
-
numSplits:
|
|
151
|
+
leftoverBalance: 0n,
|
|
152
|
+
numSplits: 1n,
|
|
153
153
|
token: a.token
|
|
154
154
|
}));
|
|
155
|
+
const { result } = await this.contract.simulate.processClaims([
|
|
156
|
+
props.creditAccount.creditAccount,
|
|
157
|
+
tData
|
|
158
|
+
]);
|
|
155
159
|
return {
|
|
156
|
-
calls: [
|
|
157
|
-
{
|
|
158
|
-
target: this.address,
|
|
159
|
-
callData: (0, import_viem.encodeFunctionData)({
|
|
160
|
-
abi: this.abi,
|
|
161
|
-
functionName: "processClaims",
|
|
162
|
-
args: [props.creditAccount.creditAccount, tData]
|
|
163
|
-
})
|
|
164
|
-
}
|
|
165
|
-
]
|
|
160
|
+
calls: [...result]
|
|
166
161
|
};
|
|
167
162
|
}
|
|
168
163
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getAddress } from "viem";
|
|
2
2
|
import { iGearboxRouterV310Abi } from "../../abi/routerV310.js";
|
|
3
3
|
import { BigIntMath } from "../sdk-legacy/index.js";
|
|
4
4
|
import { AddressMap } from "../utils/AddressMap.js";
|
|
@@ -123,23 +123,18 @@ class RouterV310Contract extends AbstractRouterContract {
|
|
|
123
123
|
*/
|
|
124
124
|
async findClaimAllRewards(props) {
|
|
125
125
|
const tData = props.creditAccount.tokens.map((a) => ({
|
|
126
|
-
balance:
|
|
126
|
+
balance: 0n,
|
|
127
127
|
claimRewards: true,
|
|
128
|
-
leftoverBalance:
|
|
129
|
-
numSplits:
|
|
128
|
+
leftoverBalance: 0n,
|
|
129
|
+
numSplits: 1n,
|
|
130
130
|
token: a.token
|
|
131
131
|
}));
|
|
132
|
+
const { result } = await this.contract.simulate.processClaims([
|
|
133
|
+
props.creditAccount.creditAccount,
|
|
134
|
+
tData
|
|
135
|
+
]);
|
|
132
136
|
return {
|
|
133
|
-
calls: [
|
|
134
|
-
{
|
|
135
|
-
target: this.address,
|
|
136
|
-
callData: encodeFunctionData({
|
|
137
|
-
abi: this.abi,
|
|
138
|
-
functionName: "processClaims",
|
|
139
|
-
args: [props.creditAccount.creditAccount, tData]
|
|
140
|
-
})
|
|
141
|
-
}
|
|
142
|
-
]
|
|
137
|
+
calls: [...result]
|
|
143
138
|
};
|
|
144
139
|
}
|
|
145
140
|
/**
|
|
@@ -21,6 +21,7 @@ export interface V300StalenessPeriodPluginState {
|
|
|
21
21
|
export declare class V300StalenessPeriodPlugin extends BasePlugin<V300StalenessPeriodPluginState> implements IGearboxSDKPlugin<V300StalenessPeriodPluginState> {
|
|
22
22
|
#private;
|
|
23
23
|
set sdk(sdk: GearboxSDK<any>);
|
|
24
|
+
get sdk(): GearboxSDK<any>;
|
|
24
25
|
get loaded(): boolean;
|
|
25
26
|
load(force?: boolean): Promise<V300StalenessPeriodPluginState>;
|
|
26
27
|
get state(): V300StalenessPeriodPluginState;
|