diff --git a/methods/tokens/getTokenCirculatingSupply.js b/methods/tokens/getTokenCirculatingSupply.js index b0578549..6f43a2b9 100644 --- a/methods/tokens/getTokenCirculatingSupply.js +++ b/methods/tokens/getTokenCirculatingSupply.js @@ -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 diff --git a/methods/tvl/getTVL.js b/methods/tvl/getTVL.js index b5d6451f..4ba53dfa 100644 --- a/methods/tvl/getTVL.js +++ b/methods/tvl/getTVL.js @@ -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 => { @@ -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, diff --git a/package.json b/package.json index 70556b11..35897206 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "axelarscan-api", - "version": "0.0.9", + "version": "0.0.10", "description": "Axelarscan API", "main": "index.js", "scripts": { diff --git a/terraform/mainnet/variables.tf.example b/terraform/mainnet/variables.tf.example index 91e5c47b..a3414acd 100644 --- a/terraform/mainnet/variables.tf.example +++ b/terraform/mainnet/variables.tf.example @@ -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)) diff --git a/terraform/stagenet/variables.tf.example b/terraform/stagenet/variables.tf.example index f11bd219..cf0eacae 100644 --- a/terraform/stagenet/variables.tf.example +++ b/terraform/stagenet/variables.tf.example @@ -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)) diff --git a/terraform/testnet/variables.tf.example b/terraform/testnet/variables.tf.example index a270ac9f..08ad857b 100644 --- a/terraform/testnet/variables.tf.example +++ b/terraform/testnet/variables.tf.example @@ -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))