File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 11const axios = require ( 'axios' )
22
3+ const rstOBOL = '0x1932e815254c53B3Ecd81CECf252A5AC7f0e8BeA'
34const ENDPOINT_BASE = 'https://api.obol.tech/tvs/mainnet' ;
5+ const stakeForSharesABI = "function stakeForShares(uint256 _shares) view returns (uint256)"
6+
47const sleep = ( ms ) => new Promise ( resolve => setTimeout ( resolve , ms ) ) ;
58
69const buildUrl = ( { limit, page, dateString } ) => `${ ENDPOINT_BASE } ?limit=${ limit } &page=${ page } &details=true×tamp=${ encodeURIComponent ( dateString ) } ` ;
@@ -38,6 +41,13 @@ const tvl = async (api) => {
3841 } )
3942}
4043
44+ const staking = async ( api ) => {
45+ const underlying = await api . call ( { target : rstOBOL , abi : 'address:STAKE_TOKEN' } )
46+ const supply = await api . call ( { target : rstOBOL , abi : 'uint256:totalShares' } )
47+ const stakeForShares = await api . call ( { target : rstOBOL , abi : stakeForSharesABI , params :[ supply ] } )
48+ api . add ( underlying , stakeForShares )
49+ }
50+
4151module . exports = {
42- ethereum : { tvl }
52+ ethereum : { tvl, staking }
4353}
You can’t perform that action at this time.
0 commit comments