Skip to content

Commit ff1c18f

Browse files
junliesJune
andauthored
feat: unitas bsc chain (#17273)
Co-authored-by: June <june.zhu@unipay.fi>
1 parent 85d0a77 commit ff1c18f

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

projects/unitas/index.js

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
1-
const { getTokenSupplies } = require('../helper/solana');
1+
const {getTokenSupplies} = require('../helper/solana');
22

3-
const TOKEN_MINT = '9ckR7pPPvyPadACDTzLwK2ZAEeUJ3qGSnzPs8bVaHrSy';
3+
const SOLANA_TOKEN_ADDRESS = '9ckR7pPPvyPadACDTzLwK2ZAEeUJ3qGSnzPs8bVaHrSy';
4+
const BSC_TOKEN_ADDRESS = "0xeA953eA6634d55dAC6697C436B1e81A679Db5882"
45

5-
async function tvl() {
6-
const supply = await getTokenSupplies([TOKEN_MINT]);
6+
async function solanaTvl() {
7+
const supply = await getTokenSupplies([SOLANA_TOKEN_ADDRESS]);
78
return {
8-
'usd-coin': supply[TOKEN_MINT] / 1e6
9+
'usd-coin': supply[SOLANA_TOKEN_ADDRESS] / 1e6
10+
}
11+
}
12+
13+
async function bscTvl(api) {
14+
const supply = await api.call({abi: 'erc20:totalSupply', target: BSC_TOKEN_ADDRESS})
15+
return {
16+
'usd-coin': supply / 1e18
917
}
1018
}
1119

@@ -16,6 +24,9 @@ module.exports = {
1624
timetravel: false,
1725
methodology: "Currently, tvl is composed of minted USDu",
1826
solana: {
19-
tvl
27+
tvl: solanaTvl
28+
},
29+
bsc: {
30+
tvl: bscTvl
2031
}
2132
}

0 commit comments

Comments
 (0)