|
1 | 1 | import { |
| 2 | + convertModularChainInfoToChainInfo, |
2 | 3 | DenomHelper, |
3 | 4 | KVStore, |
4 | 5 | PrefixKVStore, |
@@ -1189,19 +1190,23 @@ export class ChainsService { |
1189 | 1190 | ): ModularChainInfo[] { |
1190 | 1191 | return modularChainInfos.map((modularChainInfo) => { |
1191 | 1192 | if ("cosmos" in modularChainInfo) { |
1192 | | - const cosmos = this.getChainInfoOrThrow(modularChainInfo.chainId); |
1193 | | - const mergedCosmos = this.mergeChainInfosWithDynamics([cosmos])[0]; |
| 1193 | + const chainInfo = convertModularChainInfoToChainInfo( |
| 1194 | + modularChainInfo |
| 1195 | + ) as ChainInfo; |
| 1196 | + const mergedCosmos = this.mergeChainInfosWithDynamics([chainInfo])[0]; |
| 1197 | + |
| 1198 | + const { evm, ...cosmos } = mergedCosmos; |
1194 | 1199 |
|
1195 | 1200 | return { |
1196 | 1201 | chainId: cosmos.chainId, |
1197 | 1202 | chainName: cosmos.chainName, |
1198 | 1203 | chainSymbolImageUrl: cosmos.chainSymbolImageUrl, |
1199 | 1204 | isTestnet: cosmos.isTestnet, |
1200 | | - isNative: !(mergedCosmos.beta ?? false), |
1201 | | - cosmos: mergedCosmos, |
1202 | | - ...(mergedCosmos.evm && { |
| 1205 | + isNative: !mergedCosmos.beta, |
| 1206 | + cosmos, |
| 1207 | + ...(!!evm && { |
1203 | 1208 | evm: { |
1204 | | - ...mergedCosmos.evm, |
| 1209 | + ...evm, |
1205 | 1210 | currencies: mergedCosmos.currencies, |
1206 | 1211 | feeCurrencies: mergedCosmos.feeCurrencies, |
1207 | 1212 | bip44: mergedCosmos.bip44, |
@@ -1346,15 +1351,17 @@ export class ChainsService { |
1346 | 1351 | } as ModularChainInfo; |
1347 | 1352 | } |
1348 | 1353 |
|
| 1354 | + const { evm, ...cosmos } = chainInfo; |
| 1355 | + |
1349 | 1356 | return { |
1350 | 1357 | chainId: chainInfo.chainId, |
1351 | 1358 | chainName: chainInfo.chainName, |
1352 | 1359 | chainSymbolImageUrl: chainInfo.chainSymbolImageUrl, |
1353 | 1360 | isNative: false, |
1354 | | - cosmos: chainInfo, |
1355 | | - ...(chainInfo.evm && { |
| 1361 | + cosmos, |
| 1362 | + ...(!!evm && { |
1356 | 1363 | evm: { |
1357 | | - ...chainInfo.evm, |
| 1364 | + ...evm, |
1358 | 1365 | currencies: chainInfo.currencies, |
1359 | 1366 | feeCurrencies: chainInfo.feeCurrencies, |
1360 | 1367 | bip44: chainInfo.bip44, |
|
0 commit comments