@gearbox-protocol/sdk 3.0.0-next.176 → 3.0.0-next.178
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/lib/apy/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LPTokens, PartialRecord, SupportedToken } from "@gearbox-protocol/sdk-gov";
|
|
2
|
-
export type AdditionalTokenWithAPY = Extract<SupportedToken, "STETH" | "weETH" | "osETH" | "rETH" | "wstETH" | "ezETH" | "cbETH" | "sfrxETH" | "USDe" | "rsETH">;
|
|
2
|
+
export type AdditionalTokenWithAPY = Extract<SupportedToken, "STETH" | "weETH" | "osETH" | "rETH" | "wstETH" | "ezETH" | "cbETH" | "sfrxETH" | "USDe" | "rsETH" | "rswETH" | "pufETH">;
|
|
3
3
|
export declare const additionalTokensWithAPY: Record<AdditionalTokenWithAPY, true>;
|
|
4
4
|
export type TokensWithAPY = LPTokens | AdditionalTokenWithAPY;
|
|
5
5
|
export type LpTokensAPY = PartialRecord<TokensWithAPY, number>;
|
package/lib/apy/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FunctionFragment, Result } from "@ethersproject/abi";
|
|
2
|
-
import { SupportedToken } from "@gearbox-protocol/sdk-gov";
|
|
2
|
+
import { SupportedToken, TickerToken } from "@gearbox-protocol/sdk-gov";
|
|
3
3
|
import { BigNumberish, BytesLike, utils } from "ethers";
|
|
4
4
|
interface ParseSelectorResult {
|
|
5
5
|
functionFragment: FunctionFragment;
|
|
@@ -19,6 +19,7 @@ export declare class AbstractParser {
|
|
|
19
19
|
decodeFunctionData(functionFragment: FunctionFragment | string, data: BytesLike): Result;
|
|
20
20
|
encodeFunctionResult(functionFragment: FunctionFragment | string, data: Array<any>): string;
|
|
21
21
|
tokenSymbol(address: string): SupportedToken;
|
|
22
|
+
tokenOrTickerSymbol(address: string): SupportedToken | TickerToken;
|
|
22
23
|
formatBN(amount: BigNumberish, token: SupportedToken): string;
|
|
23
24
|
parseToObject(address: string, calldata: string): ParsedObject;
|
|
24
25
|
reportUnknownFragment(functionName: string, functionFragment: FunctionFragment, calldata: string): string;
|
|
@@ -28,6 +28,13 @@ class AbstractParser {
|
|
|
28
28
|
throw new Error(`Unknown token: ${address}`);
|
|
29
29
|
return symbol;
|
|
30
30
|
}
|
|
31
|
+
tokenOrTickerSymbol(address) {
|
|
32
|
+
const symbol = (0, sdk_gov_1.getTokenSymbolOrTicker)(address);
|
|
33
|
+
if (!symbol) {
|
|
34
|
+
throw new Error(`Unknown token or ticker: ${address}`);
|
|
35
|
+
}
|
|
36
|
+
return symbol;
|
|
37
|
+
}
|
|
31
38
|
formatBN(amount, token) {
|
|
32
39
|
return `${(0, sdk_gov_1.formatBN)(amount, sdk_gov_1.decimals[token])} [${(0, sdk_gov_1.toBigInt)(amount).toString()}]`;
|
|
33
40
|
}
|
|
@@ -73,7 +73,7 @@ class CreditFacadeParser extends abstractParser_1.AbstractParser {
|
|
|
73
73
|
}
|
|
74
74
|
case "onDemandPriceUpdate": {
|
|
75
75
|
const [token, reserve, data] = this.decodeFunctionData(functionFragment, calldata);
|
|
76
|
-
return `${functionName}(token: ${this.
|
|
76
|
+
return `${functionName}(token: ${this.tokenOrTickerSymbol(token)}, reserve: ${reserve}, data: ${data})`;
|
|
77
77
|
}
|
|
78
78
|
default:
|
|
79
79
|
return this.reportUnknownFragment(functionName, functionFragment, calldata);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gearbox-protocol/sdk",
|
|
3
|
-
"version": "3.0.0-next.
|
|
3
|
+
"version": "3.0.0-next.178",
|
|
4
4
|
"description": "Gearbox SDK",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@gearbox-protocol/bots-v3": "^1.5.1",
|
|
34
|
-
"@gearbox-protocol/sdk-gov": "
|
|
34
|
+
"@gearbox-protocol/sdk-gov": "1.66.2",
|
|
35
35
|
"axios": "^1.2.6",
|
|
36
36
|
"decimal.js-light": "^2.5.1",
|
|
37
37
|
"deep-eql": "^4.1.0",
|