diff --git a/projects/hashnote/index.js b/projects/hashnote/index.js index 35bbcf0875df..9930d8a14c66 100644 --- a/projects/hashnote/index.js +++ b/projects/hashnote/index.js @@ -1,25 +1,40 @@ const { call } = require('../helper/chain/near') +const { get } = require("../helper/http"); -const NEAR = '0x136471a34f6ef19fE571EFFC1CA711fdb8E49f2b' +const USYC = '0x136471a34f6ef19fE571EFFC1CA711fdb8E49f2b' const CONFIG = { canto: '0xfb8255f0de21acebf490f1df6f0bdd48cc1df03b', - ethereum: NEAR, - near: 'usyc.near' + ethereum: USYC, + near: 'usyc.near', + noble: 'uusyc' } const evmTvl = async (api, token) => { const supply = await api.call({ target: token, abi: 'erc20:totalSupply' }) - api.add(NEAR, supply, { skipChain: true }) + api.add(USYC, supply, { skipChain: true }) } const nonEvmTvl = async (api, token) => { const supply = await call(token, 'ft_total_supply', {}); - api.add(NEAR, supply, { skipChain: true }) + api.add(USYC, supply, { skipChain: true }); +} + +const nobleTvl = async (api, token) => { + const res = await get(`https://rest.cosmos.directory/noble/cosmos/bank/v1beta1/supply/by_denom?denom=${token}`); + api.add(USYC, parseInt(res.amount.amount), { skipChain: true }); } Object.entries(CONFIG).forEach(([chain, address]) => { module.exports[chain] = { - tvl: async (api) => (chain === 'near' ? nonEvmTvl(api, address) : evmTvl(api, address)) + tvl: async (api) => { + if (chain === 'near') { + return nonEvmTvl(api, address); + } else if (chain === 'noble') { + return nobleTvl(api, address); + } else { + return evmTvl(api, address); + } + } }; -}); +}); \ No newline at end of file diff --git a/projects/helper/coreAssets.json b/projects/helper/coreAssets.json index 4ee765914ac3..1542216f88e8 100644 --- a/projects/helper/coreAssets.json +++ b/projects/helper/coreAssets.json @@ -1952,7 +1952,6 @@ "noble": { "USDC": "uusdc", "USDY": "ausdy", - "uusdc": "uusdc", "ausdy": "ausdy" }, "ripple": {