@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.
Files changed (37) hide show
  1. package/contracts/index.sol +4 -0
  2. package/lib/apy/index.d.ts +0 -1
  3. package/lib/apy/index.js +0 -1
  4. package/lib/core/creditManager.d.ts +4 -0
  5. package/lib/core/creditManager.js +40 -0
  6. package/lib/core/{rewardClaimer.d.ts → rewardClaimer/index.d.ts} +10 -5
  7. package/lib/core/rewardClaimer/index.js +34 -0
  8. package/lib/core/{rewardConvex.d.ts → rewardClaimer/rewardConvex.d.ts} +3 -3
  9. package/lib/core/{rewardConvex.js → rewardClaimer/rewardConvex.js} +6 -7
  10. package/lib/core/{rewardConvex.spec.js → rewardClaimer/rewardConvex.spec.js} +1 -2
  11. package/lib/core/rewardClaimer/stakingRewards.d.ts +34 -0
  12. package/lib/core/rewardClaimer/stakingRewards.js +133 -0
  13. package/lib/core/strategy.d.ts +2 -1
  14. package/lib/core/strategy.js +4 -2
  15. package/lib/parsers/curveAdapterParser.js +1 -1
  16. package/lib/parsers/stakingRewardsAdapterParser.d.ts +10 -0
  17. package/lib/parsers/stakingRewardsAdapterParser.js +35 -0
  18. package/lib/parsers/txParser.js +4 -0
  19. package/lib/redstone/api.d.ts +0 -5
  20. package/lib/redstone/api.js +29 -94
  21. package/lib/types/IERC20ZapperDeposits.d.ts +80 -0
  22. package/lib/types/IERC20ZapperDeposits.js +35 -0
  23. package/lib/types/IStakingRewardsAdapter.d.ts +197 -0
  24. package/lib/types/IStakingRewardsAdapter.js +139 -0
  25. package/lib/types/IZapper.d.ts +38 -0
  26. package/lib/types/IZapper.js +17 -0
  27. package/lib/types/index.d.ts +1 -0
  28. package/lib/types/index.js +1 -0
  29. package/package.json +6 -6
  30. package/lib/core/rewardClaimer.js +0 -10
  31. /package/lib/{apy/auraAPY.d.ts → core/rewardClaimer/aura.d.ts} +0 -0
  32. /package/lib/{apy/auraAPY.js → core/rewardClaimer/aura.js} +0 -0
  33. /package/lib/{apy → core/rewardClaimer}/auraAbi.d.ts +0 -0
  34. /package/lib/{apy → core/rewardClaimer}/auraAbi.js +0 -0
  35. /package/lib/{apy/convexAPY.d.ts → core/rewardClaimer/convex.d.ts} +0 -0
  36. /package/lib/{apy/convexAPY.js → core/rewardClaimer/convex.js} +0 -0
  37. /package/lib/core/{rewardConvex.spec.d.ts → rewardClaimer/rewardConvex.spec.d.ts} +0 -0
@@ -72,6 +72,10 @@ import {ICurveV1_3AssetsAdapter} from
72
72
  import {ICurveV1_4AssetsAdapter} from
73
73
  "@gearbox-protocol/integrations-v3/contracts/interfaces/curve/ICurveV1_4AssetsAdapter.sol";
74
74
 
75
+ import {IStakingRewardsAdapter} from
76
+ "@gearbox-protocol/integrations-v3/contracts/interfaces/sky/IStakingRewardsAdapter.sol";
77
+
78
+
75
79
 
76
80
  import {IMulticall3} from "@gearbox-protocol/router-v3/lib/forge-std/src/interfaces/IMulticall3.sol";
77
81
  import {IRouterV3} from "@gearbox-protocol/router-v3/contracts/interfaces/IRouterV3.sol";
@@ -9,7 +9,6 @@ export type TokensWithApyRecord = PartialRecord<TokensWithAPY, number>;
9
9
  export declare const isTokenWithAPY: (t: unknown) => t is TokensWithAPY;
