@stake-dao/reader 0.4.14 → 0.4.16

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.
@@ -54,6 +54,27 @@ export declare const fetchLockers: ({ provider, chainId, prices, withAirdropGrap
54
54
  tokenLocked: string;
55
55
  veBalanceOfLocker: string;
56
56
  veTotalSupply: string;
57
+ rewards: {
58
+ price: number;
59
+ distribution: "streamed" | "distributed";
60
+ origin: string;
61
+ noEarn?: boolean;
62
+ isAirdrop?: boolean;
63
+ id: string;
64
+ name: string;
65
+ address: string;
66
+ symbol: string;
67
+ decimals: number;
68
+ chainId: number;
69
+ logoURI: string;
70
+ tags: string[];
71
+ extensions: {
72
+ underlying?: string;
73
+ wrapper?: string;
74
+ oftVersion?: number;
75
+ coingeckoSlug?: string;
76
+ };
77
+ }[];
57
78
  chainId: number;
58
79
  locker: import("@stake-dao/constants").Address;
59
80
  veToken: import("@stake-dao/constants").Address;
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmQhG,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kCApChE,CAAC;+BAAyB,CAAC;kCACrC,CAAC;qCAA+B,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgTvD,CAAA"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stake-dao/reader",
3
3
  "description": "",
4
- "version": "0.4.14",
4
+ "version": "0.4.16",
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.9"
38
+ "@stake-dao/constants": "0.4.10"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@types/lodash-es": "^4.17.12"
@@ -5,7 +5,7 @@ import lockersMulticallAbi from '../../abis/lockersMulticall.js'
5
5
  import { Zero, getSdtInflationData } from '../../index.js'
6
6
  import type { Price } from '../../prices.js'
7
7
  import { handlePromise } from '../../strategies/utils/promise.js'
8
- import { type Call, type MultiChainCall, multicall, multichainMulticall } from '../../utils.js'
8
+ import { type Call, type MultiChainCall, equalTlc, multicall, multichainMulticall } from '../../utils.js'
9
9
  import { extractFees, feeCalls } from '../utils/callsForLockers/feeCalls.js'
10
10
  import callsForLockers from '../utils/callsForLockers/index.js'
11
11
  import getBribesRewardsData, { type TBribesRewards } from '../utils/getBribesRewardsData.js'
@@ -141,6 +141,15 @@ export const fetchLockers = async ({ provider, chainId, prices, withAirdropGraph
141
141
  locker.id === 'mav' ? formatUnits(chunkedRawLockersData[11].result[0], locker.token.decimals) : '4'
142
142
 
143
143
  const sideChains = locker.extensions.sideChains?.map((sideChain) => {
144
+ const rewards =
145
+ sideChain.rewards?.map((reward) => {
146
+ const price = prices.find((p) => equalTlc(p.address, reward.address))?.usdPrice || 0
147
+ return {
148
+ ...reward,
149
+ price,
150
+ }
151
+ }) || []
152
+
144
153
  const tokenLocked = rawLockersSideChainData[sideChain.chainId].shift().result
145
154
  return {
146
155
  ...sideChain,
@@ -153,6 +162,7 @@ export const fetchLockers = async ({ provider, chainId, prices, withAirdropGraph
153
162
  locker.token.decimals,
154
163
  ),
155
164
  veTotalSupply: formatUnits(rawLockersSideChainData[sideChain.chainId].shift().result, locker.token.decimals),
165
+ rewards,
156
166
  }
157
167
  })
158
168