@gearbox-protocol/sdk 3.0.0-next.293 → 3.0.0-next.295
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 +2 -2
- package/lib/apy/index.js +4 -0
- package/lib/contracts/contractsRegister.d.ts +2 -2
- package/lib/contracts/contractsRegister.js +3 -0
- package/lib/core/endpoint.js +5 -1
- package/lib/core/protocols.d.ts +1 -1
- package/lib/core/protocols.js +16 -0
- package/package.json +2 -2
package/lib/apy/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LPTokens, PartialRecord, SupportedToken } from "@gearbox-protocol/sdk-gov";
|
|
2
|
-
type ExtraFarmTokens = Extract<SupportedToken, "STETH" | "rETH" | "osETH" | "cbETH" | "wstETH" | "weETH" | "ezETH" | "sfrxETH" | "USDe" | "rsETH" | "rswETH" | "pufETH" | "pzETH" | "rstETH" | "steakLRT" | "amphrETH" | "LBTC" | "Re7LRT" | "PT_ezETH_26DEC2024" | "PT_eETH_26DEC2024" | "PT_sUSDe_26DEC2024" | "PT_eBTC_26DEC2024" | "PT_LBTC_27MAR2025" | "eBTC" | "PT_cornLBTC_26DEC2024" | "PT_corn_eBTC_27MAR2025" | "PT_corn_pumpBTC_26DEC2024" | "pumpBTC" | "PT_sUSDe_27MAR2025" | "DVstETH" | "beraSTONE" | "PT_sUSDe_29MAY2025" | "tETH" | "PT_beraSTONE_10APR2025">;
|
|
3
|
-
type ExtraTokensWithAPY = Extract<ExtraFarmTokens, "STETH" | "rETH" | "osETH" | "cbETH" | "wstETH" | "sfrxETH" | "pzETH" | "ezETH" | "Re7LRT" | "rsETH" | "weETH" | "rswETH" | "rstETH" | "steakLRT" | "amphrETH" | "pufETH" | "PT_ezETH_26DEC2024" | "PT_eETH_26DEC2024" | "PT_sUSDe_26DEC2024" | "PT_eBTC_26DEC2024" | "PT_LBTC_27MAR2025" | "PT_cornLBTC_26DEC2024" | "PT_corn_eBTC_27MAR2025" | "PT_corn_pumpBTC_26DEC2024" | "PT_sUSDe_27MAR2025" | "DVstETH" | "PT_sUSDe_29MAY2025" | "tETH" | "PT_beraSTONE_10APR2025">;
|
|
2
|
+
type ExtraFarmTokens = Extract<SupportedToken, "STETH" | "rETH" | "osETH" | "cbETH" | "wstETH" | "weETH" | "ezETH" | "sfrxETH" | "USDe" | "rsETH" | "rswETH" | "pufETH" | "pzETH" | "rstETH" | "steakLRT" | "amphrETH" | "LBTC" | "Re7LRT" | "PT_ezETH_26DEC2024" | "PT_eETH_26DEC2024" | "PT_sUSDe_26DEC2024" | "PT_eBTC_26DEC2024" | "PT_LBTC_27MAR2025" | "eBTC" | "PT_cornLBTC_26DEC2024" | "PT_corn_eBTC_27MAR2025" | "PT_corn_pumpBTC_26DEC2024" | "pumpBTC" | "PT_sUSDe_27MAR2025" | "DVstETH" | "beraSTONE" | "PT_sUSDe_29MAY2025" | "tETH" | "PT_beraSTONE_10APR2025" | "stS" | "csUSDL">;
|
|
3
|
+
type ExtraTokensWithAPY = Extract<ExtraFarmTokens, "STETH" | "rETH" | "osETH" | "cbETH" | "wstETH" | "sfrxETH" | "pzETH" | "ezETH" | "Re7LRT" | "rsETH" | "weETH" | "rswETH" | "rstETH" | "steakLRT" | "amphrETH" | "pufETH" | "PT_ezETH_26DEC2024" | "PT_eETH_26DEC2024" | "PT_sUSDe_26DEC2024" | "PT_eBTC_26DEC2024" | "PT_LBTC_27MAR2025" | "PT_cornLBTC_26DEC2024" | "PT_corn_eBTC_27MAR2025" | "PT_corn_pumpBTC_26DEC2024" | "PT_sUSDe_27MAR2025" | "DVstETH" | "PT_sUSDe_29MAY2025" | "tETH" | "PT_beraSTONE_10APR2025" | "stS" | "csUSDL">;
|
|
4
4
|
type LRTAndLSTTokens = Exclude<ExtraFarmTokens, "USDe">;
|
|
5
5
|
export declare const isExtraFarmToken: (t: unknown) => t is ExtraFarmTokens;
|
|
6
6
|
export declare const isLRT_LSTToken: (t: unknown) => t is LRTAndLSTTokens;
|
package/lib/apy/index.js
CHANGED
|
@@ -37,6 +37,8 @@ const EXTRA_FARM_TOKENS = {
|
|
|
37
37
|
PT_sUSDe_29MAY2025: true,
|
|
38
38
|
tETH: true,
|
|
39
39
|
PT_beraSTONE_10APR2025: true,
|
|
40
|
+
stS: true,
|
|
41
|
+
csUSDL: true,
|
|
40
42
|
};
|
|
41
43
|
const isExtraFarmToken = (t) => {
|
|
42
44
|
if (typeof t !== "string")
|
|
@@ -74,6 +76,8 @@ const EXTRA_TOKENS_WITH_APY = {
|
|
|
74
76
|
PT_sUSDe_29MAY2025: true,
|
|
75
77
|
tETH: true,
|
|
76
78
|
PT_beraSTONE_10APR2025: true,
|
|
79
|
+
stS: true,
|
|
80
|
+
csUSDL: true,
|
|
77
81
|
};
|
|
78
82
|
const isExtraTokenWithAPY = (t) => {
|
|
79
83
|
if (typeof t !== "string")
|
|
@@ -10,7 +10,7 @@ export type ArbitrumCreditManagers = "USDC_E_V3_TRADE_TIER_1" | "USDC_E_V3_TRADE
|
|
|
10
10
|
export type OptimismCreditManagers = "USDC_E_V3_TIER_1" | "USDC_E_V3_TIER_2" | "WETH_V3_TIER_1" | "WETH_V3_TRADE_TIER_2";
|
|
11
11
|
export type BaseCreditManagers = never;
|
|
12
12
|
type CreditManagersListType = {
|
|
13
|
-
[key in NetworkType]: key extends "Mainnet" ? Record<MainnetCreditManagers, Address> : key extends "Arbitrum" ? Record<ArbitrumCreditManagers, Address> : key extends "Optimism" ? Record<OptimismCreditManagers, Address> : key extends "Base" ? Record<BaseCreditManagers, Address> : never;
|
|
13
|
+
[key in NetworkType]: key extends "Mainnet" ? Record<MainnetCreditManagers, Address> : key extends "Arbitrum" ? Record<ArbitrumCreditManagers, Address> : key extends "Optimism" ? Record<OptimismCreditManagers, Address> : key extends "Base" ? Record<BaseCreditManagers, Address> : key extends "Sonic" ? Record<BaseCreditManagers, Address> : never;
|
|
14
14
|
};
|
|
15
15
|
export declare const creditManagerByNetwork: CreditManagersListType;
|
|
16
16
|
export type SupportedCreditManagers = MainnetCreditManagers | ArbitrumCreditManagers;
|
|
@@ -22,7 +22,7 @@ export type ArbitrumPools = "USDC_V3" | "USDC_e_V3" | "WETH_V3";
|
|
|
22
22
|
export type OptimismPools = "USDC_V3" | "WETH_V3";
|
|
23
23
|
export type BasePools = never;
|
|
24
24
|
type PoolsListType = {
|
|
25
|
-
[key in NetworkType]: key extends "Mainnet" ? Record<MainnetPools, Address> : key extends "Arbitrum" ? Record<ArbitrumPools, Address> : key extends "Optimism" ? Record<OptimismPools, Address> : key extends "Base" ? Record<BasePools, Address> : never;
|
|
25
|
+
[key in NetworkType]: key extends "Mainnet" ? Record<MainnetPools, Address> : key extends "Arbitrum" ? Record<ArbitrumPools, Address> : key extends "Optimism" ? Record<OptimismPools, Address> : key extends "Base" ? Record<BasePools, Address> : key extends "Sonic" ? Record<BasePools, Address> : never;
|
|
26
26
|
};
|
|
27
27
|
export declare const poolByNetwork: PoolsListType;
|
|
28
28
|
export type SupportedPools = MainnetPools | ArbitrumPools;
|
|
@@ -7,6 +7,7 @@ exports.stEthPoolWrapper = {
|
|
|
7
7
|
Arbitrum: "0x3fe62a62C022A069952069b32C9d56718D30B7ec",
|
|
8
8
|
Optimism: "",
|
|
9
9
|
Base: "",
|
|
10
|
+
Sonic: "",
|
|
10
11
|
};
|
|
11
12
|
exports.creditManagerByNetwork = {
|
|
12
13
|
Mainnet: {
|
|
@@ -54,6 +55,7 @@ exports.creditManagerByNetwork = {
|
|
|
54
55
|
WETH_V3_TRADE_TIER_2: "0x6ed2150a2d4136b42adf2043d25f5834baa0f1a9".toLowerCase(),
|
|
55
56
|
},
|
|
56
57
|
Base: {},
|
|
58
|
+
Sonic: {},
|
|
57
59
|
};
|
|
58
60
|
exports.creditManagerByAddress = sdk_gov_1.TypedObjectUtils.entries(exports.creditManagerByNetwork).reduce((acc, [, cms]) => ({
|
|
59
61
|
...acc,
|
|
@@ -88,6 +90,7 @@ exports.poolByNetwork = {
|
|
|
88
90
|
WETH_V3: "0x42db77b3103c71059f4b997d6441cfb299fd0d94".toLowerCase(),
|
|
89
91
|
},
|
|
90
92
|
Base: {},
|
|
93
|
+
Sonic: {},
|
|
91
94
|
};
|
|
92
95
|
const deployedContractNames = {
|
|
93
96
|
// MAINNET V1 CM
|
package/lib/core/endpoint.js
CHANGED
|
@@ -7,6 +7,7 @@ exports.TESTNET_CHAINS = {
|
|
|
7
7
|
Optimism: 7879,
|
|
8
8
|
Arbitrum: 7880,
|
|
9
9
|
Base: 7881,
|
|
10
|
+
Sonic: 7882,
|
|
10
11
|
};
|
|
11
12
|
const CHARTS_BACKEND_ADDRESSES = {
|
|
12
13
|
[sdk_gov_1.CHAINS.Mainnet]: "https://charts-server.fly.dev",
|
|
@@ -14,10 +15,11 @@ const CHARTS_BACKEND_ADDRESSES = {
|
|
|
14
15
|
[sdk_gov_1.CHAINS.Optimism]: "https://charts-server.fly.dev",
|
|
15
16
|
[sdk_gov_1.CHAINS.Base]: "https://charts-server.fly.dev",
|
|
16
17
|
[sdk_gov_1.CHAINS.Local]: "https://charts-server.fly.dev",
|
|
18
|
+
[sdk_gov_1.CHAINS.Sonic]: "https://charts-server.fly.dev",
|
|
17
19
|
[exports.TESTNET_CHAINS.Mainnet]: "https://testnet.gearbox.foundation",
|
|
18
20
|
[exports.TESTNET_CHAINS.Arbitrum]: "https://arbtest.gearbox.foundation",
|
|
19
21
|
[exports.TESTNET_CHAINS.Optimism]: "https://opttest.gearbox.foundation",
|
|
20
|
-
// !& Base
|
|
22
|
+
// !& Base & Sonic
|
|
21
23
|
};
|
|
22
24
|
const LAMA_URL = "https://charts-server.fly.dev/api/defillama?ids=";
|
|
23
25
|
const STATIC_TOKEN = "https://static.gearbox.fi/tokens/";
|
|
@@ -25,10 +27,12 @@ const LEADERBOARD_APIS = {
|
|
|
25
27
|
[sdk_gov_1.CHAINS.Mainnet]: "https://gpointbot.fly.dev",
|
|
26
28
|
[sdk_gov_1.CHAINS.Optimism]: "https://gpointbot.fly.dev",
|
|
27
29
|
[sdk_gov_1.CHAINS.Arbitrum]: "https://gpointbot.fly.dev",
|
|
30
|
+
[sdk_gov_1.CHAINS.Sonic]: "https://gpointbot.fly.dev",
|
|
28
31
|
[sdk_gov_1.CHAINS.Local]: "https://gpointbot.fly.dev",
|
|
29
32
|
[exports.TESTNET_CHAINS.Mainnet]: "https://testnet.gearbox.foundation/gpointbot",
|
|
30
33
|
[exports.TESTNET_CHAINS.Optimism]: "https://testnet.gearbox.foundation/gpointbot",
|
|
31
34
|
[exports.TESTNET_CHAINS.Arbitrum]: "https://testnet.gearbox.foundation/gpointbot",
|
|
35
|
+
// !& Base & Sonic
|
|
32
36
|
};
|
|
33
37
|
const REFERRAL_API = "https://referral-gen.fly.dev/generate";
|
|
34
38
|
class GearboxBackendApi {
|
package/lib/core/protocols.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ interface ProtocolData {
|
|
|
3
3
|
name: string;
|
|
4
4
|
icon: string;
|
|
5
5
|
}
|
|
6
|
-
export type ExtendedProtocols = keyof typeof Protocols | "Stakewise" | "Etherfi" | "Rocketpool" | "Renzo" | "Coinbase" | "Kelp" | "Swell" | "Puffer" | "Mellow" | "Lombard" | "pumpBTC" | "Stakestone" | "Treehouse";
|
|
6
|
+
export type ExtendedProtocols = keyof typeof Protocols | "Stakewise" | "Etherfi" | "Rocketpool" | "Renzo" | "Coinbase" | "Kelp" | "Swell" | "Puffer" | "Mellow" | "Lombard" | "pumpBTC" | "Stakestone" | "Treehouse" | "Coinshift";
|
|
7
7
|
export declare const isExtendedProtocol: (t: unknown) => t is ExtendedProtocols;
|
|
8
8
|
export declare function getProtocolData(t: string): ProtocolData;
|
|
9
9
|
export {};
|
package/lib/core/protocols.js
CHANGED
|
@@ -150,6 +150,22 @@ const PROTOCOL_DATA = {
|
|
|
150
150
|
name: "Treehouse",
|
|
151
151
|
icon: "/protocols/treehouse.svg",
|
|
152
152
|
},
|
|
153
|
+
Beets: {
|
|
154
|
+
name: "Beets",
|
|
155
|
+
icon: "/protocols/beets.svg",
|
|
156
|
+
},
|
|
157
|
+
Shadow: {
|
|
158
|
+
name: "Shadow",
|
|
159
|
+
icon: "/protocols/shadow.svg",
|
|
160
|
+
},
|
|
161
|
+
Lift: {
|
|
162
|
+
name: "Lift",
|
|
163
|
+
icon: "/protocols/lift.svg",
|
|
164
|
+
},
|
|
165
|
+
Coinshift: {
|
|
166
|
+
name: "coinshift",
|
|
167
|
+
icon: "/protocols/coinshift.svg",
|
|
168
|
+
},
|
|
153
169
|
};
|
|
154
170
|
const isExtendedProtocol = (t) => typeof t === "string" && !!PROTOCOL_DATA[t];
|
|
155
171
|
exports.isExtendedProtocol = isExtendedProtocol;
|
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.295",
|
|
4
4
|
"description": "Gearbox SDK",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"test": "npx mocha -r ts-node/register -r dotenv/config 'src/**/*.spec.ts'"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@gearbox-protocol/sdk-gov": "
|
|
31
|
+
"@gearbox-protocol/sdk-gov": "^2.36.4",
|
|
32
32
|
"@wagmi/cli": "^2.1.13",
|
|
33
33
|
"axios": "^1.2.6",
|
|
34
34
|
"decimal.js-light": "^2.5.1",
|