@defisaver/positions-sdk 0.0.91 → 0.0.92

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.
@@ -91,7 +91,7 @@ const getApyFromDfsApi = (asset) => __awaiter(void 0, void 0, void 0, function*
91
91
  const data = yield res.json();
92
92
  return data.apy;
93
93
  });
94
- exports.STAKING_ASSETS = ['cbETH', 'wstETH', 'cbETH', 'rETH', 'sDAI', 'weETH', 'sUSDe', 'osETH', 'ezETH'];
94
+ exports.STAKING_ASSETS = ['cbETH', 'wstETH', 'cbETH', 'rETH', 'sDAI', 'weETH', 'sUSDe', 'osETH', 'ezETH', 'ETHx'];
95
95
  const getStakingApy = (asset, web3, blockNumber = 'latest', fromBlock = undefined) => {
96
96
  try {
97
97
  if (asset === 'stETH' || asset === 'wstETH')
@@ -110,6 +110,8 @@ const getStakingApy = (asset, web3, blockNumber = 'latest', fromBlock = undefine
110
110
  return getApyFromDfsApi('ezETH');
111
111
  if (asset === 'osETH')
112
112
  return getApyFromDfsApi('osETH');
113
+ if (asset === 'ETHx')
114
+ return getApyFromDfsApi('ETHx');
113
115
  }
114
116
  catch (e) {
115
117
  console.error(`Failed to fetch APY for ${asset}`);
@@ -81,7 +81,7 @@ const getApyFromDfsApi = (asset) => __awaiter(void 0, void 0, void 0, function*
81
81
  const data = yield res.json();
82
82
  return data.apy;
83
83
  });
84
- export const STAKING_ASSETS = ['cbETH', 'wstETH', 'cbETH', 'rETH', 'sDAI', 'weETH', 'sUSDe', 'osETH', 'ezETH'];
84
+ export const STAKING_ASSETS = ['cbETH', 'wstETH', 'cbETH', 'rETH', 'sDAI', 'weETH', 'sUSDe', 'osETH', 'ezETH', 'ETHx'];
85
85
  export const getStakingApy = (asset, web3, blockNumber = 'latest', fromBlock = undefined) => {
86
86
  try {
87
87
  if (asset === 'stETH' || asset === 'wstETH')
@@ -100,6 +100,8 @@ export const getStakingApy = (asset, web3, blockNumber = 'latest', fromBlock = u
100
100
  return getApyFromDfsApi('ezETH');
101
101
  if (asset === 'osETH')
102
102
  return getApyFromDfsApi('osETH');
103
+ if (asset === 'ETHx')
104
+ return getApyFromDfsApi('ETHx');
103
105
  }
104
106
  catch (e) {
105
107
  console.error(`Failed to fetch APY for ${asset}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defisaver/positions-sdk",
3
- "version": "0.0.91",
3
+ "version": "0.0.92",
4
4
  "description": "",
5
5
  "main": "./cjs/index.js",
6
6
  "module": "./esm/index.js",
@@ -81,9 +81,9 @@ const getApyFromDfsApi = async (asset: string) => {
81
81
  const res = await fetch(`https://app.defisaver.com/api/staking/apy?asset=${asset}`);
82
82
  const data = await res.json();
83
83
  return data.apy;
84
- }
84
+ };
85
85
 
86
- export const STAKING_ASSETS = ['cbETH', 'wstETH', 'cbETH', 'rETH', 'sDAI', 'weETH', 'sUSDe', 'osETH', 'ezETH'];
86
+ export const STAKING_ASSETS = ['cbETH', 'wstETH', 'cbETH', 'rETH', 'sDAI', 'weETH', 'sUSDe', 'osETH', 'ezETH', 'ETHx'];
87
87
 
88
88
  export const getStakingApy = (asset: string, web3: Web3, blockNumber: 'latest' | number = 'latest', fromBlock: number | undefined = undefined) => {
89
89
  try {
@@ -93,8 +93,9 @@ export const getStakingApy = (asset: string, web3: Web3, blockNumber: 'latest' |
93
93
  if (asset === 'sDAI') return getDsrApy(web3);
94
94
  if (asset === 'sUSDe') return getApyFromDfsApi('sUSDe');
95
95
  if (asset === 'weETH') return getApyFromDfsApi('weETH');
96
- if (asset === 'ezETH') return getApyFromDfsApi('ezETH')
96
+ if (asset === 'ezETH') return getApyFromDfsApi('ezETH');
97
97
  if (asset === 'osETH') return getApyFromDfsApi('osETH');
98
+ if (asset === 'ETHx') return getApyFromDfsApi('ETHx');
98
99
  } catch (e) {
99
100
  console.error(`Failed to fetch APY for ${asset}`);
100
101
  return '0';