fixed issues

This commit is contained in:
liangping 2024-04-28 09:17:48 +08:00
parent 683c569f31
commit ca29dbba7d

View File

@ -138,19 +138,21 @@ function apiConverter(api: any[]) {
export function fromLocal(lc: LocalConfig): ChainConfig { export function fromLocal(lc: LocalConfig): ChainConfig {
const conf = {} as ChainConfig; const conf = {} as ChainConfig;
conf.assets = lc.assets.map((x) => ({ if(lc.assets && Array.isArray(lc.assets)) {
name: x.base, conf.assets = lc.assets.map((x) => ({
base: x.base, name: x.base,
display: x.symbol, base: x.base,
symbol: x.symbol, display: x.symbol,
logo_URIs: { svg: x.logo }, symbol: x.symbol,
coingecko_id: x.coingecko_id, logo_URIs: { svg: x.logo },
exponent: x.exponent, coingecko_id: x.coingecko_id,
denom_units: [ exponent: x.exponent,
{ denom: x.base, exponent: 0 }, denom_units: [
{ denom: x.symbol.toLowerCase(), exponent: Number(x.exponent) }, { denom: x.base, exponent: 0 },
], { denom: x.symbol.toLowerCase(), exponent: Number(x.exponent) },
})); ],
}));
}
conf.versions = { conf.versions = {
cosmosSdk: lc.sdk_version cosmosSdk: lc.sdk_version
} }