diff --git a/packages/desktop/components/NetworkCard.svelte b/packages/desktop/components/NetworkCard.svelte index fbe7ee25a8..eebbc1fa2f 100644 --- a/packages/desktop/components/NetworkCard.svelte +++ b/packages/desktop/components/NetworkCard.svelte @@ -12,7 +12,7 @@ Network, NetworkHealth, NetworkNamespace, - chainStatuses, + evmNetworkStatuses, getDefaultExplorerUrl, networkStatus, setSelectedChain, @@ -31,7 +31,7 @@ let status: NetworkHealth const explorer = getDefaultExplorerUrl(network.id, ExplorerEndpoint.Address) - $: $networkStatus, $chainStatuses, $selectedAccount, setNetworkCardData() + $: $networkStatus, $evmNetworkStatuses, $selectedAccount, setNetworkCardData() function onExplorerClick(): void { if (!explorer || !address) { diff --git a/packages/desktop/components/popup/popups/ImportErc20TokenFormPopup.svelte b/packages/desktop/components/popup/popups/ImportErc20TokenFormPopup.svelte index e8f09a9ac9..f9f2d3bec2 100644 --- a/packages/desktop/components/popup/popups/ImportErc20TokenFormPopup.svelte +++ b/packages/desktop/components/popup/popups/ImportErc20TokenFormPopup.svelte @@ -3,7 +3,7 @@ import { NetworkInput } from '@ui' import { localize } from '@core/i18n' import { getEvmTokenMetadata } from '@core/layer-2/utils' - import { NetworkId } from '@core/network' + import { EvmNetworkId } from '@core/network' import { validateEthereumAddress } from '@core/utils' import PopupTemplate from '../PopupTemplate.svelte' import { closePopup } from '@desktop/auxiliary/popup' @@ -13,7 +13,7 @@ let busy = false - let networkId: NetworkId + let networkId: EvmNetworkId let tokenAddress: string let tokenAddressError = '' diff --git a/packages/desktop/components/popup/popups/ImportErc721TokenFormPopup.svelte b/packages/desktop/components/popup/popups/ImportErc721TokenFormPopup.svelte index 92b837c6d3..779421b851 100644 --- a/packages/desktop/components/popup/popups/ImportErc721TokenFormPopup.svelte +++ b/packages/desktop/components/popup/popups/ImportErc721TokenFormPopup.svelte @@ -2,7 +2,7 @@ import { TextInput } from '@bloomwalletio/ui' import { NetworkInput } from '@ui' import { localize } from '@core/i18n' - import { NetworkId } from '@core/network' + import { EvmNetworkId } from '@core/network' import { validateEthereumAddress } from '@core/utils' import PopupTemplate from '../PopupTemplate.svelte' import { closePopup } from '@desktop/auxiliary/popup' @@ -21,7 +21,7 @@ let busy = false - let networkId: NetworkId + let networkId: EvmNetworkId let tokenAddress: string diff --git a/packages/desktop/components/popup/popups/SiwePopup.svelte b/packages/desktop/components/popup/popups/SiwePopup.svelte index 6fb738c0cd..d05de7b753 100644 --- a/packages/desktop/components/popup/popups/SiwePopup.svelte +++ b/packages/desktop/components/popup/popups/SiwePopup.svelte @@ -7,7 +7,7 @@ import { signMessage } from '@core/wallet/actions' import { Table, Tabs, Text } from '@bloomwalletio/ui' import { IAccountState } from '@core/account' - import { IEvmNetwork, NetworkId, getNameFromNetworkId } from '@core/network' + import { IEvmNetwork, EvmNetworkId, getNameFromNetworkId } from '@core/network' import { AccountLabel, DappInfo, KeyValue, NetworkLabel } from '@ui' import { checkActiveProfileAuth } from '@core/profile/actions' import { LedgerAppName } from '@core/ledger' @@ -39,7 +39,7 @@ let selectedTab = TABS[0] let isBusy = false - const networkId = `eip155:${siweObject.chainId}` as NetworkId + const networkId: EvmNetworkId = `eip155:${siweObject.chainId}` async function onConfirmClick(): Promise { try { diff --git a/packages/desktop/components/popup/popups/SyncAccountsPopup.svelte b/packages/desktop/components/popup/popups/SyncAccountsPopup.svelte index 44d12d3fae..d4f579c75e 100644 --- a/packages/desktop/components/popup/popups/SyncAccountsPopup.svelte +++ b/packages/desktop/components/popup/popups/SyncAccountsPopup.svelte @@ -15,8 +15,9 @@ import { closePopup } from '@desktop/auxiliary/popup' import { onDestroy } from 'svelte' import PopupTemplate from '../PopupTemplate.svelte' - import { StardustNetworkId } from '@core/network/enums' + import { SupportedStardustNetworkId } from '@core/network/constants' import { ledgerRaceConditionProtectionWrapper } from '@core/ledger' + import { StardustNetworkId } from '@core/network/types' const { network, type } = $activeProfile @@ -38,9 +39,9 @@ $: totalBalance = sumBalanceForAccounts($visibleActiveAccounts) const networkSearchMethod: { [key in StardustNetworkId]?: () => Promise } = { - [StardustNetworkId.Iota]: multiAddressSearch, - [StardustNetworkId.Shimmer]: singleAddressSearch, - [StardustNetworkId.Testnet]: singleAddressSearch, + [SupportedStardustNetworkId.Iota]: multiAddressSearch, + [SupportedStardustNetworkId.Shimmer]: singleAddressSearch, + [SupportedStardustNetworkId.Testnet]: singleAddressSearch, } async function singleAddressSearch(): Promise { diff --git a/packages/desktop/views/dashboard/campaigns/views/CampaignDetailsView.svelte b/packages/desktop/views/dashboard/campaigns/views/CampaignDetailsView.svelte index 89560ff941..aa560d3f4c 100644 --- a/packages/desktop/views/dashboard/campaigns/views/CampaignDetailsView.svelte +++ b/packages/desktop/views/dashboard/campaigns/views/CampaignDetailsView.svelte @@ -9,7 +9,7 @@ import { IAccountState, getAddressFromAccountForNetwork } from '@core/account' import { selectedAccount } from '@core/account/stores' import { handleError } from '@core/error/handlers' - import { NetworkId, NetworkNamespace, getEvmNetwork } from '@core/network' + import { EvmNetworkId, NetworkNamespace, getEvmNetwork } from '@core/network' import { buildNftFromPersistedErc721Nft } from '@core/nfts' import { addNftsToDownloadQueue, updateAllAccountNftsForAccount } from '@core/nfts/actions' import { persistErc721Nft } from '@core/nfts/actions/persistErc721Nft' @@ -26,14 +26,14 @@ let userAddress: string let numberOfTasks: number | undefined - $: evmNetwork = getEvmNetwork(`${NetworkNamespace.Evm}:${$selectedCampaign.chainId}` as NetworkId) + $: evmNetwork = getEvmNetwork(`${NetworkNamespace.Evm}:${$selectedCampaign.chainId}` as EvmNetworkId) $: ({ board: leaderboard, userPosition } = $campaignLeaderboards[$selectedCampaign.projectId]?.[ $selectedCampaign.id ] ?? { board: undefined, userPosition: undefined }) $: fetchAndPersistTideData($selectedAccount, evmNetwork?.id) $: userNft = $ownedNfts.find((nft) => nft.id?.startsWith($selectedCampaign.address.toLowerCase())) - function fetchAndPersistTideData(account: IAccountState, networkId: NetworkId): void { + function fetchAndPersistTideData(account: IAccountState, networkId: EvmNetworkId): void { if (networkId) { userAddress = getAddressFromAccountForNetwork(account, networkId)?.toLowerCase() void fetchAndPersistUserPosition(userAddress) diff --git a/packages/desktop/views/dashboard/collectibles/components/Erc721CollectibleDetails.svelte b/packages/desktop/views/dashboard/collectibles/components/Erc721CollectibleDetails.svelte index 5ba7e2cd9b..9f7ed0b7f2 100644 --- a/packages/desktop/views/dashboard/collectibles/components/Erc721CollectibleDetails.svelte +++ b/packages/desktop/views/dashboard/collectibles/components/Erc721CollectibleDetails.svelte @@ -3,7 +3,7 @@ import { type IItem } from '@bloomwalletio/ui' import { localize } from '@core/i18n' import { IErc721Nft } from '@core/nfts' - import { ExplorerEndpoint, NetworkId, getDefaultExplorerUrl } from '@core/network' + import { ExplorerEndpoint, EvmNetworkId, getDefaultExplorerUrl } from '@core/network' import CollectibleDetails from './CollectibleDetails.svelte' import { buildUrl } from '@core/utils' @@ -13,7 +13,7 @@ const address = contractMetadata.address const explorerEndpoint = getExplorerEndpoint(networkId) - function getExplorerEndpoint(networkId: NetworkId): string | undefined { + function getExplorerEndpoint(networkId: EvmNetworkId): string | undefined { const { baseUrl, endpoint } = getDefaultExplorerUrl(networkId, ExplorerEndpoint.Token) const url = buildUrl({ origin: baseUrl, diff --git a/packages/desktop/views/dashboard/components/DashboardSidebar.svelte b/packages/desktop/views/dashboard/components/DashboardSidebar.svelte index 64aef537f1..cd82284b27 100644 --- a/packages/desktop/views/dashboard/components/DashboardSidebar.svelte +++ b/packages/desktop/views/dashboard/components/DashboardSidebar.svelte @@ -4,7 +4,7 @@ import { ProfileActionsMenu, SidebarTab } from '@components' import { APP_STAGE, AppStage } from '@core/app' import { localize } from '@core/i18n' - import { StardustNetworkId } from '@core/network' + import { SupportedStardustNetworkId } from '@core/network' import { activeProfile, isSoftwareProfile } from '@core/profile/stores' import { DashboardRoute, @@ -60,8 +60,8 @@ : []), ...(features?.campaigns?.enabled && profileFeatures?.campaigns && - ($activeProfile?.network?.id === StardustNetworkId.Shimmer || - $activeProfile?.network?.id === StardustNetworkId.Testnet) + ($activeProfile?.network?.id === SupportedStardustNetworkId.Shimmer || + $activeProfile?.network?.id === SupportedStardustNetworkId.Testnet) ? [ { icon: IconName.Trophy, @@ -78,9 +78,9 @@ label: localize('tabs.buySell'), route: DashboardRoute.BuySell, onClick: openBuySell, - disabled: $activeProfile?.network?.id !== StardustNetworkId.Iota, + disabled: $activeProfile?.network?.id !== SupportedStardustNetworkId.Iota, tooltip: - $activeProfile?.network?.id !== StardustNetworkId.Iota + $activeProfile?.network?.id !== SupportedStardustNetworkId.Iota ? localize('tabs.tooltips.buySell') : '', }, diff --git a/packages/desktop/views/dashboard/drawers/network-config/views/components/AddIscpChainForm.svelte b/packages/desktop/views/dashboard/drawers/network-config/views/components/AddIscpChainForm.svelte index ec728f7ce5..a31c8c81d1 100644 --- a/packages/desktop/views/dashboard/drawers/network-config/views/components/AddIscpChainForm.svelte +++ b/packages/desktop/views/dashboard/drawers/network-config/views/components/AddIscpChainForm.svelte @@ -4,11 +4,11 @@ import { MAX_NETWORK_NAME_LENGTH, EvmNetworkType, - IIscpChainConfiguration, + IIscpEvmNetworkConfiguration, ETHEREUM_COIN_TYPE, - NetworkId, EvmNetworkId, NetworkNamespace, + ChainId, } from '@core/network' import { activeProfile } from '@core/profile/stores' import { getNetworkHrp } from '@core/profile/actions' @@ -25,11 +25,11 @@ let explorerUrlError = '' $: submitDisabled = !evmNetwork.name || !evmNetwork.aliasAddress || !evmNetwork.rpcEndpoint - const evmNetwork: IIscpChainConfiguration = { + const evmNetwork: IIscpEvmNetworkConfiguration = { type: EvmNetworkType.Iscp, - id: '' as NetworkId, + id: '' as EvmNetworkId, namespace: NetworkNamespace.Evm, - chainId: '' as EvmNetworkId, + chainId: '' as ChainId, name: '', aliasAddress: '', rpcEndpoint: '', diff --git a/packages/desktop/views/dashboard/send-flow/views/SelectTokenView.svelte b/packages/desktop/views/dashboard/send-flow/views/SelectTokenView.svelte index 4d1498cee2..a6828e77cd 100644 --- a/packages/desktop/views/dashboard/send-flow/views/SelectTokenView.svelte +++ b/packages/desktop/views/dashboard/send-flow/views/SelectTokenView.svelte @@ -41,7 +41,7 @@ } else if ( selectedToken && isStardustNetwork(selectedToken.networkId) && - !canAccountMakeStardustTransaction($selectedAccountIndex, selectedToken.networkId, $sendFlowParameters?.type) + !canAccountMakeStardustTransaction($selectedAccountIndex, $sendFlowParameters?.type) ) { tokenError = localize('error.send.insufficientFundsTransaction') } else { diff --git a/packages/desktop/views/dashboard/send-flow/views/components/StardustTransactionDetails.svelte b/packages/desktop/views/dashboard/send-flow/views/components/StardustTransactionDetails.svelte index 0cdd1b696e..bfeae38592 100644 --- a/packages/desktop/views/dashboard/send-flow/views/components/StardustTransactionDetails.svelte +++ b/packages/desktop/views/dashboard/send-flow/views/components/StardustTransactionDetails.svelte @@ -9,7 +9,7 @@ import { DateTimePickerMenu } from '.' import StorageDepositButton from './StorageDepositButton.svelte' - export let destinationNetworkId: NetworkId = undefined + export let destinationNetworkId: NetworkId | undefined = undefined export let storageDeposit: bigint | undefined = undefined export let transactionFee: bigint | undefined = undefined export let giftStorageDeposit: boolean | undefined = undefined diff --git a/packages/desktop/views/dashboard/wallet/tab-section/portfolio/components/TokenListRow.svelte b/packages/desktop/views/dashboard/wallet/tab-section/portfolio/components/TokenListRow.svelte index 891ebe2f55..9198419fdb 100644 --- a/packages/desktop/views/dashboard/wallet/tab-section/portfolio/components/TokenListRow.svelte +++ b/packages/desktop/views/dashboard/wallet/tab-section/portfolio/components/TokenListRow.svelte @@ -1,7 +1,7 @@ diff --git a/packages/desktop/views/onboarding/views/network-setup/views/ChooseNetworkView.svelte b/packages/desktop/views/onboarding/views/network-setup/views/ChooseNetworkView.svelte index 475f764a3f..acaa72b9ec 100644 --- a/packages/desktop/views/onboarding/views/network-setup/views/ChooseNetworkView.svelte +++ b/packages/desktop/views/onboarding/views/network-setup/views/ChooseNetworkView.svelte @@ -8,8 +8,8 @@ } from '@contexts/onboarding' import { localize } from '@core/i18n' import { - NetworkId, NetworkNamespace, + StardustNetworkId, StardustNetworkName, getDefaultClientOptions, getDefaultPersistedNetwork, @@ -39,7 +39,7 @@ function onContinueClick(): void { if (selectedNetworkType !== OnboardingNetworkType.Custom) { const networkName = getNetworkNameFromOnboardingNetworkType(selectedNetworkType) - const networkId: NetworkId = `${NetworkNamespace.Stardust}:${networkName}` + const networkId: StardustNetworkId = `${NetworkNamespace.Stardust}:${networkName}` const network = getDefaultPersistedNetwork(networkId) const clientOptions = getDefaultClientOptions(networkId) updateOnboardingProfile({ network, clientOptions }) diff --git a/packages/desktop/views/onboarding/views/restore-profile/views/BalanceFinderView.svelte b/packages/desktop/views/onboarding/views/restore-profile/views/BalanceFinderView.svelte index cb95a5b913..a8bb9cef0b 100644 --- a/packages/desktop/views/onboarding/views/restore-profile/views/BalanceFinderView.svelte +++ b/packages/desktop/views/onboarding/views/restore-profile/views/BalanceFinderView.svelte @@ -5,7 +5,8 @@ import { DEFAULT_SYNC_OPTIONS } from '@core/account/constants' import { localize } from '@core/i18n' import { LedgerAppName, checkOrConnectLedger, ledgerRaceConditionProtectionWrapper } from '@core/ledger' - import { StardustNetworkId } from '@core/network' + import { SupportedStardustNetworkId } from '@core/network/constants' + import { NetworkId } from '@core/network/types' import { ProfileType } from '@core/profile' import { RecoverAccountsPayload, createAccount, recoverAccounts } from '@core/profile-manager' import { DEFAULT_ACCOUNT_RECOVERY_CONFIGURATION } from '@core/profile/constants' @@ -34,10 +35,10 @@ let accountsBalances: IAccountBalance[] = [] - const networkSearchMethod: { [key in StardustNetworkId]?: () => Promise } = { - [StardustNetworkId.Iota]: multiAddressSearch, - [StardustNetworkId.Shimmer]: singleAddressSearch, - [StardustNetworkId.Testnet]: singleAddressSearch, + const networkSearchMethod: { [key in NetworkId]?: () => Promise } = { + [SupportedStardustNetworkId.Iota]: multiAddressSearch, + [SupportedStardustNetworkId.Shimmer]: singleAddressSearch, + [SupportedStardustNetworkId.Testnet]: singleAddressSearch, } async function singleAddressSearch(): Promise { @@ -133,7 +134,7 @@ async function onFindBalancesClick(): Promise { if (type === ProfileType.Ledger) { await checkOrConnectLedger( - network?.id === StardustNetworkId.Iota ? LedgerAppName.Iota : LedgerAppName.Shimmer + network?.id === SupportedStardustNetworkId.Iota ? LedgerAppName.Iota : LedgerAppName.Shimmer ) } await findBalances() diff --git a/packages/shared/src/components/activities/evm/info/EvmGenericInformation.svelte b/packages/shared/src/components/activities/evm/info/EvmGenericInformation.svelte index c519d81249..ba2234fb44 100644 --- a/packages/shared/src/components/activities/evm/info/EvmGenericInformation.svelte +++ b/packages/shared/src/components/activities/evm/info/EvmGenericInformation.svelte @@ -1,13 +1,13 @@