@stake-dao/reader 0.4.21 → 0.4.23

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":"index.d.ts","sourceRoot":"","sources":["../../../../src/lockers/fetch/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAK5C,OAA6B,EAAE,KAAK,cAAc,EAAE,MAAM,kCAAkC,CAAA;AAsB5F,UAAU,aAAa;IACrB,QAAQ,EAAE,GAAG,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,KAAK,EAAE,CAAA;IACf,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B;AAED,eAAO,MAAM,YAAY,oDAA2D,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6QhG,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lockers/fetch/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAK5C,OAA6B,EAAE,KAAK,cAAc,EAAE,MAAM,kCAAkC,CAAA;AAsB5F,UAAU,aAAa;IACrB,QAAQ,EAAE,GAAG,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,KAAK,EAAE,CAAA;IACf,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B;AAED,eAAO,MAAM,YAAY,oDAA2D,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqRhG,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"getHttpCalls.d.ts","sourceRoot":"","sources":["../../../../src/lockers/utils/getHttpCalls.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,YAAY,YAAmB,MAAM;;;;;;;;;;;;EAiD1C,CAAA;AAED,eAAe,YAAY,CAAA"}
1
+ {"version":3,"file":"getHttpCalls.d.ts","sourceRoot":"","sources":["../../../../src/lockers/utils/getHttpCalls.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,YAAY,YAAmB,MAAM;;;;;;;;;;;;EAkD1C,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.4.21",
4
+ "version": "0.4.23",
5
5
  "license": "AGPL-3.0-only",
6
6
  "repository": {
7
7
  "type": "git",
@@ -35,7 +35,7 @@
35
35
  "graphql-request": "^6.0.0",
36
36
  "lodash-es": "^4.17.21",
37
37
  "viem": "^2.9.31",
38
- "@stake-dao/constants": "0.4.12"
38
+ "@stake-dao/constants": "0.4.13"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@types/lodash-es": "^4.17.12"
@@ -221,10 +221,18 @@ export const fetchLockers = async ({ provider, chainId, prices, withAirdropGraph
221
221
  bribeMinApr = data.bribeMinApr
222
222
  bribeMaxApr = data.bribeMaxApr
223
223
  bribeRewards = data.bribeRewards
224
- } else if (locker.id === 'cake') {
224
+ } else if (locker.id === 'cake' || locker.id === 'fxs') {
225
+ let _veBalanceOfLocker = Number(veBalanceOfLocker)
226
+
227
+ // Add sidechain veBalance
228
+ if (sideChains && sideChains.length > 0) {
229
+ _veBalanceOfLocker +=
230
+ sideChains?.reduce((acc: number, sideChain) => acc + Number(sideChain.veBalanceOfLocker), 0) || 0
231
+ }
232
+
225
233
  const apr =
226
- (httpCalls.bribesData?.[delegationWithId('cake')!] || 0) *
227
- (Number.parseFloat(veBalanceOfLocker) / Number.parseFloat(totalSupplyStaked))
234
+ (httpCalls.bribesData?.[delegationWithId(locker.id)!] || 0) * (_veBalanceOfLocker / Number(totalSupplyStaked))
235
+
228
236
  bribeMinApr = apr
229
237
  bribeMaxApr = apr
230
238
  bribeRewards = {
@@ -234,7 +242,7 @@ export const fetchLockers = async ({ provider, chainId, prices, withAirdropGraph
234
242
  minBoost: '0',
235
243
  maxBoost: '0',
236
244
  hideBoostTab: true,
237
- token: 'sdcake',
245
+ token: `sd${locker.id}`,
238
246
  }
239
247
  }
240
248
 
@@ -1,4 +1,4 @@
1
- import { bsc, mainnet } from 'viem/chains'
1
+ import { bsc, fraxtal, mainnet } from 'viem/chains'
2
2
 
3
3
  const getHttpCalls = async (chainId: number) => {
4
4
  switch (chainId) {
@@ -33,6 +33,7 @@ const getHttpCalls = async (chainId: number) => {
33
33
  cvgAprs,
34
34
  }
35
35
  }
36
+ case fraxtal.id:
36
37
  case bsc.id: {
37
38
  const httpCalls = [
38
39
  (await fetch('https://raw.githubusercontent.com/stake-dao/bounties-report/main/delegationsAPRs.json')).json(),