From 85ccc421643883e548fa9e76c7f0dfb7da935495 Mon Sep 17 00:00:00 2001 From: Leonard Mocanu Date: Tue, 10 Dec 2024 15:50:01 +0200 Subject: [PATCH] feat: adds Taraxa staking and tvl adapter --- projects/taraxa/index.js | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 projects/taraxa/index.js diff --git a/projects/taraxa/index.js b/projects/taraxa/index.js new file mode 100644 index 000000000000..b373f9e7f893 --- /dev/null +++ b/projects/taraxa/index.js @@ -0,0 +1,33 @@ +const TARAXA_STAKING_CONTRACT = "0x00000000000000000000000000000000000000fe"; +const TARAXA_ECOSYSTEM_FUND_ADDRESS = + "0x723304d1357a2334fcf902aa3d232f5139080a1b"; +const TARAXA_FOUNDATION_ADDRESS = "0x723304d1357a2334fcf902aa3d232f5139080a1b"; + +async function staking(api) { + const balance = await api.provider.getBalance( + TARAXA_STAKING_CONTRACT, + api.block + ); + api.addGasToken(Number(balance) / 10 ** 18); +} + +async function tvl(api) { + const balanceEcosystem = await api.provider.getBalance( + TARAXA_ECOSYSTEM_FUND_ADDRESS, + api.block + ); + + const balanceFoundation = await api.provider.getBalance( + TARAXA_FOUNDATION_ADDRESS, + api.block + ); + + api.addGasToken((Number(balanceEcosystem) + Number(balanceFoundation)) / 10 ** 18); +} + +module.exports = { + tara: { + tvl, + staking, + }, +};