@stake-dao/reader 0.2.18 → 0.2.19

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.
@@ -1 +1 @@
1
- {"version":3,"file":"getStratsWithApr.d.ts","sourceRoot":"","sources":["../../../../../src/strategies/curve/fetch/getStratsWithApr.ts"],"names":[],"mappings":"AAyBA,eAAO,MAAM,qBAAqB,aAAoB,GAAG,WAAW,MAAM,eAAe,GAAG,EAAE,YAAY,GAAG;;;EAoD5G,CAAA"}
1
+ {"version":3,"file":"getStratsWithApr.d.ts","sourceRoot":"","sources":["../../../../../src/strategies/curve/fetch/getStratsWithApr.ts"],"names":[],"mappings":"AA+BA,eAAO,MAAM,qBAAqB,aAAoB,GAAG,WAAW,MAAM,eAAe,GAAG,EAAE,YAAY,GAAG;;;EAoD5G,CAAA"}
@@ -0,0 +1,5 @@
1
+ declare const nameSuffixes: {
2
+ '0xFf359A49Bf1197D6A2aaF7507041B03Fb27515E8': string;
3
+ };
4
+ export default nameSuffixes;
5
+ //# sourceMappingURL=nameSuffixes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nameSuffixes.d.ts","sourceRoot":"","sources":["../../../../../src/strategies/curve/fetch/nameSuffixes.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,YAAY;;CAGjB,CAAA;AAED,eAAe,YAAY,CAAA"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stake-dao/reader",
3
3
  "description": "",
4
- "version": "0.2.18",
4
+ "version": "0.2.19",
5
5
  "license": "AGPL-3.0-only",
6
6
  "repository": {
7
7
  "type": "git",
@@ -2,6 +2,7 @@ import { STRAT_FEES } from '@stake-dao/constants'
2
2
  import { formatUnits, parseAbi } from 'viem'
3
3
  import { mainnet } from 'viem/chains'
4
4
  import { equalTlc, multicall } from '../../../utils.js'
5
+ import nameSuffixes from './nameSuffixes.js'
5
6
 
6
7
  const getConvexPool = (apisData: any, chainId: number, isLending: boolean, stratLpAddress: string) => {
7
8
  if (chainId === mainnet.id) {
@@ -14,13 +15,18 @@ const getConvexPool = (apisData: any, chainId: number, isLending: boolean, strat
14
15
  }
15
16
 
16
17
  const getName = (s: any) => {
18
+ let name = ''
19
+
17
20
  if (s.isLending) {
18
21
  const id = s.key.replace('lending-oneway-', '')
19
- return `${s.coins[0].symbol}${Number(id) > 8 ? ' Leverage' : ''}`
22
+ name = `${s.coins[0].symbol}${Number(id) > 8 ? ' Leverage' : ''}`
23
+ } else {
24
+ name = (s.isMetapool ? s.underlyingCoins : s.coins)
25
+ .reduce((res: string, current: any) => `${res}/${current.symbol}`, '')
26
+ .slice(1)
20
27
  }
21
- return (s.isMetapool ? s.underlyingCoins : s.coins)
22
- .reduce((res: string, current: any) => `${res}/${current.symbol}`, '')
23
- .slice(1)
28
+
29
+ return `${name}${nameSuffixes[s.vault] ? ` ${nameSuffixes[s.vault]}` : ''}`
24
30
  }
25
31
 
26
32
  export const getCurveStratsWithApr = async (provider: any, chainId: number, curveStrats: any[], apisData: any) => {
@@ -0,0 +1,6 @@
1
+ const nameSuffixes = {
2
+ // "vault address": suffix
3
+ '0xFf359A49Bf1197D6A2aaF7507041B03Fb27515E8': 'v2.1',
4
+ }
5
+
6
+ export default nameSuffixes