Skip to content

Commit

Permalink
Merge pull request #35 from axelarnetwork/chore/TVL
Browse files Browse the repository at this point in the history
chore: fix getCirculatingSupply
  • Loading branch information
nrsirapop authored May 10, 2024
2 parents 1e0e371 + 279162a commit 5a1025f
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion methods/tokens/getTokenCirculatingSupply.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const { isNumber, toNumber } = require('../../utils/number');
const { timeDiff } = require('../../utils/time');

module.exports = async coingeckoId => {
if (coingeckoId) return;
if (!coingeckoId) return;

const cacheId = coingeckoId;
// get circulating supply from cache
Expand Down
4 changes: 2 additions & 2 deletions methods/tvl/getTVL.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ module.exports = async params => {
const isNativeOnEVM = !!getChainData(native_chain, 'evm');
const isNativeOnCosmos = !!getChainData(native_chain, 'cosmos');
const isNativeOnAxelarnet = native_chain === 'axelarnet';
const isCanonicalITS = assetType === 'its' && Object.values({ ...addresses }).find(d => d.token_manager_type?.startsWith('lockUnlock'));
const isCanonicalITS = assetType === 'its' && Object.values({ ...addresses }).findIndex(d => d.token_manager_type?.startsWith('lockUnlock')) > -1;

let tvl = Object.fromEntries((await Promise.all(
_.concat(evmChainsData, cosmosChainsData).map(d => new Promise(async resolve => {
Expand Down Expand Up @@ -229,7 +229,7 @@ module.exports = async params => {
const percent_diff_supply = evm_escrow_address ? evm_escrow_balance > 0 && total_on_evm > 0 ? Math.abs(evm_escrow_balance - total_on_evm) * 100 / evm_escrow_balance : null : total > 0 && total_on_evm >= 0 && total_on_cosmos >= 0 && total_on_evm + total_on_cosmos > 0 ? Math.abs(total - (total_on_evm + total_on_cosmos)) * 100 / total : null;

const pricesData = await getTokensPrice({ symbol: asset });
const { price } = { ...(pricesData?.[asset] || Object.values({ ...pricesData }).find(d => d.denom === asset)) };
const { price } = { ...(pricesData?.[asset] || pricesData?.[assetData?.symbol] || Object.values({ ...pricesData }).find(d => d.denom === asset)) };
data.push({
asset, assetType, price,
tvl, total_on_evm, total_on_cosmos, total,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "axelarscan-api",
"version": "0.0.9",
"version": "0.0.10",
"description": "Axelarscan API",
"main": "index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion terraform/mainnet/variables.tf.example
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ variable "log_level" {

variable "app_version" {
description = "App version, same as docker image version"
default = "0.0.9"
default = "0.0.10"
validation {
error_message = "Must be valid semantic version. $Major.$Minor.$Patch"
condition = can(regex("^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$", var.app_version))
Expand Down
2 changes: 1 addition & 1 deletion terraform/stagenet/variables.tf.example
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ variable "log_level" {

variable "app_version" {
description = "App version, same as docker image version"
default = "0.0.9"
default = "0.0.10"
validation {
error_message = "Must be valid semantic version. $Major.$Minor.$Patch"
condition = can(regex("^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$", var.app_version))
Expand Down
2 changes: 1 addition & 1 deletion terraform/testnet/variables.tf.example
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ variable "log_level" {

variable "app_version" {
description = "App version, same as docker image version"
default = "0.0.9"
default = "0.0.10"
validation {
error_message = "Must be valid semantic version. $Major.$Minor.$Patch"
condition = can(regex("^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$", var.app_version))
Expand Down

0 comments on commit 5a1025f

Please sign in to comment.