Skip to content

Commit

Permalink
fix lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ftm1337 authored Jul 21, 2024
1 parent 118232b commit 17b8373
Showing 1 changed file with 0 additions and 53 deletions.
53 changes: 0 additions & 53 deletions projects/elocks/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,37 +27,6 @@ async function findTvl(chain, nft, block, api) {
chain,
})
len = Number(len);
//console.log("nft.ts", len);


/*
/// Using TVL GURU (on-chain price calcs)
let calls = []
for (let i = 1; i <= len; i++) { calls.push({ params: [i] }) }
let { output: lockaddrs } = await sdk.api.abi.multiCall({
target: nft,
abi: IELOCKS.lockers,
calls,
chain,
})
lockaddrs = lockaddrs.map(i=>i.output)
//console.log("lockaddrs",lockaddrs)
const ltvls = (
await sdk.api.abi.multiCall({
abi: IELOCKS.tvl,
calls: lockaddrs.map((la) => ({ target: la })),
chain
})
).output.map((tvl) => Number(tvl.output)/1e18);
//console.log("ltvls",ltvls)
return { tether: ltvls.reduce((a,b)=>a+b) };
*/


/// Using DefiLlama pricing

let calls = []
for (let i = 1; i <= len; i++) { calls.push({ params: [i] }) }
Expand All @@ -67,32 +36,10 @@ async function findTvl(chain, nft, block, api) {
calls,
chain,
})
/*
/// Using { 0x123: 123, 0xtoken2: 456, ... }
//las = las.map(i=> ({lpt: i.output[0], amt: Number(i.output[1])/1e0}) )
las = las.map(i=> ({ [i.output[0].toLowerCase()] : Number(i.output[1])/1e0 }) )
let lpamts = {};
las.forEach(obj => {
for (let key in obj) {
if (lpamts[key]) {
lpamts[key] += obj[key];
} else {
lpamts[key] = obj[key];
}
}
});
//console.log("las",las,lpamts)
console.log(await getTokenPrices(lpamts))
return lpamts;
*/
lpBalances = las.map(i=> ({token: i.output[0], balance: Number(i.output[1])/1e0}) )

Check failure on line 39 in projects/elocks/index.js

View workflow job for this annotation

GitHub Actions / test

'lpBalances' is not defined
//console.log("las",las,lpBalances)
tokens = lpBalances.map(i=>i.token)

Check failure on line 40 in projects/elocks/index.js

View workflow job for this annotation

GitHub Actions / test

'tokens' is not defined

Check failure on line 40 in projects/elocks/index.js

View workflow job for this annotation

GitHub Actions / test

'lpBalances' is not defined
bals = lpBalances.map(i=>i.balance)

Check failure on line 41 in projects/elocks/index.js

View workflow job for this annotation

GitHub Actions / test

'bals' is not defined

Check failure on line 41 in projects/elocks/index.js

View workflow job for this annotation

GitHub Actions / test

'lpBalances' is not defined
api.addTokens(tokens, bals)

Check failure on line 42 in projects/elocks/index.js

View workflow job for this annotation

GitHub Actions / test

'tokens' is not defined

Check failure on line 42 in projects/elocks/index.js

View workflow job for this annotation

GitHub Actions / test

'bals' is not defined
//return await sumUnknownTokens({ api, tokensAndOwners: [], useDefaultCoreAssets: true, lps: tokens, resolveLP: true, })
//await unwrapUniswapLPs(lpBalances, chain)
return await unwrapUniswapLPs(bals, lpBalances, block, chain)

Check failure on line 43 in projects/elocks/index.js

View workflow job for this annotation

GitHub Actions / test

'bals' is not defined

Check failure on line 43 in projects/elocks/index.js

View workflow job for this annotation

GitHub Actions / test

'lpBalances' is not defined
}

Expand Down

0 comments on commit 17b8373

Please sign in to comment.