1.0.9 • Published 2 years ago
atlas-dashboard-apis v1.0.9
This is Atlas dashboard api package
Functions
- getPriceWithTokenAddress
Get price of token
Usage:
token.realPrice = (await getPriceWithTokenAddress(token.tokenStr));
token.price = '$' + token.realPrice.toFixed(6);
- getLPPrice
Get total supply, coin, pc of lp token
Usage:
const [totalSupply, coin, pc] = await getLPPrice(connection, token.tokenStr);
let price = 0;
price += prices[coin.symbol] * coin.balance.fixed(2);
price += prices[pc.symbol] * pc.balance.fixed(2);
token.realPrice = price / totalSupply;
token.price = '$' + token.realPrice.toFixed(6);
How to publish
npm publish
Current version
1.0.8