Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix getCirculatingSupply #35

Merged
merged 1 commit into from
May 10, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
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