diff --git a/packages/assets/CHANGELOG.md b/packages/assets/CHANGELOG.md index 0a7735a48..bef08bfca 100644 --- a/packages/assets/CHANGELOG.md +++ b/packages/assets/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [1.25.0](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/assets@1.24.0...@chain-registry/assets@1.25.0) (2023-12-15) + +**Note:** Version bump only for package @chain-registry/assets + + + + + +# [1.24.0](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/assets@1.23.0...@chain-registry/assets@1.24.0) (2023-12-15) + +**Note:** Version bump only for package @chain-registry/assets + + + + + # [1.23.0](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/assets@1.22.0...@chain-registry/assets@1.23.0) (2023-12-15) **Note:** Version bump only for package @chain-registry/assets diff --git a/packages/assets/package.json b/packages/assets/package.json index 77b906e58..d7d6eb91b 100644 --- a/packages/assets/package.json +++ b/packages/assets/package.json @@ -1,6 +1,6 @@ { "name": "@chain-registry/assets", - "version": "1.23.0", + "version": "1.25.0", "description": "Chain Registry Asset Lists", "author": "Dan Lynch ", "homepage": "https://github.com/cosmology-tech/chain-registry", @@ -49,14 +49,14 @@ "@babel/plugin-transform-runtime": "7.21.4", "@babel/preset-env": "7.21.4", "@babel/preset-typescript": "^7.21.4", - "@chain-registry/utils": "^1.15.0", + "@chain-registry/utils": "^1.16.0", "@types/jest": "^29.5.1", "@typescript-eslint/eslint-plugin": "5.59.0", "@typescript-eslint/parser": "5.59.0", "babel-core": "7.0.0-bridge.0", "babel-jest": "29.5.0", "babel-watch": "^7.7.2", - "chain-registry": "^1.22.0", + "chain-registry": "^1.24.0", "cross-env": "^7.0.2", "eslint": "8.38.0", "eslint-config-prettier": "^8.8.0", diff --git a/packages/chain-registry/CHANGELOG.md b/packages/chain-registry/CHANGELOG.md index ba6a48eda..f4a66b8ba 100644 --- a/packages/chain-registry/CHANGELOG.md +++ b/packages/chain-registry/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [1.24.0](https://github.com/cosmology-tech/chain-registry/compare/chain-registry@1.23.0...chain-registry@1.24.0) (2023-12-15) + +**Note:** Version bump only for package chain-registry + + + + + +# [1.23.0](https://github.com/cosmology-tech/chain-registry/compare/chain-registry@1.22.0...chain-registry@1.23.0) (2023-12-15) + +**Note:** Version bump only for package chain-registry + + + + + # [1.22.0](https://github.com/cosmology-tech/chain-registry/compare/chain-registry@1.21.0...chain-registry@1.22.0) (2023-12-15) **Note:** Version bump only for package chain-registry diff --git a/packages/chain-registry/package.json b/packages/chain-registry/package.json index adbe27271..06534c0c8 100644 --- a/packages/chain-registry/package.json +++ b/packages/chain-registry/package.json @@ -1,6 +1,6 @@ { "name": "chain-registry", - "version": "1.22.0", + "version": "1.24.0", "description": "Cosmos chain registry ⚛️", "author": "Dan Lynch ", "homepage": "https://github.com/cosmology-tech/chain-registry/tree/master/packages/chain-registry#readme", @@ -48,7 +48,7 @@ "@babel/plugin-transform-runtime": "7.21.4", "@babel/preset-env": "7.21.4", "@babel/preset-typescript": "^7.21.4", - "@chain-registry/utils": "^1.15.0", + "@chain-registry/utils": "^1.16.0", "babel-core": "7.0.0-bridge.0", "babel-eslint": "10.1.0", "cross-env": "^7.0.2", diff --git a/packages/chain-registry/scripts/build.js b/packages/chain-registry/scripts/build.js index b011e2371..209515706 100644 --- a/packages/chain-registry/scripts/build.js +++ b/packages/chain-registry/scripts/build.js @@ -1,8 +1,16 @@ const fs = require('fs'); const deepmerge = require('deepmerge'); const glob = require('glob').sync; +const path = require('path'); + +const NON_INFO_DIRS = ['_memo_keys', '_scripts', '_template', '.github']; + +const paths = glob(`${__dirname}/../chain-registry/**/*.json`).filter((a) => { + let dir = a.split('chain-registry/chain-registry')[1]; + dir = path.basename(path.dirname(dir)); + return !NON_INFO_DIRS.includes(dir); +}); -const paths = glob(`${__dirname}/../chain-registry/**/*.json`); const assets = []; const chains = []; const ibcs = []; diff --git a/packages/chain-registry/src/assets.ts b/packages/chain-registry/src/assets.ts index b9ae9e476..9479e000b 100644 --- a/packages/chain-registry/src/assets.ts +++ b/packages/chain-registry/src/assets.ts @@ -2715,34 +2715,6 @@ const assets: AssetList[] = [ } ] }, - { - $schema: '../assetlist.schema.json', - chain_name: '', - assets: [ - { - description: 'The native staking token of EXAMPLE.', - denom_units: [ - { - denom: 'uexp', - exponent: 0 - }, - { - denom: 'example', - exponent: 6 - } - ], - base: 'uexample', - name: 'Example', - display: 'example', - symbol: 'EXP', - logo_URIs: { - png: 'https://raw.githubusercontent.com/cosmos/chain-registry/master/_template/images/chain_image.png', - svg: 'https://raw.githubusercontent.com/cosmos/chain-registry/master/_template/images/chain_image.svg' - }, - coingecko_id: '' - } - ] - }, { $schema: '../assetlist.schema.json', chain_name: '8ball', diff --git a/packages/chain-registry/src/chains.ts b/packages/chain-registry/src/chains.ts index 91385cd87..c321a5f06 100644 --- a/packages/chain-registry/src/chains.ts +++ b/packages/chain-registry/src/chains.ts @@ -1,119 +1,5 @@ import { Chain } from '@chain-registry/types'; const chains: Chain[] = [ - { - $schema: '../chain.schema.json', - chain_name: '', - status: 'live', - website: '', - network_type: 'mainnet', - pretty_name: '', - chain_id: '', - bech32_prefix: '', - daemon_name: '', - node_home: '$HOME/', - key_algos: ['secp256k1'], - slip44: 118, - fees: { - fee_tokens: [ - { - denom: '', - fixed_min_gas_price: 0, - low_gas_price: 0, - average_gas_price: 0.025, - high_gas_price: 0.04 - } - ] - }, - staking: { - staking_tokens: [ - { - denom: '' - } - ] - }, - codebase: { - git_repo: '', - recommended_version: 'v1.0.0', - compatible_versions: ['v1.0.0'], - cosmos_sdk_version: '', - cosmwasm_enabled: true, - cosmwasm_path: '$HOME/.example/data/wasm', - binaries: { - 'linux/amd64': 'OPTIONAL, REMOVE IF NOT NEEDED' - }, - genesis: { - genesis_url: - 'https://raw.githubusercontent.com/example-network/networks/master/mainnet/genesis.json' - }, - versions: [ - { - name: 'v1', - recommended_version: 'v1.0.0', - compatible_versions: ['v1.0.0'], - cosmos_sdk_version: '', - cosmwasm_enabled: true, - cosmwasm_path: '$HOME/.example/data/wasm', - binaries: { - 'linux/amd64': 'OPTIONAL, REMOVE IF NOT NEEDED' - } - } - ] - }, - logo_URIs: { - png: 'https://raw.githubusercontent.com/cosmos/chain-registry/master/_template/images/chain_image.png', - svg: 'https://raw.githubusercontent.com/cosmos/chain-registry/master/_template/images/chain_image.svg' - }, - peers: { - seeds: [ - { - id: 'aab202d5648772a8b5be3db575a8a7dd577db78f', - address: 'seeds.example.com:11156', - provider: 'Example Labs' - } - ], - persistent_peers: [ - { - id: 'fca96d0a1d7127afb226a49c4c7d9126118c37e9', - address: 'example.com', - provider: 'Example Labs' - } - ] - }, - apis: { - rpc: [ - { - address: 'https://rpc.example.com', - provider: 'Example Labs' - } - ], - rest: [ - { - address: 'https://rpc.example.com', - provider: 'Example Labs' - } - ], - grpc: [ - { - address: 'https://grpc.example.com', - provider: 'Example Labs' - } - ] - }, - explorers: [ - { - kind: 'mintscan', - url: 'https://www.mintscan.io/example', - tx_page: 'https://www.mintscan.io/example/txs/${txHash}', - account_page: - 'https://www.mintscan.io/example/account/${accountAddress}' - }, - { - kind: 'ping.pub', - url: 'https://ping.pub/EXAMPLE', - tx_page: 'https://ping.pub/EXAMPLE/tx/${txHash}' - } - ] - }, { $schema: '../chain.schema.json', chain_name: '8ball', diff --git a/packages/client/CHANGELOG.md b/packages/client/CHANGELOG.md index 1c5c68b5b..aba65a5ae 100644 --- a/packages/client/CHANGELOG.md +++ b/packages/client/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [1.17.0](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/client@1.16.0...@chain-registry/client@1.17.0) (2023-12-15) + +**Note:** Version bump only for package @chain-registry/client + + + + + # [1.16.0](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/client@1.15.0...@chain-registry/client@1.16.0) (2023-12-15) **Note:** Version bump only for package @chain-registry/client diff --git a/packages/client/package.json b/packages/client/package.json index 1657dc63b..881ce1b43 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@chain-registry/client", - "version": "1.16.0", + "version": "1.17.0", "description": "Chain Registry Client", "author": "Dan Lynch ", "homepage": "https://github.com/cosmology-tech/chain-registry", @@ -77,7 +77,7 @@ "dependencies": { "@babel/runtime": "^7.21.0", "@chain-registry/types": "^0.17.0", - "@chain-registry/utils": "^1.15.0", + "@chain-registry/utils": "^1.16.0", "bfs-path": "^1.0.2", "cross-fetch": "^3.1.5" } diff --git a/packages/cosmostation/CHANGELOG.md b/packages/cosmostation/CHANGELOG.md index bd6fd1767..24b51521a 100644 --- a/packages/cosmostation/CHANGELOG.md +++ b/packages/cosmostation/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [1.27.0](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/cosmostation@1.26.0...@chain-registry/cosmostation@1.27.0) (2023-12-15) + +**Note:** Version bump only for package @chain-registry/cosmostation + + + + + +# [1.26.0](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/cosmostation@1.25.0...@chain-registry/cosmostation@1.26.0) (2023-12-15) + +**Note:** Version bump only for package @chain-registry/cosmostation + + + + + # [1.25.0](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/cosmostation@1.24.0...@chain-registry/cosmostation@1.25.0) (2023-12-15) **Note:** Version bump only for package @chain-registry/cosmostation diff --git a/packages/cosmostation/package.json b/packages/cosmostation/package.json index bc504c447..76dde91e3 100644 --- a/packages/cosmostation/package.json +++ b/packages/cosmostation/package.json @@ -1,6 +1,6 @@ { "name": "@chain-registry/cosmostation", - "version": "1.25.0", + "version": "1.27.0", "description": "Chain Registry to Cosmostation", "author": "Dan Lynch ", "homepage": "https://github.com/cosmology-tech/chain-registry", @@ -57,7 +57,7 @@ "babel-core": "7.0.0-bridge.0", "babel-jest": "29.5.0", "babel-watch": "^7.7.2", - "chain-registry": "^1.22.0", + "chain-registry": "^1.24.0", "cross-env": "^7.0.2", "eslint": "8.38.0", "eslint-config-prettier": "^8.8.0", @@ -74,7 +74,7 @@ "dependencies": { "@babel/runtime": "^7.21.0", "@chain-registry/types": "^0.17.0", - "@chain-registry/utils": "^1.15.0", + "@chain-registry/utils": "^1.16.0", "@cosmostation/extension-client": "0.1.15" } } diff --git a/packages/juno/CHANGELOG.md b/packages/juno/CHANGELOG.md index e5f02a9b4..e83ca69b5 100644 --- a/packages/juno/CHANGELOG.md +++ b/packages/juno/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [1.25.0](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/juno@1.24.0...@chain-registry/juno@1.25.0) (2023-12-15) + +**Note:** Version bump only for package @chain-registry/juno + + + + + +# [1.24.0](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/juno@1.23.0...@chain-registry/juno@1.24.0) (2023-12-15) + +**Note:** Version bump only for package @chain-registry/juno + + + + + # [1.23.0](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/juno@1.22.0...@chain-registry/juno@1.23.0) (2023-12-15) **Note:** Version bump only for package @chain-registry/juno diff --git a/packages/juno/package.json b/packages/juno/package.json index 645b5a354..df4e45dbf 100644 --- a/packages/juno/package.json +++ b/packages/juno/package.json @@ -1,6 +1,6 @@ { "name": "@chain-registry/juno", - "version": "1.23.0", + "version": "1.25.0", "description": "Chain Registry info for Juno", "author": "Dan Lynch ", "homepage": "https://github.com/cosmology-tech/chain-registry", @@ -50,14 +50,14 @@ "@babel/plugin-transform-runtime": "7.21.4", "@babel/preset-env": "7.21.4", "@babel/preset-typescript": "^7.21.4", - "@chain-registry/utils": "^1.15.0", + "@chain-registry/utils": "^1.16.0", "@types/jest": "^29.5.1", "@typescript-eslint/eslint-plugin": "5.59.0", "@typescript-eslint/parser": "5.59.0", "babel-core": "7.0.0-bridge.0", "babel-jest": "29.5.0", "babel-watch": "^7.7.2", - "chain-registry": "^1.22.0", + "chain-registry": "^1.24.0", "cross-env": "^7.0.2", "eslint": "8.38.0", "eslint-config-prettier": "^8.8.0", diff --git a/packages/keplr/CHANGELOG.md b/packages/keplr/CHANGELOG.md index 4ed520845..bf2fcf6a7 100644 --- a/packages/keplr/CHANGELOG.md +++ b/packages/keplr/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [1.29.0](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/keplr@1.28.0...@chain-registry/keplr@1.29.0) (2023-12-15) + +**Note:** Version bump only for package @chain-registry/keplr + + + + + +# [1.28.0](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/keplr@1.27.0...@chain-registry/keplr@1.28.0) (2023-12-15) + +**Note:** Version bump only for package @chain-registry/keplr + + + + + # [1.27.0](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/keplr@1.26.0...@chain-registry/keplr@1.27.0) (2023-12-15) **Note:** Version bump only for package @chain-registry/keplr diff --git a/packages/keplr/package.json b/packages/keplr/package.json index 745336f81..5cda21df2 100644 --- a/packages/keplr/package.json +++ b/packages/keplr/package.json @@ -1,6 +1,6 @@ { "name": "@chain-registry/keplr", - "version": "1.27.0", + "version": "1.29.0", "description": "Chain Registry to Keplr", "author": "Dan Lynch ", "homepage": "https://github.com/cosmology-tech/chain-registry", @@ -57,7 +57,7 @@ "babel-core": "7.0.0-bridge.0", "babel-jest": "29.5.0", "babel-watch": "^7.7.2", - "chain-registry": "^1.22.0", + "chain-registry": "^1.24.0", "cross-env": "^7.0.2", "eslint": "8.38.0", "eslint-config-prettier": "^8.8.0", diff --git a/packages/keplr/src/index.ts b/packages/keplr/src/index.ts index fd674370f..e40d58d07 100644 --- a/packages/keplr/src/index.ts +++ b/packages/keplr/src/index.ts @@ -15,7 +15,6 @@ const cleanVer = (ver: string) => { const spaces = ver.split('.').length; switch (spaces) { - case 0: case 1: return ver + '.0.0'; case 2: @@ -48,9 +47,12 @@ export const chainRegistryChainToKeplr = ( const features = []; // if NOT specified, we assume stargate, sorry not sorry - const sdkVer = cleanVer(chain.codebase?.cosmos_sdk_version ?? '0.4'); + const sdkVer = chain.codebase?.cosmos_sdk_version + ? cleanVer(chain.codebase?.cosmos_sdk_version) + : '0.40'; + // stargate - if (semver.satisfies(sdkVer, '>=0.4')) features.push('stargate'); + if (semver.satisfies(sdkVer, '>=0.40')) features.push('stargate'); // no-legacy-stdTx if (semver.satisfies(sdkVer, '>=0.43')) features.push('no-legacy-stdTx'); // until further notice, assume 'ibc-transfer' diff --git a/packages/osmosis/CHANGELOG.md b/packages/osmosis/CHANGELOG.md index e48c60826..5b607a281 100644 --- a/packages/osmosis/CHANGELOG.md +++ b/packages/osmosis/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [1.25.0](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/osmosis@1.24.0...@chain-registry/osmosis@1.25.0) (2023-12-15) + +**Note:** Version bump only for package @chain-registry/osmosis + + + + + +# [1.24.0](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/osmosis@1.23.0...@chain-registry/osmosis@1.24.0) (2023-12-15) + +**Note:** Version bump only for package @chain-registry/osmosis + + + + + # [1.23.0](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/osmosis@1.22.0...@chain-registry/osmosis@1.23.0) (2023-12-15) **Note:** Version bump only for package @chain-registry/osmosis diff --git a/packages/osmosis/package.json b/packages/osmosis/package.json index a77113942..15ad9d4f1 100644 --- a/packages/osmosis/package.json +++ b/packages/osmosis/package.json @@ -1,6 +1,6 @@ { "name": "@chain-registry/osmosis", - "version": "1.23.0", + "version": "1.25.0", "description": "Chain Registry info for Osmosis", "author": "Dan Lynch ", "homepage": "https://github.com/cosmology-tech/chain-registry", @@ -50,14 +50,14 @@ "@babel/plugin-transform-runtime": "7.21.4", "@babel/preset-env": "7.21.4", "@babel/preset-typescript": "^7.21.4", - "@chain-registry/utils": "^1.15.0", + "@chain-registry/utils": "^1.16.0", "@types/jest": "^29.5.1", "@typescript-eslint/eslint-plugin": "5.59.0", "@typescript-eslint/parser": "5.59.0", "babel-core": "7.0.0-bridge.0", "babel-jest": "29.5.0", "babel-watch": "^7.7.2", - "chain-registry": "^1.22.0", + "chain-registry": "^1.24.0", "cross-env": "^7.0.2", "eslint": "8.38.0", "eslint-config-prettier": "^8.8.0", diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md index 184afff9e..ce31b3e3b 100644 --- a/packages/utils/CHANGELOG.md +++ b/packages/utils/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [1.16.0](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/utils@1.15.0...@chain-registry/utils@1.16.0) (2023-12-15) + + +### Features + +* add getCoinGeckoIdByDenom method ([b05e67b](https://github.com/cosmology-tech/chain-registry/commit/b05e67b4b54258412d359745b1cd095987c67eb6)) + + + + + # [1.15.0](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/utils@1.14.0...@chain-registry/utils@1.15.0) (2023-12-15) **Note:** Version bump only for package @chain-registry/utils diff --git a/packages/utils/__tests__/asset-list-util.test.js b/packages/utils/__tests__/asset-list-util.test.js index 8e025a383..c1c94cee3 100644 --- a/packages/utils/__tests__/asset-list-util.test.js +++ b/packages/utils/__tests__/asset-list-util.test.js @@ -8,6 +8,7 @@ import { getAssetByDenom, getChainDenomBySymbol, getDenomByCoinGeckoId, + getCoinGeckoIdByDenom, getExponentByDenom, getSymbolByChainDenom, noDecimals @@ -86,3 +87,34 @@ describe('tests for asset-list-util', () => { expect(re).toEqual('0.000099'); }); }); + +describe('getCoinGeckoIdByDenom', () => { + it('uosmo coingecko id', () => { + const id = getCoinGeckoIdByDenom(assets, 'uosmo'); + expect(id).toEqual('osmosis'); + }); + + it('ujkl coingecko id on testnet', () => { + const id = getCoinGeckoIdByDenom(assets, 'ujkl', { + allowTestnet: true, + excludedChainNames: ['jackal'] + }); + expect(id).toEqual('jackal'); + }); + + it('uluna coingecko id on terra2', () => { + const id = getCoinGeckoIdByDenom(assets, 'uluna', { + excludedChainNames: ['terra'] + }); + expect(id).toEqual('terra-luna-2'); + }); + + it('uusdc coingecko id without traces', () => { + const id = getCoinGeckoIdByDenom(assets, 'uusdc', { + customAssetFilter(asset) { + return !asset.traces; + } + }); + expect(id).toBeNull(); + }); +}); diff --git a/packages/utils/package.json b/packages/utils/package.json index 99e3e1a89..b2d44913d 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@chain-registry/utils", - "version": "1.15.0", + "version": "1.16.0", "description": "Chain Registry Utils", "author": "Dan Lynch ", "homepage": "https://github.com/cosmology-tech/chain-registry", diff --git a/packages/utils/src/asset-list-util.ts b/packages/utils/src/asset-list-util.ts index e52424ca2..cb18995c3 100644 --- a/packages/utils/src/asset-list-util.ts +++ b/packages/utils/src/asset-list-util.ts @@ -1,4 +1,4 @@ -import { Asset, AssetDenomUnit } from '@chain-registry/types'; +import { Asset, AssetList, AssetDenomUnit } from '@chain-registry/types'; import BigNumber from 'bignumber.js'; export type CoinDenom = AssetDenomUnit['denom']; @@ -28,6 +28,38 @@ export function getDenomByCoinGeckoId( return assets.find((asset) => asset.coingecko_id === coinGeckoId).base; } +type GetCoinGeckoIdByDenomOptions = { + allowTestnet?: boolean; + customAssetFilter?: (asset: Asset) => boolean; + excludedChainNames?: string[]; +}; + +export function getCoinGeckoIdByDenom( + assets: AssetList[], + denom: CoinDenom, + { + allowTestnet = false, + customAssetFilter = () => true, + excludedChainNames = [] + }: GetCoinGeckoIdByDenomOptions = {} +): string | null { + const filteredAssetLists = assets.filter(({ chain_name }) => { + return ( + (allowTestnet || !chain_name.includes('testnet')) && + !excludedChainNames.includes(chain_name) + ); + }); + + const filteredAssets = filteredAssetLists + .flatMap(({ assets }) => assets) + .filter(({ coingecko_id }) => coingecko_id) + .filter(customAssetFilter); + + const asset = filteredAssets.find(({ base }) => base === denom); + + return asset?.coingecko_id ?? null; +} + export function getSymbolByChainDenom( assets: Asset[], denom: CoinDenom