@gearbox-protocol/sdk 8.4.0 → 8.4.2
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.
|
@@ -120,7 +120,7 @@ class PriceFeedRegister extends import_base.SDKConstruct {
|
|
|
120
120
|
// @ts-expect-error
|
|
121
121
|
gas: this.sdk.gasLimit
|
|
122
122
|
});
|
|
123
|
-
const feedContracts = result.map((data) => this
|
|
123
|
+
const feedContracts = result.map((data) => this.#createUpdatableProxy(data));
|
|
124
124
|
return this.generatePriceFeedsUpdateTxs(feedContracts);
|
|
125
125
|
}
|
|
126
126
|
has(address) {
|
|
@@ -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
|
/**
|
|
@@ -103,7 +103,7 @@ class PriceFeedRegister extends SDKConstruct {
|
|
|
103
103
|
// @ts-expect-error
|
|
104
104
|
gas: this.sdk.gasLimit
|
|
105
105
|
});
|
|
106
|
-
const feedContracts = result.map((data) => this
|
|
106
|
+
const feedContracts = result.map((data) => this.#createUpdatableProxy(data));
|
|
107
107
|
return this.generatePriceFeedsUpdateTxs(feedContracts);
|
|
108
108
|
}
|
|
109
109
|
has(address) {
|
|
@@ -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
|
/**
|