Skip to content

Commit

Permalink
Merge pull request #41 from axelarnetwork/chore/getSupply
Browse files Browse the repository at this point in the history
chore: check all page is valid
  • Loading branch information
nrsirapop authored May 12, 2024
2 parents 20df03a + 983a7ac commit 743e14e
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
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.15",
"version": "0.0.16",
"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.15"
default = "0.0.16"
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.15"
default = "0.0.16"
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.15"
default = "0.0.16"
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
4 changes: 2 additions & 2 deletions utils/chain/cosmos.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,12 @@ const getIBCSupply = async (chain, denomData) => {
let nextKey = true;
while (nextKey) {
const response = await lcds.query('/cosmos/bank/v1beta1/supply', { 'pagination.limit': 3000, 'pagination.key': nextKey && typeof nextKey !== 'boolean' ? nextKey : undefined });
responsive = responsive || !!response?.supply;
supplies = _.concat(supplies, toArray(response?.supply));
nextKey = response?.pagination?.next_key;

supply = supplies.find(d => equalsIgnoreCase(d.denom, ibc_denom))?.amount;
if (isNumber(supply) && nextKey) break;
responsive = isNumber(supply) || !!response?.supply;
if ((isNumber(supply) && nextKey) || !responsive) break;
}

if (!(supply && supply !== '0') && responsive) supply = '0';
Expand Down

0 comments on commit 743e14e

Please sign in to comment.