@gearbox-protocol/sdk 3.0.0-next.237 → 3.0.0-next.239
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/contracts/index.sol +4 -0
- package/lib/apy/index.d.ts +0 -1
- package/lib/apy/index.js +0 -1
- package/lib/core/creditManager.d.ts +4 -0
- package/lib/core/creditManager.js +40 -0
- package/lib/core/{rewardClaimer.d.ts → rewardClaimer/index.d.ts} +10 -5
- package/lib/core/rewardClaimer/index.js +34 -0
- package/lib/core/{rewardConvex.d.ts → rewardClaimer/rewardConvex.d.ts} +3 -3
- package/lib/core/{rewardConvex.js → rewardClaimer/rewardConvex.js} +6 -7
- package/lib/core/{rewardConvex.spec.js → rewardClaimer/rewardConvex.spec.js} +1 -2
- package/lib/core/rewardClaimer/stakingRewards.d.ts +34 -0
- package/lib/core/rewardClaimer/stakingRewards.js +133 -0
- package/lib/core/strategy.d.ts +2 -1
- package/lib/core/strategy.js +4 -2
- package/lib/parsers/curveAdapterParser.js +1 -1
- package/lib/parsers/stakingRewardsAdapterParser.d.ts +10 -0
- package/lib/parsers/stakingRewardsAdapterParser.js +35 -0
- package/lib/parsers/txParser.js +4 -0
- package/lib/redstone/api.d.ts +0 -5
- package/lib/redstone/api.js +29 -94
- package/lib/types/IERC20ZapperDeposits.d.ts +80 -0
- package/lib/types/IERC20ZapperDeposits.js +35 -0
- package/lib/types/IStakingRewardsAdapter.d.ts +197 -0
- package/lib/types/IStakingRewardsAdapter.js +139 -0
- package/lib/types/IZapper.d.ts +38 -0
- package/lib/types/IZapper.js +17 -0
- package/lib/types/index.d.ts +1 -0
- package/lib/types/index.js +1 -0
- package/package.json +6 -6
- package/lib/core/rewardClaimer.js +0 -10
- /package/lib/{apy/auraAPY.d.ts → core/rewardClaimer/aura.d.ts} +0 -0
- /package/lib/{apy/auraAPY.js → core/rewardClaimer/aura.js} +0 -0
- /package/lib/{apy → core/rewardClaimer}/auraAbi.d.ts +0 -0
- /package/lib/{apy → core/rewardClaimer}/auraAbi.js +0 -0
- /package/lib/{apy/convexAPY.d.ts → core/rewardClaimer/convex.d.ts} +0 -0
- /package/lib/{apy/convexAPY.js → core/rewardClaimer/convex.js} +0 -0
- /package/lib/core/{rewardConvex.spec.d.ts → rewardClaimer/rewardConvex.spec.d.ts} +0 -0
package/lib/redstone/api.js
CHANGED
|
@@ -90,89 +90,6 @@ class RedstoneApi {
|
|
|
90
90
|
}
|
|
91
91
|
return chunks;
|
|
92
92
|
};
|
|
93
|
-
static getRedstonePriceFeedsSDK = async ({ priceOracleAddress, currentTokenData, provider, network, }) => {
|
|
94
|
-
const allTokens = sdk_gov_1.TypedObjectUtils.entries(currentTokenData);
|
|
95
|
-
const { main: mainRedstone, reserve: reserveRedstone } = allTokens.reduce((acc, [t]) => {
|
|
96
|
-
const { Main, Reserve } = (0, sdk_gov_1.getPriceFeedsByToken)(t, network) || {};
|
|
97
|
-
const notTrusted = Main?.trusted === false;
|
|
98
|
-
const reserveRedstone = Reserve?.type === sdk_gov_1.PriceFeedType.REDSTONE_ORACLE;
|
|
99
|
-
if (notTrusted && reserveRedstone) {
|
|
100
|
-
acc.reserve.push([t, Reserve]);
|
|
101
|
-
}
|
|
102
|
-
if (notTrusted &&
|
|
103
|
-
Reserve?.type === sdk_gov_1.PriceFeedType.COMPOSITE_ORACLE &&
|
|
104
|
-
typeof Reserve.targetToBasePriceFeed !== "string" &&
|
|
105
|
-
Reserve.targetToBasePriceFeed.type === sdk_gov_1.PriceFeedType.REDSTONE_ORACLE) {
|
|
106
|
-
acc.reserve.push([t, Reserve.targetToBasePriceFeed]);
|
|
107
|
-
}
|
|
108
|
-
if (Main?.type === sdk_gov_1.PriceFeedType.REDSTONE_ORACLE) {
|
|
109
|
-
acc.main.push([t, Main]);
|
|
110
|
-
}
|
|
111
|
-
if (Main?.type === sdk_gov_1.PriceFeedType.COMPOSITE_ORACLE &&
|
|
112
|
-
typeof Main.targetToBasePriceFeed !== "string" &&
|
|
113
|
-
Main.targetToBasePriceFeed.type === sdk_gov_1.PriceFeedType.REDSTONE_ORACLE) {
|
|
114
|
-
acc.main.push([t, Main.targetToBasePriceFeed]);
|
|
115
|
-
}
|
|
116
|
-
return acc;
|
|
117
|
-
}, { main: [], reserve: [] });
|
|
118
|
-
const priceFeedsResp = (await provider.multicall({
|
|
119
|
-
allowFailure: true,
|
|
120
|
-
multicallAddress: sdk_gov_1.MULTICALL_ADDRESS,
|
|
121
|
-
contracts: [
|
|
122
|
-
...mainRedstone.map(([symbol]) => ({
|
|
123
|
-
address: priceOracleAddress,
|
|
124
|
-
abi: types_1.iPriceOracleV3Abi,
|
|
125
|
-
functionName: "priceFeedsRaw",
|
|
126
|
-
args: [currentTokenData[symbol], false],
|
|
127
|
-
})),
|
|
128
|
-
...reserveRedstone.map(([symbol]) => ({
|
|
129
|
-
address: priceOracleAddress,
|
|
130
|
-
abi: types_1.iPriceOracleV3Abi,
|
|
131
|
-
functionName: "priceFeedsRaw",
|
|
132
|
-
args: [currentTokenData[symbol], true],
|
|
133
|
-
})),
|
|
134
|
-
],
|
|
135
|
-
}));
|
|
136
|
-
const mainPFEnd = mainRedstone.length;
|
|
137
|
-
const mainPFAddresses = priceFeedsResp.slice(0, mainPFEnd);
|
|
138
|
-
const mainPFData = this.getRedstonePF_SDK(mainRedstone, mainPFAddresses, currentTokenData, false, network);
|
|
139
|
-
const reservePFEnd = mainPFEnd + reserveRedstone.length;
|
|
140
|
-
const reservePFAddresses = priceFeedsResp.slice(mainPFEnd, reservePFEnd);
|
|
141
|
-
const reservePFData = this.getRedstonePF_SDK(reserveRedstone, reservePFAddresses, currentTokenData, true, network);
|
|
142
|
-
return { main: mainPFData, reserve: reservePFData };
|
|
143
|
-
};
|
|
144
|
-
static getRedstonePF_SDK(sdkPF, addressResponse, currentTokenData, reserve, network) {
|
|
145
|
-
const tickers = sdk_gov_1.tickerInfoTokensByNetwork[network];
|
|
146
|
-
const r = sdkPF.reduce((acc, [symbol, feedData], index) => {
|
|
147
|
-
const { dataId: dataFeedId, dataServiceId } = feedData || {};
|
|
148
|
-
const { result: feedAddress, error: feedError } = addressResponse[index] || {};
|
|
149
|
-
const feedAddressLc = feedAddress?.toLowerCase();
|
|
150
|
-
const hasId = !feedError && typeof feedAddressLc === "string";
|
|
151
|
-
if (hasId && dataFeedId && dataServiceId) {
|
|
152
|
-
const unsafeTicker = tickers[symbol];
|
|
153
|
-
const ticker = unsafeTicker?.priceFeed.toLowerCase() === feedAddressLc
|
|
154
|
-
? unsafeTicker
|
|
155
|
-
: undefined;
|
|
156
|
-
const tokenAddress = currentTokenData[symbol];
|
|
157
|
-
acc.push({
|
|
158
|
-
tickedTokenAddress: (ticker?.address || tokenAddress).toLowerCase(),
|
|
159
|
-
tokenAddress,
|
|
160
|
-
symbol,
|
|
161
|
-
feedAddress: feedAddressLc,
|
|
162
|
-
dataFeedId: dataFeedId,
|
|
163
|
-
tickedDataFeedId: ticker?.dataId || dataFeedId,
|
|
164
|
-
dataServiceId,
|
|
165
|
-
reserve,
|
|
166
|
-
ticker,
|
|
167
|
-
});
|
|
168
|
-
}
|
|
169
|
-
else {
|
|
170
|
-
throw new Error(`Redstone price feed (${symbol}) is missing one or more fields. feed: ${feedAddressLc}, dataFeedId: ${dataFeedId}, dataServiceId: ${dataServiceId}`);
|
|
171
|
-
}
|
|
172
|
-
return acc;
|
|
173
|
-
}, []);
|
|
174
|
-
return r;
|
|
175
|
-
}
|
|
176
93
|
static getRedstonePriceFeeds = async ({ priceOracleAddress, currentTokenData, provider, network, }) => {
|
|
177
94
|
const allTokens = sdk_gov_1.TypedObjectUtils.entries(currentTokenData);
|
|
178
95
|
const feeds = (await provider.multicall({
|
|
@@ -231,6 +148,12 @@ class RedstoneApi {
|
|
|
231
148
|
functionName: "priceFeed0",
|
|
232
149
|
args: [],
|
|
233
150
|
})),
|
|
151
|
+
...notTrustedMainPF.map(([, address]) => ({
|
|
152
|
+
address,
|
|
153
|
+
abi: types_1.compositePriceFeedAbi,
|
|
154
|
+
functionName: "priceFeed1",
|
|
155
|
+
args: [],
|
|
156
|
+
})),
|
|
234
157
|
...reservePF.map(([, address]) => ({
|
|
235
158
|
address,
|
|
236
159
|
abi: types_1.iPriceFeedAbi,
|
|
@@ -243,18 +166,28 @@ class RedstoneApi {
|
|
|
243
166
|
functionName: "priceFeed0",
|
|
244
167
|
args: [],
|
|
245
168
|
})),
|
|
169
|
+
...reservePF.map(([, address]) => ({
|
|
170
|
+
address,
|
|
171
|
+
abi: types_1.compositePriceFeedAbi,
|
|
172
|
+
functionName: "priceFeed1",
|
|
173
|
+
args: [],
|
|
174
|
+
})),
|
|
246
175
|
],
|
|
247
176
|
}));
|
|
248
177
|
const mainFeedsTypeEnd = notTrustedMainPF.length;
|
|
249
178
|
const mainFeedsTypeUnsafe = typeResponse.slice(0, mainFeedsTypeEnd);
|
|
250
179
|
const mainPriceFeed0End = mainFeedsTypeEnd + notTrustedMainPF.length;
|
|
251
180
|
const mainPriceFeed0Unsafe = typeResponse.slice(mainFeedsTypeEnd, mainPriceFeed0End);
|
|
252
|
-
const
|
|
253
|
-
const
|
|
181
|
+
const mainPriceFeed1End = mainPriceFeed0End + notTrustedMainPF.length;
|
|
182
|
+
const mainPriceFeed1Unsafe = typeResponse.slice(mainPriceFeed0End, mainPriceFeed1End);
|
|
183
|
+
const reserveFeedsTypeEnd = mainPriceFeed1End + reservePF.length;
|
|
184
|
+
const reserveFeedsTypeUnsafe = typeResponse.slice(mainPriceFeed1End, reserveFeedsTypeEnd);
|
|
254
185
|
const reservePriceFeed0End = reserveFeedsTypeEnd + reservePF.length;
|
|
255
186
|
const reservePriceFeed0Unsafe = typeResponse.slice(reserveFeedsTypeEnd, reservePriceFeed0End);
|
|
256
|
-
const
|
|
257
|
-
const
|
|
187
|
+
const reservePriceFeed1End = reservePriceFeed0End + reservePF.length;
|
|
188
|
+
const reservePriceFeed1Unsafe = typeResponse.slice(reservePriceFeed0End, reservePriceFeed1End);
|
|
189
|
+
const realNotTrustedMainPriceFeeds = this.getPriceFeedsOfInterest_Onchain(notTrustedMainPF, mainFeedsTypeUnsafe, mainPriceFeed0Unsafe, mainPriceFeed1Unsafe);
|
|
190
|
+
const realReservePriceFeeds = this.getPriceFeedsOfInterest_Onchain(reservePF, reserveFeedsTypeUnsafe, reservePriceFeed0Unsafe, reservePriceFeed1Unsafe);
|
|
258
191
|
const response = (await provider.multicall({
|
|
259
192
|
allowFailure: true,
|
|
260
193
|
multicallAddress: sdk_gov_1.MULTICALL_ADDRESS,
|
|
@@ -303,19 +236,23 @@ class RedstoneApi {
|
|
|
303
236
|
allReserve: sdk_gov_1.TypedObjectUtils.fromEntries(reservePF.map(([s, a]) => [currentTokenData[s], a])),
|
|
304
237
|
};
|
|
305
238
|
};
|
|
306
|
-
static getPriceFeedsOfInterest_Onchain(priceFeeds, feedsTypeResponse, priceFeed0Response) {
|
|
239
|
+
static getPriceFeedsOfInterest_Onchain(priceFeeds, feedsTypeResponse, priceFeed0Response, priceFeed1Response) {
|
|
307
240
|
const result = priceFeeds.reduce((acc, [symbol, baseAddress], index) => {
|
|
308
241
|
const { error: typeError, result: feedType } = feedsTypeResponse[index];
|
|
309
242
|
const { error: feed0Error, result: feed0 } = priceFeed0Response[index];
|
|
243
|
+
const { error: feed1Error, result: feed1 } = priceFeed1Response[index];
|
|
310
244
|
const isRedstone = !typeError && Number(feedType) === sdk_gov_1.PriceFeedType.REDSTONE_ORACLE;
|
|
311
|
-
const isComposite = !typeError && Number(feedType) === sdk_gov_1.PriceFeedType.COMPOSITE_ORACLE;
|
|
312
245
|
if (isRedstone) {
|
|
313
246
|
acc.push([symbol, baseAddress]);
|
|
314
247
|
}
|
|
315
248
|
const hasFeed0 = !feed0Error && typeof feed0 === "string";
|
|
316
|
-
if (
|
|
249
|
+
if (hasFeed0) {
|
|
317
250
|
acc.push([symbol, feed0]);
|
|
318
251
|
}
|
|
252
|
+
const hasFeed1 = !feed1Error && typeof feed1 === "string";
|
|
253
|
+
if (hasFeed1) {
|
|
254
|
+
acc.push([symbol, feed1]);
|
|
255
|
+
}
|
|
319
256
|
return acc;
|
|
320
257
|
}, []);
|
|
321
258
|
return result;
|
|
@@ -336,9 +273,7 @@ class RedstoneApi {
|
|
|
336
273
|
.trim()
|
|
337
274
|
.replace(/\u0000/g, "");
|
|
338
275
|
const unsafeTicker = tickers[symbol];
|
|
339
|
-
const ticker = unsafeTicker?.priceFeed.toLowerCase() === feedAddressLc
|
|
340
|
-
? unsafeTicker
|
|
341
|
-
: undefined;
|
|
276
|
+
const ticker = unsafeTicker?.find(t => t.priceFeed.toLowerCase() === feedAddressLc);
|
|
342
277
|
const tokenAddress = currentTokenData[symbol];
|
|
343
278
|
const defaultDataId = REDSTONE_DICTIONARY[id] || id;
|
|
344
279
|
acc.push({
|
|
@@ -349,7 +284,7 @@ class RedstoneApi {
|
|
|
349
284
|
dataFeedId: defaultDataId,
|
|
350
285
|
tickedDataFeedId: ticker?.dataId || defaultDataId,
|
|
351
286
|
dataServiceId: dataServiceId || exports.DEFAULT_DATA_SERVICE_ID,
|
|
352
|
-
reserve,
|
|
287
|
+
reserve: ticker ? ticker.reserve : reserve,
|
|
353
288
|
ticker,
|
|
354
289
|
});
|
|
355
290
|
}
|
|
@@ -50,6 +50,44 @@ export declare const ierc20ZapperDepositsAbi: readonly [{
|
|
|
50
50
|
readonly type: "uint256";
|
|
51
51
|
}];
|
|
52
52
|
readonly stateMutability: "nonpayable";
|
|
53
|
+
}, {
|
|
54
|
+
readonly type: "function";
|
|
55
|
+
readonly inputs: readonly [{
|
|
56
|
+
readonly name: "tokenInAmount";
|
|
57
|
+
readonly internalType: "uint256";
|
|
58
|
+
readonly type: "uint256";
|
|
59
|
+
}, {
|
|
60
|
+
readonly name: "receiver";
|
|
61
|
+
readonly internalType: "address";
|
|
62
|
+
readonly type: "address";
|
|
63
|
+
}, {
|
|
64
|
+
readonly name: "nonce";
|
|
65
|
+
readonly internalType: "uint256";
|
|
66
|
+
readonly type: "uint256";
|
|
67
|
+
}, {
|
|
68
|
+
readonly name: "expiry";
|
|
69
|
+
readonly internalType: "uint256";
|
|
70
|
+
readonly type: "uint256";
|
|
71
|
+
}, {
|
|
72
|
+
readonly name: "v";
|
|
73
|
+
readonly internalType: "uint8";
|
|
74
|
+
readonly type: "uint8";
|
|
75
|
+
}, {
|
|
76
|
+
readonly name: "r";
|
|
77
|
+
readonly internalType: "bytes32";
|
|
78
|
+
readonly type: "bytes32";
|
|
79
|
+
}, {
|
|
80
|
+
readonly name: "s";
|
|
81
|
+
readonly internalType: "bytes32";
|
|
82
|
+
readonly type: "bytes32";
|
|
83
|
+
}];
|
|
84
|
+
readonly name: "depositWithPermitAllowed";
|
|
85
|
+
readonly outputs: readonly [{
|
|
86
|
+
readonly name: "tokenOutAmount";
|
|
87
|
+
readonly internalType: "uint256";
|
|
88
|
+
readonly type: "uint256";
|
|
89
|
+
}];
|
|
90
|
+
readonly stateMutability: "nonpayable";
|
|
53
91
|
}, {
|
|
54
92
|
readonly type: "function";
|
|
55
93
|
readonly inputs: readonly [{
|
|
@@ -110,4 +148,46 @@ export declare const ierc20ZapperDepositsAbi: readonly [{
|
|
|
110
148
|
readonly type: "uint256";
|
|
111
149
|
}];
|
|
112
150
|
readonly stateMutability: "nonpayable";
|
|
151
|
+
}, {
|
|
152
|
+
readonly type: "function";
|
|
153
|
+
readonly inputs: readonly [{
|
|
154
|
+
readonly name: "tokenInAmount";
|
|
155
|
+
readonly internalType: "uint256";
|
|
156
|
+
readonly type: "uint256";
|
|
157
|
+
}, {
|
|
158
|
+
readonly name: "receiver";
|
|
159
|
+
readonly internalType: "address";
|
|
160
|
+
readonly type: "address";
|
|
161
|
+
}, {
|
|
162
|
+
readonly name: "referralCode";
|
|
163
|
+
readonly internalType: "uint256";
|
|
164
|
+
readonly type: "uint256";
|
|
165
|
+
}, {
|
|
166
|
+
readonly name: "nonce";
|
|
167
|
+
readonly internalType: "uint256";
|
|
168
|
+
readonly type: "uint256";
|
|
169
|
+
}, {
|
|
170
|
+
readonly name: "expiry";
|
|
171
|
+
readonly internalType: "uint256";
|
|
172
|
+
readonly type: "uint256";
|
|
173
|
+
}, {
|
|
174
|
+
readonly name: "v";
|
|
175
|
+
readonly internalType: "uint8";
|
|
176
|
+
readonly type: "uint8";
|
|
177
|
+
}, {
|
|
178
|
+
readonly name: "r";
|
|
179
|
+
readonly internalType: "bytes32";
|
|
180
|
+
readonly type: "bytes32";
|
|
181
|
+
}, {
|
|
182
|
+
readonly name: "s";
|
|
183
|
+
readonly internalType: "bytes32";
|
|
184
|
+
readonly type: "bytes32";
|
|
185
|
+
}];
|
|
186
|
+
readonly name: "depositWithReferralAndPermitAllowed";
|
|
187
|
+
readonly outputs: readonly [{
|
|
188
|
+
readonly name: "tokenOutAmount";
|
|
189
|
+
readonly internalType: "uint256";
|
|
190
|
+
readonly type: "uint256";
|
|
191
|
+
}];
|
|
192
|
+
readonly stateMutability: "nonpayable";
|
|
113
193
|
}];
|
|
@@ -33,6 +33,23 @@ exports.ierc20ZapperDepositsAbi = [
|
|
|
33
33
|
],
|
|
34
34
|
stateMutability: "nonpayable",
|
|
35
35
|
},
|
|
36
|
+
{
|
|
37
|
+
type: "function",
|
|
38
|
+
inputs: [
|
|
39
|
+
{ name: "tokenInAmount", internalType: "uint256", type: "uint256" },
|
|
40
|
+
{ name: "receiver", internalType: "address", type: "address" },
|
|
41
|
+
{ name: "nonce", internalType: "uint256", type: "uint256" },
|
|
42
|
+
{ name: "expiry", internalType: "uint256", type: "uint256" },
|
|
43
|
+
{ name: "v", internalType: "uint8", type: "uint8" },
|
|
44
|
+
{ name: "r", internalType: "bytes32", type: "bytes32" },
|
|
45
|
+
{ name: "s", internalType: "bytes32", type: "bytes32" },
|
|
46
|
+
],
|
|
47
|
+
name: "depositWithPermitAllowed",
|
|
48
|
+
outputs: [
|
|
49
|
+
{ name: "tokenOutAmount", internalType: "uint256", type: "uint256" },
|
|
50
|
+
],
|
|
51
|
+
stateMutability: "nonpayable",
|
|
52
|
+
},
|
|
36
53
|
{
|
|
37
54
|
type: "function",
|
|
38
55
|
inputs: [
|
|
@@ -63,4 +80,22 @@ exports.ierc20ZapperDepositsAbi = [
|
|
|
63
80
|
],
|
|
64
81
|
stateMutability: "nonpayable",
|
|
65
82
|
},
|
|
83
|
+
{
|
|
84
|
+
type: "function",
|
|
85
|
+
inputs: [
|
|
86
|
+
{ name: "tokenInAmount", internalType: "uint256", type: "uint256" },
|
|
87
|
+
{ name: "receiver", internalType: "address", type: "address" },
|
|
88
|
+
{ name: "referralCode", internalType: "uint256", type: "uint256" },
|
|
89
|
+
{ name: "nonce", internalType: "uint256", type: "uint256" },
|
|
90
|
+
{ name: "expiry", internalType: "uint256", type: "uint256" },
|
|
91
|
+
{ name: "v", internalType: "uint8", type: "uint8" },
|
|
92
|
+
{ name: "r", internalType: "bytes32", type: "bytes32" },
|
|
93
|
+
{ name: "s", internalType: "bytes32", type: "bytes32" },
|
|
94
|
+
],
|
|
95
|
+
name: "depositWithReferralAndPermitAllowed",
|
|
96
|
+
outputs: [
|
|
97
|
+
{ name: "tokenOutAmount", internalType: "uint256", type: "uint256" },
|
|
98
|
+
],
|
|
99
|
+
stateMutability: "nonpayable",
|
|
100
|
+
},
|
|
66
101
|
];
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
export declare const iStakingRewardsAdapterAbi: readonly [{
|
|
2
|
+
readonly type: "function";
|
|
3
|
+
readonly inputs: readonly [];
|
|
4
|
+
readonly name: "_gearboxAdapterType";
|
|
5
|
+
readonly outputs: readonly [{
|
|
6
|
+
readonly name: "";
|
|
7
|
+
readonly internalType: "enum AdapterType";
|
|
8
|
+
readonly type: "uint8";
|
|
9
|
+
}];
|
|
10
|
+
readonly stateMutability: "view";
|
|
11
|
+
}, {
|
|
12
|
+
readonly type: "function";
|
|
13
|
+
readonly inputs: readonly [];
|
|
14
|
+
readonly name: "_gearboxAdapterVersion";
|
|
15
|
+
readonly outputs: readonly [{
|
|
16
|
+
readonly name: "";
|
|
17
|
+
readonly internalType: "uint16";
|
|
18
|
+
readonly type: "uint16";
|
|
19
|
+
}];
|
|
20
|
+
readonly stateMutability: "view";
|
|
21
|
+
}, {
|
|
22
|
+
readonly type: "function";
|
|
23
|
+
readonly inputs: readonly [];
|
|
24
|
+
readonly name: "addressProvider";
|
|
25
|
+
readonly outputs: readonly [{
|
|
26
|
+
readonly name: "";
|
|
27
|
+
readonly internalType: "address";
|
|
28
|
+
readonly type: "address";
|
|
29
|
+
}];
|
|
30
|
+
readonly stateMutability: "view";
|
|
31
|
+
}, {
|
|
32
|
+
readonly type: "function";
|
|
33
|
+
readonly inputs: readonly [];
|
|
34
|
+
readonly name: "creditManager";
|
|
35
|
+
readonly outputs: readonly [{
|
|
36
|
+
readonly name: "";
|
|
37
|
+
readonly internalType: "address";
|
|
38
|
+
readonly type: "address";
|
|
39
|
+
}];
|
|
40
|
+
readonly stateMutability: "view";
|
|
41
|
+
}, {
|
|
42
|
+
readonly type: "function";
|
|
43
|
+
readonly inputs: readonly [];
|
|
44
|
+
readonly name: "getReward";
|
|
45
|
+
readonly outputs: readonly [{
|
|
46
|
+
readonly name: "tokensToEnable";
|
|
47
|
+
readonly internalType: "uint256";
|
|
48
|
+
readonly type: "uint256";
|
|
49
|
+
}, {
|
|
50
|
+
readonly name: "tokensToDisable";
|
|
51
|
+
readonly internalType: "uint256";
|
|
52
|
+
readonly type: "uint256";
|
|
53
|
+
}];
|
|
54
|
+
readonly stateMutability: "nonpayable";
|
|
55
|
+
}, {
|
|
56
|
+
readonly type: "function";
|
|
57
|
+
readonly inputs: readonly [];
|
|
58
|
+
readonly name: "rewardsToken";
|
|
59
|
+
readonly outputs: readonly [{
|
|
60
|
+
readonly name: "";
|
|
61
|
+
readonly internalType: "address";
|
|
62
|
+
readonly type: "address";
|
|
63
|
+
}];
|
|
64
|
+
readonly stateMutability: "view";
|
|
65
|
+
}, {
|
|
66
|
+
readonly type: "function";
|
|
67
|
+
readonly inputs: readonly [];
|
|
68
|
+
readonly name: "rewardsTokenMask";
|
|
69
|
+
readonly outputs: readonly [{
|
|
70
|
+
readonly name: "";
|
|
71
|
+
readonly internalType: "uint256";
|
|
72
|
+
readonly type: "uint256";
|
|
73
|
+
}];
|
|
74
|
+
readonly stateMutability: "view";
|
|
75
|
+
}, {
|
|
76
|
+
readonly type: "function";
|
|
77
|
+
readonly inputs: readonly [{
|
|
78
|
+
readonly name: "amount";
|
|
79
|
+
readonly internalType: "uint256";
|
|
80
|
+
readonly type: "uint256";
|
|
81
|
+
}];
|
|
82
|
+
readonly name: "stake";
|
|
83
|
+
readonly outputs: readonly [{
|
|
84
|
+
readonly name: "tokensToEnable";
|
|
85
|
+
readonly internalType: "uint256";
|
|
86
|
+
readonly type: "uint256";
|
|
87
|
+
}, {
|
|
88
|
+
readonly name: "tokensToDisable";
|
|
89
|
+
readonly internalType: "uint256";
|
|
90
|
+
readonly type: "uint256";
|
|
91
|
+
}];
|
|
92
|
+
readonly stateMutability: "nonpayable";
|
|
93
|
+
}, {
|
|
94
|
+
readonly type: "function";
|
|
95
|
+
readonly inputs: readonly [{
|
|
96
|
+
readonly name: "leftoverAmount";
|
|
97
|
+
readonly internalType: "uint256";
|
|
98
|
+
readonly type: "uint256";
|
|
99
|
+
}];
|
|
100
|
+
readonly name: "stakeDiff";
|
|
101
|
+
readonly outputs: readonly [{
|
|
102
|
+
readonly name: "tokensToEnable";
|
|
103
|
+
readonly internalType: "uint256";
|
|
104
|
+
readonly type: "uint256";
|
|
105
|
+
}, {
|
|
106
|
+
readonly name: "tokensToDisable";
|
|
107
|
+
readonly internalType: "uint256";
|
|
108
|
+
readonly type: "uint256";
|
|
109
|
+
}];
|
|
110
|
+
readonly stateMutability: "nonpayable";
|
|
111
|
+
}, {
|
|
112
|
+
readonly type: "function";
|
|
113
|
+
readonly inputs: readonly [];
|
|
114
|
+
readonly name: "stakedPhantomToken";
|
|
115
|
+
readonly outputs: readonly [{
|
|
116
|
+
readonly name: "";
|
|
117
|
+
readonly internalType: "address";
|
|
118
|
+
readonly type: "address";
|
|
119
|
+
}];
|
|
120
|
+
readonly stateMutability: "view";
|
|
121
|
+
}, {
|
|
122
|
+
readonly type: "function";
|
|
123
|
+
readonly inputs: readonly [];
|
|
124
|
+
readonly name: "stakedPhantomTokenMask";
|
|
125
|
+
readonly outputs: readonly [{
|
|
126
|
+
readonly name: "";
|
|
127
|
+
readonly internalType: "uint256";
|
|
128
|
+
readonly type: "uint256";
|
|
129
|
+
}];
|
|
130
|
+
readonly stateMutability: "view";
|
|
131
|
+
}, {
|
|
132
|
+
readonly type: "function";
|
|
133
|
+
readonly inputs: readonly [];
|
|
134
|
+
readonly name: "stakingToken";
|
|
135
|
+
readonly outputs: readonly [{
|
|
136
|
+
readonly name: "";
|
|
137
|
+
readonly internalType: "address";
|
|
138
|
+
readonly type: "address";
|
|
139
|
+
}];
|
|
140
|
+
readonly stateMutability: "view";
|
|
141
|
+
}, {
|
|
142
|
+
readonly type: "function";
|
|
143
|
+
readonly inputs: readonly [];
|
|
144
|
+
readonly name: "stakingTokenMask";
|
|
145
|
+
readonly outputs: readonly [{
|
|
146
|
+
readonly name: "";
|
|
147
|
+
readonly internalType: "uint256";
|
|
148
|
+
readonly type: "uint256";
|
|
149
|
+
}];
|
|
150
|
+
readonly stateMutability: "view";
|
|
151
|
+
}, {
|
|
152
|
+
readonly type: "function";
|
|
153
|
+
readonly inputs: readonly [];
|
|
154
|
+
readonly name: "targetContract";
|
|
155
|
+
readonly outputs: readonly [{
|
|
156
|
+
readonly name: "";
|
|
157
|
+
readonly internalType: "address";
|
|
158
|
+
readonly type: "address";
|
|
159
|
+
}];
|
|
160
|
+
readonly stateMutability: "view";
|
|
161
|
+
}, {
|
|
162
|
+
readonly type: "function";
|
|
163
|
+
readonly inputs: readonly [{
|
|
164
|
+
readonly name: "amount";
|
|
165
|
+
readonly internalType: "uint256";
|
|
166
|
+
readonly type: "uint256";
|
|
167
|
+
}];
|
|
168
|
+
readonly name: "withdraw";
|
|
169
|
+
readonly outputs: readonly [{
|
|
170
|
+
readonly name: "tokensToEnable";
|
|
171
|
+
readonly internalType: "uint256";
|
|
172
|
+
readonly type: "uint256";
|
|
173
|
+
}, {
|
|
174
|
+
readonly name: "tokensToDisable";
|
|
175
|
+
readonly internalType: "uint256";
|
|
176
|
+
readonly type: "uint256";
|
|
177
|
+
}];
|
|
178
|
+
readonly stateMutability: "nonpayable";
|
|
179
|
+
}, {
|
|
180
|
+
readonly type: "function";
|
|
181
|
+
readonly inputs: readonly [{
|
|
182
|
+
readonly name: "leftoverAmount";
|
|
183
|
+
readonly internalType: "uint256";
|
|
184
|
+
readonly type: "uint256";
|
|
185
|
+
}];
|
|
186
|
+
readonly name: "withdrawDiff";
|
|
187
|
+
readonly outputs: readonly [{
|
|
188
|
+
readonly name: "tokensToEnable";
|
|
189
|
+
readonly internalType: "uint256";
|
|
190
|
+
readonly type: "uint256";
|
|
191
|
+
}, {
|
|
192
|
+
readonly name: "tokensToDisable";
|
|
193
|
+
readonly internalType: "uint256";
|
|
194
|
+
readonly type: "uint256";
|
|
195
|
+
}];
|
|
196
|
+
readonly stateMutability: "nonpayable";
|
|
197
|
+
}];
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
3
|
+
// IStakingRewardsAdapter
|
|
4
|
+
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.iStakingRewardsAdapterAbi = void 0;
|
|
7
|
+
exports.iStakingRewardsAdapterAbi = [
|
|
8
|
+
{
|
|
9
|
+
type: "function",
|
|
10
|
+
inputs: [],
|
|
11
|
+
name: "_gearboxAdapterType",
|
|
12
|
+
outputs: [{ name: "", internalType: "enum AdapterType", type: "uint8" }],
|
|
13
|
+
stateMutability: "view",
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
type: "function",
|
|
17
|
+
inputs: [],
|
|
18
|
+
name: "_gearboxAdapterVersion",
|
|
19
|
+
outputs: [{ name: "", internalType: "uint16", type: "uint16" }],
|
|
20
|
+
stateMutability: "view",
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
type: "function",
|
|
24
|
+
inputs: [],
|
|
25
|
+
name: "addressProvider",
|
|
26
|
+
outputs: [{ name: "", internalType: "address", type: "address" }],
|
|
27
|
+
stateMutability: "view",
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
type: "function",
|
|
31
|
+
inputs: [],
|
|
32
|
+
name: "creditManager",
|
|
33
|
+
outputs: [{ name: "", internalType: "address", type: "address" }],
|
|
34
|
+
stateMutability: "view",
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
type: "function",
|
|
38
|
+
inputs: [],
|
|
39
|
+
name: "getReward",
|
|
40
|
+
outputs: [
|
|
41
|
+
{ name: "tokensToEnable", internalType: "uint256", type: "uint256" },
|
|
42
|
+
{ name: "tokensToDisable", internalType: "uint256", type: "uint256" },
|
|
43
|
+
],
|
|
44
|
+
stateMutability: "nonpayable",
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
type: "function",
|
|
48
|
+
inputs: [],
|
|
49
|
+
name: "rewardsToken",
|
|
50
|
+
outputs: [{ name: "", internalType: "address", type: "address" }],
|
|
51
|
+
stateMutability: "view",
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
type: "function",
|
|
55
|
+
inputs: [],
|
|
56
|
+
name: "rewardsTokenMask",
|
|
57
|
+
outputs: [{ name: "", internalType: "uint256", type: "uint256" }],
|
|
58
|
+
stateMutability: "view",
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
type: "function",
|
|
62
|
+
inputs: [{ name: "amount", internalType: "uint256", type: "uint256" }],
|
|
63
|
+
name: "stake",
|
|
64
|
+
outputs: [
|
|
65
|
+
{ name: "tokensToEnable", internalType: "uint256", type: "uint256" },
|
|
66
|
+
{ name: "tokensToDisable", internalType: "uint256", type: "uint256" },
|
|
67
|
+
],
|
|
68
|
+
stateMutability: "nonpayable",
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
type: "function",
|
|
72
|
+
inputs: [
|
|
73
|
+
{ name: "leftoverAmount", internalType: "uint256", type: "uint256" },
|
|
74
|
+
],
|
|
75
|
+
name: "stakeDiff",
|
|
76
|
+
outputs: [
|
|
77
|
+
{ name: "tokensToEnable", internalType: "uint256", type: "uint256" },
|
|
78
|
+
{ name: "tokensToDisable", internalType: "uint256", type: "uint256" },
|
|
79
|
+
],
|
|
80
|
+
stateMutability: "nonpayable",
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
type: "function",
|
|
84
|
+
inputs: [],
|
|
85
|
+
name: "stakedPhantomToken",
|
|
86
|
+
outputs: [{ name: "", internalType: "address", type: "address" }],
|
|
87
|
+
stateMutability: "view",
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
type: "function",
|
|
91
|
+
inputs: [],
|
|
92
|
+
name: "stakedPhantomTokenMask",
|
|
93
|
+
outputs: [{ name: "", internalType: "uint256", type: "uint256" }],
|
|
94
|
+
stateMutability: "view",
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
type: "function",
|
|
98
|
+
inputs: [],
|
|
99
|
+
name: "stakingToken",
|
|
100
|
+
outputs: [{ name: "", internalType: "address", type: "address" }],
|
|
101
|
+
stateMutability: "view",
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
type: "function",
|
|
105
|
+
inputs: [],
|
|
106
|
+
name: "stakingTokenMask",
|
|
107
|
+
outputs: [{ name: "", internalType: "uint256", type: "uint256" }],
|
|
108
|
+
stateMutability: "view",
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
type: "function",
|
|
112
|
+
inputs: [],
|
|
113
|
+
name: "targetContract",
|
|
114
|
+
outputs: [{ name: "", internalType: "address", type: "address" }],
|
|
115
|
+
stateMutability: "view",
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
type: "function",
|
|
119
|
+
inputs: [{ name: "amount", internalType: "uint256", type: "uint256" }],
|
|
120
|
+
name: "withdraw",
|
|
121
|
+
outputs: [
|
|
122
|
+
{ name: "tokensToEnable", internalType: "uint256", type: "uint256" },
|
|
123
|
+
{ name: "tokensToDisable", internalType: "uint256", type: "uint256" },
|
|
124
|
+
],
|
|
125
|
+
stateMutability: "nonpayable",
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
type: "function",
|
|
129
|
+
inputs: [
|
|
130
|
+
{ name: "leftoverAmount", internalType: "uint256", type: "uint256" },
|
|
131
|
+
],
|
|
132
|
+
name: "withdrawDiff",
|
|
133
|
+
outputs: [
|
|
134
|
+
{ name: "tokensToEnable", internalType: "uint256", type: "uint256" },
|
|
135
|
+
{ name: "tokensToDisable", internalType: "uint256", type: "uint256" },
|
|
136
|
+
],
|
|
137
|
+
stateMutability: "nonpayable",
|
|
138
|
+
},
|
|
139
|
+
];
|