Skip to content

Commit 3f86488

Browse files
0xpelucheg1nt0ki
andauthored
Fix: Pixel-Swap (FIX) (DefiLlama#13021)
Co-authored-by: g1nt0ki <[email protected]>
1 parent 707ecb2 commit 3f86488

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

projects/pixel-swap/index.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
const { get } = require('../helper/http')
22

3-
async function tvl(api) {
3+
async function tvl (api) {
44
const res = await get("https://api.pixelswap.io/apis/tokens");
5-
const tokens = res.data.tokens.map(i => i.address);
6-
const balances = res.data.tokens.map(i => i.tokenBalance);
7-
8-
api.addTokens(tokens, balances);
5+
6+
res.data.tokens.forEach(({ address, tokenBalance }) => {
7+
if (!tokenBalance) return;
8+
api.addTokens(address, tokenBalance)
9+
})
910
}
1011

1112
module.exports = {
12-
ton: {
13-
tvl,
14-
}
13+
ton: { tvl }
1514
};

0 commit comments

Comments
 (0)