10
10
  export type AllLPTokens = LPTokens | ExtraFarmTokens;
11
11
  export declare const isFarmToken: (t: unknown) => t is AllLPTokens;
12
- export * from "./convexAPY";
13
12
  export * from "./curveAPY";
14
13
  export * from "./defiLamaAPY";
15
14
  export * from "./lidoAPY";
package/lib/apy/index.js CHANGED
@@ -83,7 +83,6 @@ const isFarmToken = (t) => {
83
83
  return (0, sdk_gov_1.isLPToken)(t) || (0, exports.isExtraFarmToken)(t);
84
84
  };
85
85
  exports.isFarmToken = isFarmToken;
86
- __exportStar(require("./convexAPY"), exports);
87
86
  __exportStar(require("./curveAPY"), exports);
88
87
  __exportStar(require("./defiLamaAPY"), exports);
89
88
  __exportStar(require("./lidoAPY"), exports);
@@ -49,7 +49,11 @@ export declare class CreditManagerData {
49
49
  encodeDisableTokenV3(token: Address): MultiCall;
50
50
  encodeUpdateQuotaV3(token: Address, quotaChange: bigint, minQuota: bigint): MultiCall;
51
51
  encodeWithdrawCollateralV3(token: Address, amount: bigint, to: Address): MultiCall;
52
+ static withdrawAndUnwrap_Convex(address: Address, amount: bigint, claim: boolean): MultiCall;
52
53
  static withdrawAllAndUnwrap_Convex(address: Address, claim: boolean): MultiCall;
54
+ static withdrawAll_Rewards(address: Address): MultiCall;
55
+ static withdraw_Rewards(address: Address, amount: bigint): MultiCall;
56
+ static claim_Rewards(address: Address): MultiCall;
53
57
  encodeOnDemandPriceUpdateV3(token: Address, reserve: boolean, data: Address): MultiCall;
54
58
  static getTier(name: string): number;
55
59
  static getType(name: string): CreditManagerType;
@@ -211,6 +211,16 @@ class CreditManagerData {
211
211
  }),
212
212
  };
213
213
  }
214
+ static withdrawAndUnwrap_Convex(address, amount, claim) {
215
+ return {
216
+ target: address,
217
+ callData: (0, viem_1.encodeFunctionData)({
218
+ abi: types_1.iConvexV1BaseRewardPoolAdapterAbi,
219
+ functionName: "withdrawAndUnwrap",
220
+ args: [amount, claim],
221
+ }),
222
+ };
223
+ }
214
224
  static withdrawAllAndUnwrap_Convex(address, claim) {
215
225
  return {
216
226
  target: address,
@@ -221,6 +231,36 @@ class CreditManagerData {
221
231
  }),
222
232
  };
223
233
  }
