diff --git a/packages/shared/src/lib/core/network/apis/explorer.api.ts b/packages/shared/src/lib/core/network/apis/explorer.api.ts index d64251786a..1abe0060a0 100644 --- a/packages/shared/src/lib/core/network/apis/explorer.api.ts +++ b/packages/shared/src/lib/core/network/apis/explorer.api.ts @@ -1,17 +1,10 @@ -import { DEFAULT_APPLICATION_JSON_REQUEST_OPTIONS, buildUrl } from '@core/utils' -import {} from '../enums' +import { DEFAULT_APPLICATION_JSON_REQUEST_OPTIONS } from '@core/utils/constants' +import { buildUrl } from '@core/utils/url' +import { SupportedNetworkId } from '../constants' import { DEFAULT_EXPLORER_API_BASE_URL } from '../constants/default-explorer-api-base-url.constant' import { ExplorerApiEndpoint } from '../enums' import { IExplorerApiNetwork, IExplorerApiNetworks } from '../interfaces' -import { NetworkId } from '../types' -import { SupportedStardustNetworkId } from '../constants' - -const ExplorerNetworkId = { - [SupportedStardustNetworkId.Iota]: 'mainnet', - [SupportedStardustNetworkId.Shimmer]: 'shimmer', - [SupportedStardustNetworkId.IotaTestnet]: 'iota-testnet', - [SupportedStardustNetworkId.Testnet]: 'shimmer-testnet', -} +import type { NetworkId } from '../types' export class ExplorerApi { static async makeRequest(endpoint: ExplorerApiEndpoint): Promise { @@ -35,6 +28,12 @@ export class ExplorerApi { } static async getNetworkInfo(networkId: NetworkId): Promise { + const ExplorerNetworkId = { + [SupportedNetworkId.Iota]: 'mainnet', + [SupportedNetworkId.Shimmer]: 'shimmer', + [SupportedNetworkId.IotaTestnet]: 'iota-testnet', + [SupportedNetworkId.Testnet]: 'shimmer-testnet', + } const networksInfo = await ExplorerApi.makeRequest(ExplorerApiEndpoint.Networks) const networkInfo = networksInfo?.networks.find((network) => network.network === ExplorerNetworkId[networkId]) return networkInfo diff --git a/packages/shared/src/lib/core/network/constants/supported-network-id.constant.ts b/packages/shared/src/lib/core/network/constants/supported-network-id.constant.ts index c8a12949b7..5503ead686 100644 --- a/packages/shared/src/lib/core/network/constants/supported-network-id.constant.ts +++ b/packages/shared/src/lib/core/network/constants/supported-network-id.constant.ts @@ -1,4 +1,4 @@ -import { EvmNetworkId, StardustNetworkId } from '../types' +import type { EvmNetworkId, StardustNetworkId } from '../types/network-id.type' import { ChainId } from '../enums/chain-id.enum' import { NetworkNamespace } from '../enums/network-namespace.enum' import { StardustNetworkName } from '../enums/stardust-network-name.enum'