Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions projects/CatFee/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const {
fetchURL
} = require('../helper/utils');

async function getCurrentStake() {
let result = await fetchURL('https://catfee.io/api/stake/public/project/stat');
let trx = parseInt(result.data.data.total_staked_amount_sun)/ 1000_000;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we fetch this value on chain instead please

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CatFee Staking Vault is designed specifically for beginner users, so users don't trigger contract.Users use their wallet to delegate resource to us.You can view all data on TRON chain in our project. https://catfee.io/staking/

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We dont track native chain staking. Chain staking must be liquid, or your project must have custody of the assets for it to count as TVL

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I modified the code to fetch data from TRON blockchain.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We dont track native chain staking. Chain staking must be liquid, or your project must have custody of the assets for it to count as TVL

return trx;
}

async function tvl() {
return {
"tron": await getCurrentStake()
}
}

module.exports = {
tron: {
tvl,
},
}
Loading