diff --git a/chains/chain.js b/chains/chain.js index aebd533..d2bf1a1 100644 --- a/chains/chain.js +++ b/chains/chain.js @@ -16,13 +16,15 @@ function Chain(client, data, paramsData, opts) { chain.name = chain.chain_name const coingecko = prices?.coingecko || {} + const assets = assetlist && assetlist.assets.map(asset => { const price = coingecko[asset.display] - return ChainAsset(asset, price && { coingecko: price }) }); const baseAsset = assets && assets[0] + const image = chain.logo_URIs?.svg || chain.logo_URIs?.png || baseAsset?.image + const prefix = chain.bech32_prefix const { consensusPrefix } = config @@ -30,7 +32,7 @@ function Chain(client, data, paramsData, opts) { const health = await apiHealth(type) return ChainApis(health) } - + async function apiHealth(type) { const healthPath = {} if(type){ @@ -83,6 +85,7 @@ function Chain(client, data, paramsData, opts) { chainId: chain.chain_id, name: chain.name, prettyName: chain.pretty_name, + image, website: chain.website, denom: baseAsset?.denom, symbol: baseAsset?.symbol, diff --git a/chains/chainAsset.js b/chains/chainAsset.js index 4b985f1..06eb0ff 100644 --- a/chains/chainAsset.js +++ b/chains/chainAsset.js @@ -3,7 +3,7 @@ function ChainAsset(data, prices) { const base = data.denom_units.find(el => el.denom === data.base) const display = data.denom_units.find(el => el.denom === data.display) const logo_URIs = data.logo_URIs - const image = logo_URIs && (logo_URIs.svg || logo_URIs.png) + const image = logo_URIs?.svg || logo_URIs?.png return { name, diff --git a/chains/chainsController.js b/chains/chainsController.js index 35a45b6..6fe77fb 100644 --- a/chains/chainsController.js +++ b/chains/chainsController.js @@ -22,7 +22,7 @@ function ChainsController(registry) { denom: baseAsset?.denom, decimals: baseAsset?.decimals, coingecko_id: baseAsset?.coingecko_id, - image: baseAsset?.image, + image: chain.image, website: chain.website, height: apis.bestHeight(), best_apis: {