234
+ static withdrawAll_Rewards(address) {
235
+ return {
236
+ target: address,
237
+ callData: (0, viem_1.encodeFunctionData)({
238
+ abi: types_1.iStakingRewardsAdapterAbi,
239
+ functionName: "withdrawDiff",
240
+ args: [1n],
241
+ }),
242
+ };
243
+ }
244
+ static withdraw_Rewards(address, amount) {
245
+ return {
246
+ target: address,
247
+ callData: (0, viem_1.encodeFunctionData)({
248
+ abi: types_1.iStakingRewardsAdapterAbi,
249
+ functionName: "withdraw",
250
+ args: [amount],
251
+ }),
252
+ };
253
+ }
254
+ static claim_Rewards(address) {
255
+ return {
256
+ target: address,
257
+ callData: (0, viem_1.encodeFunctionData)({
258
+ abi: types_1.iStakingRewardsAdapterAbi,
259
+ functionName: "getReward",
260
+ args: [],
261
+ }),
262
+ };
263
+ }
224
264
  encodeOnDemandPriceUpdateV3(token, reserve, data) {
225
265
  return {
226
266
  target: this.creditFacade,
@@ -1,12 +1,11 @@
1
1
  import { NetworkType, PartialRecord, Protocols, SupportedContract, SupportedToken } from "@gearbox-protocol/sdk-gov";
2
2
  import { Address, PublicClient } from "viem";
3
- import { MultiCall } from "../pathfinder/core";
4
- import { CreditAccountData } from "./creditAccount";
5
- import { CreditManagerData } from "./creditManager";
3
+ import { MultiCall } from "../../pathfinder/core";
4
+ import { CreditAccountData } from "../creditAccount";
5
+ import { CreditManagerData } from "../creditManager";
6
6
  export interface Rewards {
7
7
  contract: SupportedContract;
8
- totalSupply: bigint;
9
- protocol: Protocols.Aura | Protocols.Convex;
8
+ protocol: Protocols.Aura | Protocols.Convex | Protocols.Sky;
10
9
  rewards: PartialRecord<SupportedToken, bigint>;
11
10
  calls: Array<MultiCall>;
12
11
  }
@@ -17,4 +16,10 @@ export interface AdapterWithType {
17
16
  }
18
17
  export declare class RewardClaimer {
19
18
  static findRewards(ca: CreditAccountData, cm: CreditManagerData, network: NetworkType, provider: PublicClient): Promise<Array<Rewards>>;
19
+ static findRewardTokens(cm: CreditManagerData, provider: PublicClient): Promise<{
20
+ staking: {
21
+ adapters: AdapterWithType[];
22
+ tokens: (`0x${string}` | undefined)[];
23
+ };
24
+ }>;
20
25
  }
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RewardClaimer = void 0;
4
+ const sdk_gov_1 = require("@gearbox-protocol/sdk-gov");
5
+ const rewardConvex_1 = require("./rewardConvex");
6
+ const stakingRewards_1 = require("./stakingRewards");
7
+ class RewardClaimer {
8
+ static async findRewards(ca, cm, network, provider) {
9
+ const tokens = await RewardClaimer.findRewardTokens(cm, provider);
10
+ const [convex, staking] = await Promise.all([
11
+ rewardConvex_1.RewardConvex.findRewards(ca, cm, network, provider),
12
+ stakingRewards_1.StakingRewards.findRewards(ca, provider, tokens.staking.adapters, tokens.staking.tokens),
13
+ ]);
14
+ return [...convex, ...staking];
15
+ }
16
+ static async findRewardTokens(cm, provider) {
17
+ const { calls: stakingCalls, adapters: stakingAdapters } = stakingRewards_1.StakingRewards.getRewardTokenCalls(cm);
18
+ const stakingTotal = stakingCalls.flat(1);
19
+ const response = await provider.multicall({
20
+ allowFailure: true,
21
+ multicallAddress: sdk_gov_1.MULTICALL_ADDRESS,
22
+ contracts: [...stakingTotal],
23
+ });
24
+ const stakingEnd = stakingTotal.length;
25
+ const stakingRewardTokensResponse = response.slice(0, stakingEnd);
26
+ return {
27
+ staking: {
28
+ adapters: stakingAdapters,
29
+ tokens: stakingRewardTokensResponse.map(r => r?.result),
30
+ },
31
+ };
32
+ }
33
+ }
34
+ exports.RewardClaimer = RewardClaimer;
@@ -1,8 +1,8 @@
1
1
  import { NetworkType, Protocols, SupportedToken } from "@gearbox-protocol/sdk-gov";
2
2
  import { Abi, Address, PublicClient } from "viem";
3
- import { CreditAccountData } from "./creditAccount";
4
- import { CreditManagerData } from "./creditManager";
5
- import { AdapterWithType, Rewards } from "./rewardClaimer";
3
+ import { CreditAccountData } from "../creditAccount";
4
+ import { CreditManagerData } from "../creditManager";
5
+ import { AdapterWithType, Rewards } from "../rewardClaimer";
6
6
  type DistributionList = Array<Array<RewardDistribution>>;
7
7
  type CallsList = Array<Array<{
8
8
  address: Address;
@@ -3,10 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.RewardConvex = void 0;
4
4
  const sdk_gov_1 = require("@gearbox-protocol/sdk-gov");
5
5
  const viem_1 = require("viem");
6
- const apy_1 = require("../apy");
7
- const auraAbi_1 = require("../apy/auraAbi");
8
- const auraAPY_1 = require("../apy/auraAPY");
9
- const types_1 = require("../types");
6
+ const types_1 = require("../../types");
7
+ const aura_1 = require("./aura");
8
+ const auraAbi_1 = require("./auraAbi");
9
+ const convex_1 = require("./convex");
10
10
  // convex[totalSupply, ...tokens] aura[totalSupply, multiplier, ...tokens]
11
11
  class RewardConvex {
12
12
  static async findRewards(ca, cm, network, provider) {
@@ -198,7 +198,6 @@ class RewardConvex {
198
198
  // create base
199
199
  const base = {
200
200
  contract: baseDistribution.contract,
201
- totalSupply: totalSupply,
202
201
  protocol: baseDistribution.protocol,
203
202
  rewards: {
204
203
  [baseDistribution.token]: baseReward,
@@ -212,8 +211,8 @@ class RewardConvex {
212
211
  };
213
212
  // add boosted
214
213
  const boostedReward = baseDistribution.protocol === sdk_gov_1.Protocols.Aura
215
- ? (0, auraAPY_1.getAURAMintAmount)(baseReward, totalSupply, multiplier)
216
- : (0, apy_1.getCVXMintAmount)(baseReward, totalSupply);
214
+ ? (0, aura_1.getAURAMintAmount)(baseReward, totalSupply, multiplier)
215
+ : (0, convex_1.getCVXMintAmount)(baseReward, totalSupply);
217
216
  base.rewards = {
218
217
  ...base.rewards,
219
218
  [boostedRewardToken]: boostedReward,
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const sdk_gov_1 = require("@gearbox-protocol/sdk-gov");
4
4
  const chai_1 = require("chai");
5
5
  const viem_1 = require("viem");
6
- const types_1 = require("../types");
6
+ const types_1 = require("../../types");
7
7
  const rewardConvex_1 = require("./rewardConvex");
8
8
  const ADAPTER_CONVEX_3CRV_POOL = sdk_gov_1.DUMB_ADDRESS;
9
9
  const ADAPTER_CURVE_FRAX_POOL = sdk_gov_1.DUMB_ADDRESS2;
@@ -94,7 +94,6 @@ describe("RewardConvex test", () => {
94
94
  const expected = [
95
95
  {
96
96
  protocol: sdk_gov_1.Protocols.Convex,
97
- totalSupply: 0n,
98
97
  contract: "CONVEX_3CRV_POOL",
99
98
  rewards: {
100
99
  CRV: 1000n,
@@ -0,0 +1,34 @@
1
+ import { SupportedToken } from "@gearbox-protocol/sdk-gov";
2
+ import { Abi, Address, PublicClient } from "viem";
3
+ import { CreditAccountData } from "../creditAccount";
4
+ import { CreditManagerData } from "../creditManager";
5
+ import { AdapterWithType, Rewards } from "../rewardClaimer";
6
+ type DistributionList = Array<Array<RewardDistribution>>;
7
+ type CallsList = Array<Array<{
8
+ address: Address;
9
+ abi: Abi;
10
+ functionName: string;
11
+ args: unknown[];
12
+ }>>;
13
+ export interface RewardDistribution {
14
+ contract: Rewards["contract"];
15
+ protocol: Rewards["protocol"];
16
+ token: SupportedToken;
17
+ adapter: Address;
18
+ contractAddress: Address;
19
+ }
20
+ export declare class StakingRewards {
21
+ static findRewards(ca: CreditAccountData, provider: PublicClient, adapters: Array<AdapterWithType>, rewardTokens: Array<Address | undefined>): Promise<Array<Rewards>>;
22
+ static getRewardTokenCalls(cm: CreditManagerData): {
23
+ calls: CallsList;
24
+ adapters: AdapterWithType[];
25
+ };
26
+ private static findAdapters;
27
+ static prepareMultiCalls(creditAccount: Address, adapters: Array<AdapterWithType>, rewardTokens: Array<Address | undefined>): {
28
+ distribution: DistributionList;
29
+ calls: CallsList;
30
+ } | undefined;
31
+ private static parseResults;
32
+ private static getRewardObject;
33
+ }
34
+ export {};
@@ -0,0 +1,133 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.StakingRewards = void 0;
4
+ const sdk_gov_1 = require("@gearbox-protocol/sdk-gov");
5
+ const viem_1 = require("viem");
6
+ const types_1 = require("../../types");
7
+ class StakingRewards {
8
+ static async findRewards(ca, provider, adapters, rewardTokens) {
9
+ const prepared = StakingRewards.prepareMultiCalls(ca.addr, adapters, rewardTokens);
10
+ if (!prepared)
11
+ return [];
12
+ const { calls, distribution } = prepared;
13
+ const callsTotal = calls.flat(1);
14
+ const allCalls = [...callsTotal];
15
+ if (allCalls.length === 0)
16
+ return [];
17
+ const response = (await provider.multicall({
18
+ allowFailure: false,
19
+ multicallAddress: sdk_gov_1.MULTICALL_ADDRESS,
20
+ contracts: allCalls,
21
+ }));
22
+ const callsEnd = callsTotal.length;
23
+ const callsResponse = response.slice(0, callsEnd);
24
+ const results = StakingRewards.parseResults(callsResponse, distribution);
25
+ return results;
26
+ }
27
+ static getRewardTokenCalls(cm) {
28
+ const adapters = this.findAdapters(cm);
29
+ const calls = adapters.reduce((acc, a) => {
30
+ acc.push([
31
+ {
32
+ address: a.adapter,
33
+ abi: types_1.iStakingRewardsAdapterAbi,
34
+ functionName: "rewardsToken",
35
+ args: [],
36
+ },
37
+ ]);
38
+ return acc;
39
+ }, []);
40
+ return { calls, adapters };
41
+ }
42
+ static findAdapters(cm) {
43
+ const contractsRecord = sdk_gov_1.TypedObjectUtils.entries(sdk_gov_1.contractParams).reduce((acc, [token, params]) => {
44
+ if (params.type === sdk_gov_1.AdapterInterface.STAKING_REWARDS) {
45
+ acc[token] = params;
46
+ }
47
+ return acc;
48
+ }, {});
49
+ return Object.entries(cm.adapters)
50
+ .filter(([contract]) => !!contractsRecord[sdk_gov_1.contractsByAddress[contract.toLowerCase()]])
51
+ .map(([contract, adapter]) => ({
52
+ adapter,
53
+ contractAddress: contract,
54
+ contract: sdk_gov_1.contractsByAddress[contract.toLowerCase()],
55
+ }));
56
+ }
57
+ static prepareMultiCalls(creditAccount, adapters, rewardTokens) {
58
+ if (adapters.length === 0)
59
+ return undefined;
60
+ const res = adapters.reduce((acc, a, i) => {
61
+ const currentContract = sdk_gov_1.contractParams[a.contract];
62
+ const rewardToken = rewardTokens[i]?.toLowerCase();
63
+ const currentCalls = [];
64
+ const currentDistribution = [];
65
+ if (rewardToken && rewardToken !== sdk_gov_1.ADDRESS_0X0) {
66
+ // since we generate 1 call above
67
+ currentCalls.push({
68
+ address: a.contractAddress,
69
+ abi: types_1.iBaseRewardPoolAbi,
70
+ functionName: "earned",
71
+ args: [creditAccount],
72
+ });
73
+ currentDistribution.push({
74
+ protocol: currentContract.protocol,
75
+ contract: a.contract,
76
+ token: sdk_gov_1.tokenSymbolByAddress[rewardToken],
77
+ contractAddress: a.contractAddress,
78
+ adapter: a.adapter,
79
+ });
80
+ acc.calls.push(currentCalls);
81
+ acc.distribution.push(currentDistribution);
82
+ }
83
+ return acc;
84
+ }, {
85
+ distribution: [],
86
+ calls: [],
87
+ });
88
+ return res;
89
+ }
90
+ static parseResults(response, distribution) {
91
+ const rewardsRecord = {};
92
+ let start = 0;
93
+ distribution.forEach(list => {
94
+ // rewards[]
95
+ const end = start + list.length;
96
+ const rewardsResp = response.slice(start, end);
97
+ start = end;
98
+ if (rewardsResp.length !== list.length) {
99
+ throw new Error(`Rewards response length mismatch: expected: ${list.length}, got: ${rewardsResp.length}`);
100
+ }
101
+ const rewardObject = this.getRewardObject(rewardsResp[0] || 0n, list[0]);
102
+ if (rewardObject)
103
+ rewardsRecord[list[0].contract] = rewardObject;
104
+ });
105
+ const result = Object.values(rewardsRecord);
106
+ return result;
107
+ }
108
+ static getRewardObject(reward, distribution) {
109
+ const callData = (0, viem_1.encodeFunctionData)({
110
+ abi: types_1.iBaseRewardPoolAbi,
111
+ functionName: "getReward",
112
+ args: [],
113
+ });
114
+ const base = {
115
+ contract: distribution.contract,
116
+ protocol: distribution.protocol,
117
+ rewards: {
118
+ [distribution.token]: reward,
119
+ },
120
+ calls: [
121
+ {
122
+ target: distribution.adapter,
123
+ callData,
124
+ },
125
+ ],
126
+ };
127
+ if (Object.values(base.rewards).some(r => r > 0)) {
128
+ return base;
129
+ }
130
+ return undefined;
131
+ }
132
+ }
133
+ exports.StakingRewards = StakingRewards;
@@ -18,7 +18,8 @@ interface CalculateMaxAPYProps {
18
18
  }
19
19
  export declare class Strategy {
20
20
  readonly name: string;
21
- readonly lpTokenSymbol: AllLPTokens;
21
+ readonly id: AllLPTokens;
22
+ readonly tokenOut: AllLPTokens;
22
23
  readonly protocolSymbol: string;
23
24
  readonly releaseAt: ReleaseAt;
24
25
  readonly collateralTokens: Array<SupportedToken>;
@@ -4,13 +4,15 @@ exports.Strategy = void 0;
4
4
  const sdk_gov_1 = require("@gearbox-protocol/sdk-gov");
5
5
  class Strategy {
6
6
  name;
7
- lpTokenSymbol;
7
+ id;
8
+ tokenOut;
8
9
  protocolSymbol;
9
10
  releaseAt;
10
11
  collateralTokens;
11
12
  constructor(payload) {
12
13
  this.name = payload.name;
13
- this.lpTokenSymbol = payload.lpTokenSymbol;
14
+ this.id = payload.lpTokenSymbol;
15
+ this.tokenOut = payload.lpTokenSymbol;
14
16
  this.protocolSymbol = payload.protocolSymbol;
15
17
  this.collateralTokens = payload.collateralTokens;
16
18
  this.releaseAt = payload.releaseAt;
@@ -9,7 +9,7 @@ class CurveAdapterParser extends abstractParser_1.AbstractParser {
9
9
  constructor(contract, isContract) {
10
10
  super(contract);
11
11
  let contractName = "";
12
- const nCoins = sdk_gov_1.contractParams[contract].tokens.length;
12
+ const nCoins = sdk_gov_1.contractParams[contract]?.tokens?.length;
13
13
  switch (nCoins) {
14
14
  case 2:
15
15
  this.abi = types_1.iCurveV1_2AssetsAdapterAbi;
@@ -0,0 +1,10 @@
1
+ import { SupportedContract } from "@gearbox-protocol/sdk-gov";
2
+ import { Address } from "viem";
3
+ import { BigNumberish } from "../utils/formatter";
4
+ import { AbstractParser } from "./abstractParser";
5
+ import { IParser } from "./iParser";
6
+ export declare class StakingRewardsAdapterParser extends AbstractParser implements IParser {
7
+ constructor(contract: SupportedContract, isContract: boolean);
8
+ parse(calldata: Address): string;
9
+ formatAmount(amount: BigNumberish): string;
10
+ }
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.StakingRewardsAdapterParser = void 0;
4
+ const sdk_gov_1 = require("@gearbox-protocol/sdk-gov");
5
+ const types_1 = require("../types");
6
+ const abstractParser_1 = require("./abstractParser");
7
+ class StakingRewardsAdapterParser extends abstractParser_1.AbstractParser {
8
+ constructor(contract, isContract) {
9
+ super(contract);
10
+ this.abi = types_1.iStakingRewardsAdapterAbi;
11
+ if (!isContract)
12
+ this.adapterName = "StakingRewardsAdapter";
13
+ }
14
+ parse(calldata) {
15
+ const { functionName, functionData } = this.parseSelector(calldata);
16
+ switch (functionData.functionName) {
17
+ case "withdraw": {
18
+ const [amount] = functionData.args || [];
19
+ return `${functionName}(amount: ${this.formatAmount(amount)}`;
20
+ }
21
+ case "withdrawDiff": {
22
+ const [leftoverAmount] = functionData.args || [];
23
+ return `${functionName}(leftoverAmount: ${this.formatAmount(leftoverAmount)}`;
24
+ }
25
+ case "getReward":
26
+ return `${functionName}()`;
27
+ default:
28
+ return this.reportUnknownFragment(this.adapterName || this.contract, functionName, calldata);
29
+ }
30
+ }
31
+ formatAmount(amount) {
32
+ return this.formatBN(amount, sdk_gov_1.contractParams[this.contract].stakedToken);
33
+ }
34
+ }
35
+ exports.StakingRewardsAdapterParser = StakingRewardsAdapterParser;
@@ -17,6 +17,7 @@ const erc626AdapterParser_1 = require("./erc626AdapterParser");
17
17
  const lidoAdapterParser_1 = require("./lidoAdapterParser");
18
18
  const lidoSTETHParser_1 = require("./lidoSTETHParser");
19
19
  const priceOracleParser_1 = require("./priceOracleParser");
20
+ const stakingRewardsAdapterParser_1 = require("./stakingRewardsAdapterParser");
20
21
  const uniV2AdapterParser_1 = require("./uniV2AdapterParser");
21
22
  const uniV3AdapterParser_1 = require("./uniV3AdapterParser");
22
23
  const wstETHAdapterParser_1 = require("./wstETHAdapterParser");
@@ -131,6 +132,9 @@ class TxParser {
131
132
  case "YEARN_V2":
132
133
  TxParser._addParser(addressLC, new yearnV2AdapterParser_1.YearnV2AdapterParser(contract, isContract));
133
134
  break;
135
+ case "STAKING_REWARDS":
136
+ TxParser._addParser(addressLC, new stakingRewardsAdapterParser_1.StakingRewardsAdapterParser(contract, isContract));
137
+ break;
134
138
  case "CONVEX_V1_BASE_REWARD_POOL":
135
139
  TxParser._addParser(addressLC, new convexBaseRewardPoolAdapterParser_1.ConvexBaseRewardPoolAdapterParser(contract, isContract));
136
140
  break;
@@ -29,11 +29,6 @@ export declare class RedstoneApi {
29
29
  }>;
30
30
  private static getDataPackages;
31
31
  private static splitResponse;
32
- static getRedstonePriceFeedsSDK: ({ priceOracleAddress, currentTokenData, provider, network, }: GetRedstoneFeedsProps) => Promise<{
33
- main: RedstonePriceFeeds;
34
- reserve: RedstonePriceFeeds;
35
- }>;
36
- private static getRedstonePF_SDK;
37
32
  static getRedstonePriceFeeds: ({ priceOracleAddress, currentTokenData, provider, network, }: GetRedstoneFeedsProps) => Promise<{
38
33
  main: RedstonePriceFeeds;
39
34
  reserve: RedstonePriceFeeds;