Files
leallenl 28d9275858 feat: Add Binlayer (#10563)
Co-authored-by: leallenl <leallenl@gmail.com>
2024-06-08 10:14:06 +02:00

16 lines
575 B
JavaScript

const { sumTokens2 } = require('../helper/unwrapLPs')
const { getConfig } = require('../helper/cache')
const chains = ['bsc']
chains.forEach(chain => {
module.exports[chain] = {
tvl: async function (api) {
const { result } = await getConfig(`binlayer/${api.chain}`, `https://api.binlayer.xyz/v1/stakeList?chainId=${api.chainId}`)
const vaults = result.map(f => f.strategyAddress)
const tokens = await api.multiCall({ abi: 'address:underlyingToken', calls: vaults })
return sumTokens2({ api, tokensAndOwners2: [tokens, vaults], })
}
}
})