From 24bc9b3581548215ced1821871b653d0781bf59b Mon Sep 17 00:00:00 2001 From: Yusef Habib Date: Sat, 11 Jan 2025 08:47:34 +0100 Subject: [PATCH] chore(ci): fixes relative imports for src/lib files (#6146) # Motivation This is the first of a series of PRs aimed at replacing relative imports in our codebase with absolute imports using aliases. This change will help prevent future issues related to how different tools sort Svelte imports. The PRs include: * Fixing `src/test` files #6143 * Fixing `src/routes` files - Not possible as SvelteKit doesn't like using the `$` within its domain * Fixing `src/lib` files #6146 * Introducing a new step in our CI to check for relative imports and fail if any are present. # Changes - Replaced relative imports with absolute imports and aliases for the `src/lib` directory. - Run `./scripts/fmt-frontend` to sort imports based on rules - Run `./scripts/sort-svelte-imports` # Tests - Should work as before # Todos - [ ] Add entry to changelog (if necessary). Not necessary --- frontend/src/lib/api/accounts.api.ts | 2 +- frontend/src/lib/api/canisters.api.ts | 4 ++-- frontend/src/lib/api/dev.api.ts | 6 +++--- frontend/src/lib/api/governace-test.api.ts | 2 +- frontend/src/lib/api/governance.api.ts | 2 +- frontend/src/lib/api/icp-index.api.ts | 2 +- frontend/src/lib/api/icrc-index.api.ts | 2 +- frontend/src/lib/api/proposals.api.ts | 2 +- frontend/src/lib/api/sns-governance.api.ts | 2 +- frontend/src/lib/api/sns-sale.api.ts | 2 +- frontend/src/lib/api/sns.api.ts | 2 +- .../lib/canisters/ic-management/converters.ts | 4 ++-- .../ic-management/ic-management.canister.ts | 4 ++-- .../canisters/nns-dapp/nns-dapp.canister.ts | 8 ++++---- .../nns-dapp/nns-dapp.canister.types.ts | 2 +- .../lib/canisters/nns-dapp/nns-dapp.idl.d.ts | 2 +- frontend/src/lib/canisters/tvl/tvl.canister.ts | 6 +++--- .../components/accounts/AddSubAccount.svelte | 2 +- .../accounts/HardwareWalletConnect.svelte | 2 +- .../HardwareWalletConnectAction.svelte | 2 +- .../accounts/HardwareWalletNeurons.svelte | 2 +- .../components/accounts/IcrcWalletPage.svelte | 4 ++-- .../accounts/LedgerNeuronHotkeyWarning.svelte | 6 +++--- .../accounts/RenameSubAccountAction.svelte | 2 +- .../accounts/SelectAccountDropdown.svelte | 2 +- .../accounts/SelectDestinationAddress.svelte | 4 ++-- .../components/accounts/TransactionCard.svelte | 2 +- .../accounts/UiTransactionsList.svelte | 6 +++--- .../accounts/WalletMorePopover.svelte | 2 +- .../accounts/WalletPageHeader.svelte | 6 +++--- .../accounts/WalletPageHeading.svelte | 10 +++++----- .../CanisterHeadingTitle.svelte | 2 +- .../canister-detail/CanisterPageHeader.svelte | 6 +++--- .../canister-detail/CanisterPageHeading.svelte | 10 +++++----- .../canister-detail/ControllersCard.svelte | 4 ++-- .../components/canisters/CanisterCard.svelte | 4 ++-- .../common/HeadingSubtitleWithUsdValue.svelte | 2 +- .../src/lib/components/common/MenuItems.svelte | 2 +- .../lib/components/common/TextInputForm.svelte | 2 +- .../components/header/AccountDetails.svelte | 6 +++--- .../lib/components/header/AccountMenu.svelte | 12 ++++++------ .../src/lib/components/ic/GetTokens.svelte | 2 +- .../components/launchpad/ProjectCard.svelte | 2 +- .../launchpad/ProjectCardSwapInfo.svelte | 4 ++-- .../lib/components/launchpad/Projects.svelte | 2 +- .../lib/components/launchpad/Proposals.svelte | 2 +- .../neuron-detail/Ballots/Ballots.svelte | 2 +- .../NeuronFollowingCard.svelte | 4 ++-- .../NeuronVotingHistoryCard.svelte | 2 +- .../NnsAvailableMaturityItemAction.svelte | 8 ++++---- .../NnsNeuronAdvancedSection.svelte | 12 ++++++------ .../NnsNeuronDissolveDelayItemAction.svelte | 6 +++--- .../neuron-detail/NnsNeuronHotkeysCard.svelte | 2 +- .../NnsNeuronMaturitySection.svelte | 4 ++-- .../neuron-detail/NnsNeuronPageHeader.svelte | 10 +++++----- .../neuron-detail/NnsNeuronPageHeading.svelte | 8 ++++---- .../NnsNeuronProposalsCard.svelte | 2 +- .../NnsNeuronPublicVisibilityAction.svelte | 4 ++-- .../NnsNeuronRewardStatusAction.svelte | 12 ++++++------ .../NnsNeuronStateItemAction.svelte | 8 ++++---- .../NnsNeuronTestnetFunctionsCard.svelte | 2 +- .../NnsNeuronVotingPowerSection.svelte | 10 +++++----- .../NnsStakedMaturityItemAction.svelte | 4 ++-- .../SnsNeuronProposalsCard.svelte | 2 +- .../SnsNeuronTestnetFunctionsCard.svelte | 2 +- .../neuron-detail/SnsPermissionsCard.svelte | 6 +++--- .../neuron-detail/StakeItemAction.svelte | 2 +- .../actions/NnsAutoStakeMaturity.svelte | 2 +- .../neurons/ConfirmNeuronsMerge.svelte | 2 +- .../neurons/EditFollowNeurons.svelte | 2 +- .../neurons/FollowNnsTopicSection.svelte | 2 +- .../neurons/NnsLosingRewardsNeuronCard.svelte | 12 ++++++------ .../lib/components/neurons/NnsNeuronAge.svelte | 2 +- .../components/neurons/NnsNeuronCard.svelte | 10 +++++----- .../neurons/NnsNeuronRemainingTime.svelte | 2 +- .../neurons/RangeDissolveDelay.svelte | 2 +- .../neurons/SelectNeuronsToMerge.svelte | 4 ++-- .../components/neurons/SetDissolveDelay.svelte | 2 +- .../CommitmentProgressBar.svelte | 2 +- .../NfCommitmentProgressBar.svelte | 2 +- .../project-detail/ProjectCommitment.svelte | 8 ++++---- .../project-detail/ProjectInfoSection.svelte | 2 +- .../project-detail/ProjectProposal.svelte | 2 +- .../project-detail/ProjectStatusSection.svelte | 8 ++++---- .../project-detail/ProjectSwapDetails.svelte | 6 +++--- .../ProjectTimelineUserCommitment.svelte | 8 ++++---- .../proposal-detail/NnsProposal.svelte | 12 ++++++------ .../NnsProposalProposerActionsEntry.svelte | 2 +- .../NnsProposalProposerPayloadEntry.svelte | 2 +- .../NnsProposalSummarySection.svelte | 2 +- .../ProposalSummarySection.svelte | 2 +- .../ProposalSystemInfoSection.svelte | 4 ++-- .../ProposalVotingSection.svelte | 2 +- .../proposal-detail/VotesResults.svelte | 2 +- .../VotingCard/VotingCard.svelte | 2 +- .../proposals/ActionableNnsProposals.svelte | 2 +- .../LoadingActionableProposals.svelte | 2 +- .../proposals/LoadingProposals.svelte | 2 +- .../proposals/NnsProposalCard.svelte | 2 +- .../proposals/NnsProposalsFilters.svelte | 2 +- .../proposals/NnsProposalsList.svelte | 10 +++++----- .../components/proposals/ProposalCard.svelte | 2 +- .../reporting/ReportingNeurons.svelte | 2 +- .../reporting/ReportingTransactions.svelte | 4 ++-- .../FollowSnsTopicSection.svelte | 2 +- .../SnsAvailableMaturityItemAction.svelte | 6 +++--- .../sns-neuron-detail/SnsFollowee.svelte | 6 +++--- .../SnsNeuronAdvancedSection.svelte | 10 +++++----- .../SnsNeuronDissolveDelayItemAction.svelte | 6 +++--- .../SnsNeuronFollowingCard.svelte | 6 +++--- .../SnsNeuronHotkeysCard.svelte | 4 ++-- .../SnsNeuronMaturitySection.svelte | 4 ++-- .../SnsNeuronPageHeader.svelte | 10 +++++----- .../SnsNeuronPageHeading.svelte | 8 ++++---- .../SnsNeuronStateItemAction.svelte | 6 +++--- .../SnsNeuronVestingPeriodRemaining.svelte | 2 +- .../SnsNeuronVotingPowerSection.svelte | 6 +++--- .../SnsStakedMaturityItemAction.svelte | 2 +- .../VestingTooltipWrapper.svelte | 2 +- .../actions/DisburseSnsButton.svelte | 2 +- .../actions/DissolveSnsNeuronButton.svelte | 2 +- .../IncreaseSnsDissolveDelayButton.svelte | 2 +- .../actions/SplitSnsNeuronButton.svelte | 2 +- .../components/sns-neurons/SnsNeuronAge.svelte | 2 +- .../SnsProposalPayloadSection.svelte | 2 +- .../SnsProposalSummarySection.svelte | 2 +- .../SnsProposalSystemInfoSection.svelte | 4 ++-- .../sns-proposals/SnsProposalsFilters.svelte | 4 ++-- .../sns-proposals/SnsProposalsList.svelte | 8 ++++---- .../sns-proposals/SnsProposerEntry.svelte | 2 +- .../tokens/TokensTable/TokenActionsCell.svelte | 10 +++++----- .../tokens/TokensTable/TokensTable.svelte | 6 +++--- .../src/lib/components/ui/AmountInput.svelte | 2 +- frontend/src/lib/components/ui/CardInfo.svelte | 2 +- .../lib/components/ui/CommonItemAction.svelte | 2 +- frontend/src/lib/components/ui/DayInput.svelte | 2 +- .../lib/components/ui/InputWithError.svelte | 2 +- .../lib/components/ui/PrincipalInput.svelte | 2 +- .../src/lib/components/ui/SkeletonCard.svelte | 4 ++-- .../lib/components/ui/SkeletonDetails.svelte | 2 +- .../lib/components/ui/SkeletonHeader.svelte | 2 +- .../lib/components/ui/SkeletonHeading.svelte | 2 +- .../components/ui/SkeletonProjectCard.svelte | 2 +- .../components/universe/UniverseSummary.svelte | 2 +- .../src/lib/derived/accounts-title.derived.ts | 2 +- .../src/lib/derived/ckbtc-universes.derived.ts | 4 ++-- .../derived/icp-tokens-list-user.derived.ts | 2 +- .../icp-tokens-list-visitors.derived.ts | 2 +- frontend/src/lib/derived/neurons.derived.ts | 2 +- .../derived/selectable-universes.derived.ts | 2 +- .../lib/derived/selected-universe.derived.ts | 2 +- .../src/lib/derived/sns-functions.derived.ts | 2 +- .../derived/sns-total-token-supply.derived.ts | 2 +- ...sns-selected-project-new-tx-data.derived.ts | 6 +++--- .../sns/sns-selected-transaction-fee.store.ts | 2 +- .../derived/sns/sns-sorted-neurons.derived.ts | 2 +- .../derived/title-token-selector.derived.ts | 2 +- .../lib/derived/tokens-list-base.derived.ts | 2 +- .../lib/derived/tokens-list-user.derived.ts | 8 ++++---- .../derived/tokens-list-visitors.derived.ts | 4 ++-- frontend/src/lib/derived/universes.derived.ts | 4 ++-- .../src/lib/directives/debug.directives.ts | 4 ++-- .../lib/modals/accounts/AccountsModals.svelte | 6 +++--- .../accounts/AddIndexCanisterModal.svelte | 2 +- .../accounts/IcrcTokenAccountsModals.svelte | 2 +- .../modals/accounts/ImportTokenModal.svelte | 2 +- .../canisters/CanisterDetailModals.svelte | 2 +- .../neurons/ChangeNeuronVisibilityModal.svelte | 2 +- .../lib/modals/neurons/NnsNeuronModals.svelte | 8 ++++---- .../proposals/NnsProposalsFilterModal.svelte | 2 +- .../modals/sns/neurons/SnsNeuronModals.svelte | 2 +- .../modals/transaction/TransactionModal.svelte | 7 ++++--- .../src/lib/pages/SnsProposalDetail.svelte | 2 +- frontend/src/lib/services/app.services.ts | 4 ++-- frontend/src/lib/services/busy.services.ts | 2 +- .../src/lib/services/canisters.services.ts | 9 ++++++--- .../src/lib/services/ckbtc-convert.services.ts | 14 +++++++------- .../src/lib/services/ckbtc-minter.services.ts | 2 +- .../src/lib/services/ckbtc-tokens.services.ts | 2 +- frontend/src/lib/services/dev.services.ts | 4 ++-- .../src/lib/services/icp-accounts.services.ts | 4 ++-- .../src/lib/services/icp-ledger.services.ts | 4 ++-- .../lib/services/icp-transactions.services.ts | 2 +- .../src/lib/services/icrc-accounts.services.ts | 5 ++++- .../src/lib/services/icrc-tokens.services.ts | 2 +- .../lib/services/imported-tokens.services.ts | 2 +- .../src/lib/services/known-neurons.services.ts | 2 +- frontend/src/lib/services/neurons.services.ts | 9 ++++++--- .../lib/services/nns-neurons-dev.services.ts | 4 ++-- .../lib/services/nns-reward-event.services.ts | 2 +- .../services/nns-vote-registration.services.ts | 6 +++--- .../src/lib/services/public/app.services.ts | 4 ++-- .../lib/services/public/proposals.services.ts | 2 +- .../services/public/sns-proposals.services.ts | 2 +- .../services/sns-accounts-balance.services.ts | 2 +- .../src/lib/services/sns-accounts.services.ts | 4 ++-- .../lib/services/sns-finalization.services.ts | 2 +- .../src/lib/services/sns-neurons.services.ts | 6 +++--- frontend/src/lib/services/sns-sale.services.ts | 12 ++++++------ frontend/src/lib/services/sns.services.ts | 7 +++++-- .../wallet-uncertified-accounts.services.ts | 5 ++++- .../src/lib/services/worker-auth.services.ts | 2 +- frontend/src/lib/stores/feature-flags.store.ts | 2 +- .../src/lib/stores/hide-zero-balances.store.ts | 2 +- .../lib/stores/icp-account-balances.store.ts | 2 +- .../lib/stores/json-representation.store.ts | 2 +- frontend/src/lib/stores/proposals.store.ts | 4 ++-- frontend/src/lib/stores/sns-filters.store.ts | 2 +- ...rons-table-order-sorted-neuron-ids-store.ts | 2 +- frontend/src/lib/types/actions.ts | 2 +- frontend/src/lib/types/icrc-accounts.modal.ts | 4 ++-- .../src/lib/types/neuron-visibility-row.ts | 2 +- .../src/lib/types/project-detail.context.ts | 2 +- frontend/src/lib/types/sns.ts | 2 +- frontend/src/lib/types/transaction.ts | 2 +- frontend/src/lib/types/wallet.context.ts | 2 +- frontend/src/lib/utils/accounts.utils.ts | 2 +- frontend/src/lib/utils/canisters.utils.ts | 4 ++-- frontend/src/lib/utils/error.utils.ts | 2 +- .../lib/utils/hardware-wallet-neurons.utils.ts | 2 +- .../src/lib/utils/icp-transactions.utils.ts | 2 +- frontend/src/lib/utils/ledger.utils.ts | 2 +- frontend/src/lib/utils/navigation.utils.ts | 2 +- frontend/src/lib/utils/neuron.utils.ts | 18 ++++++++++++------ frontend/src/lib/utils/projects.utils.ts | 10 +++++----- frontend/src/lib/utils/proposals.utils.ts | 10 +++++----- .../utils/sns-aggregator-converters.utils.ts | 4 ++-- frontend/src/lib/utils/sns-ledger.utils.ts | 4 ++-- frontend/src/lib/utils/sns-neuron.utils.ts | 6 +++--- frontend/src/lib/utils/sns-proposals.utils.ts | 5 ++--- frontend/src/lib/utils/utils.ts | 2 +- 231 files changed, 459 insertions(+), 438 deletions(-) diff --git a/frontend/src/lib/api/accounts.api.ts b/frontend/src/lib/api/accounts.api.ts index ee80b7c0749..5fcedda8926 100644 --- a/frontend/src/lib/api/accounts.api.ts +++ b/frontend/src/lib/api/accounts.api.ts @@ -1,7 +1,7 @@ +import { nnsDappCanister } from "$lib/api/nns-dapp.api"; import type { AccountIdentifierString } from "$lib/canisters/nns-dapp/nns-dapp.types"; import { hashCode, logWithTimestamp } from "$lib/utils/dev.utils"; import type { Identity } from "@dfinity/agent"; -import { nnsDappCanister } from "./nns-dapp.api"; export const createSubAccount = async ({ name, diff --git a/frontend/src/lib/api/canisters.api.ts b/frontend/src/lib/api/canisters.api.ts index 8dc861d8681..d58898c0134 100644 --- a/frontend/src/lib/api/canisters.api.ts +++ b/frontend/src/lib/api/canisters.api.ts @@ -1,4 +1,6 @@ import { createAgent } from "$lib/api/agent.api"; +import { sendICP } from "$lib/api/icp-ledger.api"; +import { nnsDappCanister } from "$lib/api/nns-dapp.api"; import { ICManagementCanister } from "$lib/canisters/ic-management/ic-management.canister"; import type { CanisterDetails, @@ -30,8 +32,6 @@ import { CMCCanister, ProcessingError, type Cycles } from "@dfinity/cmc"; import { AccountIdentifier, SubAccount } from "@dfinity/ledger-icp"; import type { Principal } from "@dfinity/principal"; import { nonNullish, principalToSubAccount } from "@dfinity/utils"; -import { sendICP } from "./icp-ledger.api"; -import { nnsDappCanister } from "./nns-dapp.api"; // This way, TS understands that if it's invalid, then the name is a string type LongName = string; diff --git a/frontend/src/lib/api/dev.api.ts b/frontend/src/lib/api/dev.api.ts index eb1859cf471..274b9b24d96 100644 --- a/frontend/src/lib/api/dev.api.ts +++ b/frontend/src/lib/api/dev.api.ts @@ -1,3 +1,6 @@ +import { createAgent } from "$lib/api/agent.api"; +import { governanceCanister } from "$lib/api/governance.api"; +import { wrapper } from "$lib/api/sns-wrapper.api"; import { LEDGER_CANISTER_ID } from "$lib/constants/canister-ids.constants"; import { HOST, IS_TESTNET } from "$lib/constants/environment.constants"; import type { Account } from "$lib/types/account"; @@ -22,9 +25,6 @@ import { createAgent as createAgentUtils, toNullable, } from "@dfinity/utils"; -import { createAgent } from "./agent.api"; -import { governanceCanister } from "./governance.api"; -import { wrapper } from "./sns-wrapper.api"; export const testAccountPrincipal = "jg6qm-uw64t-m6ppo-oluwn-ogr5j-dc5pm-lgy2p-eh6px-hebcd-5v73i-nqe"; diff --git a/frontend/src/lib/api/governace-test.api.ts b/frontend/src/lib/api/governace-test.api.ts index e853c9ddadb..311257f3f50 100644 --- a/frontend/src/lib/api/governace-test.api.ts +++ b/frontend/src/lib/api/governace-test.api.ts @@ -1,8 +1,8 @@ +import { createAgent } from "$lib/api/agent.api"; import { GOVERNANCE_CANISTER_ID } from "$lib/constants/canister-ids.constants"; import { HOST } from "$lib/constants/environment.constants"; import type { Identity } from "@dfinity/agent"; import { GovernanceTestCanister, type Neuron } from "@dfinity/nns"; -import { createAgent } from "./agent.api"; const governanceTestCanister = async (identity: Identity) => { const agent = await createAgent({ diff --git a/frontend/src/lib/api/governance.api.ts b/frontend/src/lib/api/governance.api.ts index d97e0553826..bab89b62684 100644 --- a/frontend/src/lib/api/governance.api.ts +++ b/frontend/src/lib/api/governance.api.ts @@ -1,4 +1,5 @@ import { createAgent } from "$lib/api/agent.api"; +import { ledgerCanister as getLedgerCanister } from "$lib/api/icp-ledger.api"; import type { SubAccountArray } from "$lib/canisters/nns-dapp/nns-dapp.types"; import { GOVERNANCE_CANISTER_ID } from "$lib/constants/canister-ids.constants"; import { HOST } from "$lib/constants/environment.constants"; @@ -20,7 +21,6 @@ import { type RewardEvent, } from "@dfinity/nns"; import type { Principal } from "@dfinity/principal"; -import { ledgerCanister as getLedgerCanister } from "./icp-ledger.api"; /** * COMMON TYPES diff --git a/frontend/src/lib/api/icp-index.api.ts b/frontend/src/lib/api/icp-index.api.ts index 9ac36e2110b..d4d177f06ee 100644 --- a/frontend/src/lib/api/icp-index.api.ts +++ b/frontend/src/lib/api/icp-index.api.ts @@ -1,3 +1,4 @@ +import { createAgent } from "$lib/api/agent.api"; import { INDEX_CANISTER_ID } from "$lib/constants/canister-ids.constants"; import { HOST } from "$lib/constants/environment.constants"; import { logWithTimestamp } from "$lib/utils/dev.utils"; @@ -7,7 +8,6 @@ import { type GetAccountIdentifierTransactionsResponse, } from "@dfinity/ledger-icp"; import { fromNullable } from "@dfinity/utils"; -import { createAgent } from "./agent.api"; export interface GetTransactionsParams { identity: Identity; diff --git a/frontend/src/lib/api/icrc-index.api.ts b/frontend/src/lib/api/icrc-index.api.ts index 1df05afa861..37733ccb5bf 100644 --- a/frontend/src/lib/api/icrc-index.api.ts +++ b/frontend/src/lib/api/icrc-index.api.ts @@ -1,3 +1,4 @@ +import { createAgent } from "$lib/api/agent.api"; import { HOST } from "$lib/constants/environment.constants"; import type { Agent, Identity } from "@dfinity/agent"; import { @@ -7,7 +8,6 @@ import { } from "@dfinity/ledger-icrc"; import type { Principal } from "@dfinity/principal"; import { fromNullable } from "@dfinity/utils"; -import { createAgent } from "./agent.api"; export interface GetTransactionsParams { identity: Identity; diff --git a/frontend/src/lib/api/proposals.api.ts b/frontend/src/lib/api/proposals.api.ts index 74dae91725a..5d05bd24650 100644 --- a/frontend/src/lib/api/proposals.api.ts +++ b/frontend/src/lib/api/proposals.api.ts @@ -1,4 +1,5 @@ import { createAgent } from "$lib/api/agent.api"; +import { nnsDappCanister } from "$lib/api/nns-dapp.api"; import { DEFAULT_LIST_PAGINATION_LIMIT } from "$lib/constants/constants"; import { HOST } from "$lib/constants/environment.constants"; import { hashCode, logWithTimestamp } from "$lib/utils/dev.utils"; @@ -13,7 +14,6 @@ import { type ProposalId, type ProposalInfo, } from "@dfinity/nns"; -import { nnsDappCanister } from "./nns-dapp.api"; export const queryProposals = async ({ beforeProposal, diff --git a/frontend/src/lib/api/sns-governance.api.ts b/frontend/src/lib/api/sns-governance.api.ts index 9c8d40c5552..e836414da3f 100644 --- a/frontend/src/lib/api/sns-governance.api.ts +++ b/frontend/src/lib/api/sns-governance.api.ts @@ -1,3 +1,4 @@ +import { wrapper } from "$lib/api/sns-wrapper.api"; import { logWithTimestamp } from "$lib/utils/dev.utils"; import { subaccountToHexString } from "$lib/utils/sns-neuron.utils"; import type { Identity } from "@dfinity/agent"; @@ -12,7 +13,6 @@ import type { SnsProposalId, SnsVote, } from "@dfinity/sns"; -import { wrapper } from "./sns-wrapper.api"; export const querySnsNeurons = async ({ identity, diff --git a/frontend/src/lib/api/sns-sale.api.ts b/frontend/src/lib/api/sns-sale.api.ts index 9f7d72fe5c6..70fc602a37a 100644 --- a/frontend/src/lib/api/sns-sale.api.ts +++ b/frontend/src/lib/api/sns-sale.api.ts @@ -1,4 +1,5 @@ import { createAgent } from "$lib/api/agent.api"; +import { wrapper } from "$lib/api/sns-wrapper.api"; import { HOST } from "$lib/constants/environment.constants"; import { logWithTimestamp } from "$lib/utils/dev.utils"; import { isMethodNotSupportedError } from "$lib/utils/error.utils"; @@ -11,7 +12,6 @@ import type { } from "@dfinity/sns"; import { SnsSwapCanister } from "@dfinity/sns"; import { toNullable } from "@dfinity/utils"; -import { wrapper } from "./sns-wrapper.api"; export const getOpenTicket = async ({ identity, diff --git a/frontend/src/lib/api/sns.api.ts b/frontend/src/lib/api/sns.api.ts index de8715f18d3..ada50fda0d1 100644 --- a/frontend/src/lib/api/sns.api.ts +++ b/frontend/src/lib/api/sns.api.ts @@ -1,3 +1,4 @@ +import { wrapper, wrappers } from "$lib/api/sns-wrapper.api"; import type { SnsSwapCommitment } from "$lib/types/sns"; import type { QueryRootCanisterId, @@ -16,7 +17,6 @@ import type { SnsSwapBuyerState, SnsWrapper, } from "@dfinity/sns"; -import { wrapper, wrappers } from "./sns-wrapper.api"; export const queryAllSnsMetadata = async ({ identity, diff --git a/frontend/src/lib/canisters/ic-management/converters.ts b/frontend/src/lib/canisters/ic-management/converters.ts index 3860314ef30..325b89668e9 100644 --- a/frontend/src/lib/canisters/ic-management/converters.ts +++ b/frontend/src/lib/canisters/ic-management/converters.ts @@ -1,7 +1,7 @@ +import type { CanisterDetails } from "$lib/canisters/ic-management/ic-management.canister.types"; +import { CanisterStatus } from "$lib/canisters/ic-management/ic-management.canister.types"; import type { CanisterStatusResponse } from "@dfinity/ic-management"; import type { Principal } from "@dfinity/principal"; -import type { CanisterDetails } from "./ic-management.canister.types"; -import { CanisterStatus } from "./ic-management.canister.types"; const getCanisterStatus = ( status: diff --git a/frontend/src/lib/canisters/ic-management/ic-management.canister.ts b/frontend/src/lib/canisters/ic-management/ic-management.canister.ts index 38d9882f05c..78b830327f0 100644 --- a/frontend/src/lib/canisters/ic-management/ic-management.canister.ts +++ b/frontend/src/lib/canisters/ic-management/ic-management.canister.ts @@ -1,15 +1,15 @@ +import { toCanisterDetails } from "$lib/canisters/ic-management/converters"; +import { mapError } from "$lib/canisters/ic-management/ic-management.errors"; import type { ICManagementCanisterOptions } from "@dfinity/ic-management"; import { ICManagementCanister as ICMgmtCanister, type CanisterStatusResponse, } from "@dfinity/ic-management"; import type { Principal } from "@dfinity/principal"; -import { toCanisterDetails } from "./converters"; import type { CanisterDetails, CanisterSettings, } from "./ic-management.canister.types"; -import { mapError } from "./ic-management.errors"; /** * The ICManagementCanister was initially implemented here, but it has since been moved to ic-js and packaged as a standalone library. diff --git a/frontend/src/lib/canisters/nns-dapp/nns-dapp.canister.ts b/frontend/src/lib/canisters/nns-dapp/nns-dapp.canister.ts index 7c1c6dc048f..824be7d63b4 100644 --- a/frontend/src/lib/canisters/nns-dapp/nns-dapp.canister.ts +++ b/frontend/src/lib/canisters/nns-dapp/nns-dapp.canister.ts @@ -1,10 +1,12 @@ +import type { NNSDappCanisterOptions } from "$lib/canisters/nns-dapp/nns-dapp.canister.types"; +import { idlFactory as certifiedIdlFactory } from "$lib/canisters/nns-dapp/nns-dapp.certified.idl"; +import type { NNSDappService } from "$lib/canisters/nns-dapp/nns-dapp.idl"; +import { idlFactory } from "$lib/canisters/nns-dapp/nns-dapp.idl"; import { Actor } from "@dfinity/agent"; import { AccountIdentifier } from "@dfinity/ledger-icp"; import type { ProposalId } from "@dfinity/nns"; import type { Principal } from "@dfinity/principal"; import { nonNullish, toNullable } from "@dfinity/utils"; -import type { NNSDappCanisterOptions } from "./nns-dapp.canister.types"; -import { idlFactory as certifiedIdlFactory } from "./nns-dapp.certified.idl"; import { AccountNotFoundError, CanisterAlreadyAttachedError, @@ -20,8 +22,6 @@ import { TooManyImportedTokensError, UnknownProposalPayloadError, } from "./nns-dapp.errors"; -import type { NNSDappService } from "./nns-dapp.idl"; -import { idlFactory } from "./nns-dapp.idl"; import type { AccountDetails, CanisterDetails, diff --git a/frontend/src/lib/canisters/nns-dapp/nns-dapp.canister.types.ts b/frontend/src/lib/canisters/nns-dapp/nns-dapp.canister.types.ts index 627de2302f8..71458d9a18e 100644 --- a/frontend/src/lib/canisters/nns-dapp/nns-dapp.canister.types.ts +++ b/frontend/src/lib/canisters/nns-dapp/nns-dapp.canister.types.ts @@ -1,6 +1,6 @@ +import type { NNSDappService } from "$lib/canisters/nns-dapp/nns-dapp.idl"; import type { Agent } from "@dfinity/agent"; import type { Principal } from "@dfinity/principal"; -import type { NNSDappService } from "./nns-dapp.idl"; export interface NNSDappCanisterOptions { // The agent to use when communicating with the governance canister. diff --git a/frontend/src/lib/canisters/nns-dapp/nns-dapp.idl.d.ts b/frontend/src/lib/canisters/nns-dapp/nns-dapp.idl.d.ts index ec349fe05ad..07b4c096555 100644 --- a/frontend/src/lib/canisters/nns-dapp/nns-dapp.idl.d.ts +++ b/frontend/src/lib/canisters/nns-dapp/nns-dapp.idl.d.ts @@ -1,5 +1,5 @@ +import _SERVICE from "$lib/canisters/nns-dapp/nns-dapp.types"; import type { IDL } from "@dfinity/candid"; -import _SERVICE from "./nns-dapp.types"; export const idlFactory: IDL.InterfaceFactory; export { _SERVICE as NNSDappService }; diff --git a/frontend/src/lib/canisters/tvl/tvl.canister.ts b/frontend/src/lib/canisters/tvl/tvl.canister.ts index 40260e97a6e..db7978921ea 100644 --- a/frontend/src/lib/canisters/tvl/tvl.canister.ts +++ b/frontend/src/lib/canisters/tvl/tvl.canister.ts @@ -3,11 +3,11 @@ import type { GetTVLResult, TVLCanisterOptions, } from "$lib/canisters/tvl/tvl.canister.types"; +import { idlFactory as certifiedIdlFactory } from "$lib/canisters/tvl/tvl.certified.idl"; +import { idlFactory } from "$lib/canisters/tvl/tvl.idl"; +import type { _SERVICE as TVLService } from "$lib/canisters/tvl/tvl.types"; import { Actor } from "@dfinity/agent"; import { Canister, nonNullish, toNullable } from "@dfinity/utils"; -import { idlFactory as certifiedIdlFactory } from "./tvl.certified.idl"; -import { idlFactory } from "./tvl.idl"; -import type { _SERVICE as TVLService } from "./tvl.types"; export class TVLCanister extends Canister { public static create(options: TVLCanisterOptions): TVLCanister { diff --git a/frontend/src/lib/components/accounts/AddSubAccount.svelte b/frontend/src/lib/components/accounts/AddSubAccount.svelte index 31f407b789a..28cb8c7e424 100644 --- a/frontend/src/lib/components/accounts/AddSubAccount.svelte +++ b/frontend/src/lib/components/accounts/AddSubAccount.svelte @@ -1,4 +1,5 @@ diff --git a/frontend/src/lib/components/canister-detail/CanisterPageHeading.svelte b/frontend/src/lib/components/canister-detail/CanisterPageHeading.svelte index b9c7c388405..8e49cc9e685 100644 --- a/frontend/src/lib/components/canister-detail/CanisterPageHeading.svelte +++ b/frontend/src/lib/components/canister-detail/CanisterPageHeading.svelte @@ -1,11 +1,11 @@ diff --git a/frontend/src/lib/components/proposals/LoadingActionableProposals.svelte b/frontend/src/lib/components/proposals/LoadingActionableProposals.svelte index 4bf8ad171fe..d6dd34aef79 100644 --- a/frontend/src/lib/components/proposals/LoadingActionableProposals.svelte +++ b/frontend/src/lib/components/proposals/LoadingActionableProposals.svelte @@ -1,5 +1,5 @@ diff --git a/frontend/src/lib/components/proposals/LoadingProposals.svelte b/frontend/src/lib/components/proposals/LoadingProposals.svelte index 0cb7f08fbdb..1a36b177eea 100644 --- a/frontend/src/lib/components/proposals/LoadingProposals.svelte +++ b/frontend/src/lib/components/proposals/LoadingProposals.svelte @@ -1,5 +1,5 @@
diff --git a/frontend/src/lib/components/proposals/NnsProposalCard.svelte b/frontend/src/lib/components/proposals/NnsProposalCard.svelte index feb1dbf2f1d..99a261301e5 100644 --- a/frontend/src/lib/components/proposals/NnsProposalCard.svelte +++ b/frontend/src/lib/components/proposals/NnsProposalCard.svelte @@ -1,4 +1,5 @@
diff --git a/frontend/src/lib/components/reporting/ReportingTransactions.svelte b/frontend/src/lib/components/reporting/ReportingTransactions.svelte index 166494daf91..94e913f33f3 100644 --- a/frontend/src/lib/components/reporting/ReportingTransactions.svelte +++ b/frontend/src/lib/components/reporting/ReportingTransactions.svelte @@ -1,8 +1,8 @@ diff --git a/frontend/src/lib/components/sns-neuron-detail/FollowSnsTopicSection.svelte b/frontend/src/lib/components/sns-neuron-detail/FollowSnsTopicSection.svelte index 59814a99c58..b8a11703c2c 100644 --- a/frontend/src/lib/components/sns-neuron-detail/FollowSnsTopicSection.svelte +++ b/frontend/src/lib/components/sns-neuron-detail/FollowSnsTopicSection.svelte @@ -1,5 +1,6 @@ diff --git a/frontend/src/lib/components/ui/SkeletonHeader.svelte b/frontend/src/lib/components/ui/SkeletonHeader.svelte index a3921194d5e..26603d9ced2 100644 --- a/frontend/src/lib/components/ui/SkeletonHeader.svelte +++ b/frontend/src/lib/components/ui/SkeletonHeader.svelte @@ -1,5 +1,5 @@ diff --git a/frontend/src/lib/components/ui/SkeletonHeading.svelte b/frontend/src/lib/components/ui/SkeletonHeading.svelte index 85d389474dc..ca99a6c81d5 100644 --- a/frontend/src/lib/components/ui/SkeletonHeading.svelte +++ b/frontend/src/lib/components/ui/SkeletonHeading.svelte @@ -1,5 +1,5 @@ diff --git a/frontend/src/lib/components/ui/SkeletonProjectCard.svelte b/frontend/src/lib/components/ui/SkeletonProjectCard.svelte index f1d64a13160..256f5cb0155 100644 --- a/frontend/src/lib/components/ui/SkeletonProjectCard.svelte +++ b/frontend/src/lib/components/ui/SkeletonProjectCard.svelte @@ -1,6 +1,6 @@ diff --git a/frontend/src/lib/components/universe/UniverseSummary.svelte b/frontend/src/lib/components/universe/UniverseSummary.svelte index bcdc5192a5e..2cc172db0f9 100644 --- a/frontend/src/lib/components/universe/UniverseSummary.svelte +++ b/frontend/src/lib/components/universe/UniverseSummary.svelte @@ -1,6 +1,6 @@ diff --git a/frontend/src/lib/derived/accounts-title.derived.ts b/frontend/src/lib/derived/accounts-title.derived.ts index 9aa1d5d3d16..857b26db392 100644 --- a/frontend/src/lib/derived/accounts-title.derived.ts +++ b/frontend/src/lib/derived/accounts-title.derived.ts @@ -1,10 +1,10 @@ +import { pageStore, type Page } from "$lib/derived/page.derived"; import { tokensByUniverseIdStore } from "$lib/derived/tokens.derived"; import { i18n } from "$lib/stores/i18n"; import type { IcrcTokenMetadata } from "$lib/types/icrc"; import { replacePlaceholders } from "$lib/utils/i18n.utils"; import { isNullish } from "@dfinity/utils"; import { derived, type Readable } from "svelte/store"; -import { pageStore, type Page } from "./page.derived"; export const accountsTitleStore = derived< [Readable, Readable>, Readable], diff --git a/frontend/src/lib/derived/ckbtc-universes.derived.ts b/frontend/src/lib/derived/ckbtc-universes.derived.ts index 655b523bb1a..7b5c236fa54 100644 --- a/frontend/src/lib/derived/ckbtc-universes.derived.ts +++ b/frontend/src/lib/derived/ckbtc-universes.derived.ts @@ -1,8 +1,8 @@ +import { ckBTCUniverseStore } from "$lib/derived/ckbtc-universe.derived"; +import { ckTESTBTCUniverseStore } from "$lib/derived/cktestbtc-universe.derived"; import { ENABLE_CKTESTBTC } from "$lib/stores/feature-flags.store"; import type { Universe } from "$lib/types/universe"; import { derived, type Readable } from "svelte/store"; -import { ckBTCUniverseStore } from "./ckbtc-universe.derived"; -import { ckTESTBTCUniverseStore } from "./cktestbtc-universe.derived"; export const ckBTCUniversesStore = derived< [Readable, Readable, Readable], diff --git a/frontend/src/lib/derived/icp-tokens-list-user.derived.ts b/frontend/src/lib/derived/icp-tokens-list-user.derived.ts index e9111fe98e0..44c67d2aaf7 100644 --- a/frontend/src/lib/derived/icp-tokens-list-user.derived.ts +++ b/frontend/src/lib/derived/icp-tokens-list-user.derived.ts @@ -8,6 +8,7 @@ import { icpSwapUsdPricesStore, type IcpSwapUsdPricesStore, } from "$lib/derived/icp-swap.derived"; +import { nnsUniverseStore } from "$lib/derived/nns-universe.derived"; import { i18n } from "$lib/stores/i18n"; import type { Account, AccountType } from "$lib/types/account"; import { UserTokenAction, type UserToken } from "$lib/types/tokens-page"; @@ -17,7 +18,6 @@ import { getUsdValue, sortUserTokens } from "$lib/utils/token.utils"; import { Principal } from "@dfinity/principal"; import { isNullish, TokenAmountV2 } from "@dfinity/utils"; import { derived, type Readable } from "svelte/store"; -import { nnsUniverseStore } from "./nns-universe.derived"; const convertAccountToUserTokenData = ({ nnsUniverse, diff --git a/frontend/src/lib/derived/icp-tokens-list-visitors.derived.ts b/frontend/src/lib/derived/icp-tokens-list-visitors.derived.ts index b957bc66e39..d37f8957b28 100644 --- a/frontend/src/lib/derived/icp-tokens-list-visitors.derived.ts +++ b/frontend/src/lib/derived/icp-tokens-list-visitors.derived.ts @@ -3,6 +3,7 @@ import { OWN_CANISTER_ID_TEXT, } from "$lib/constants/canister-ids.constants"; import { NNS_TOKEN_DATA } from "$lib/constants/tokens.constants"; +import { nnsUniverseStore } from "$lib/derived/nns-universe.derived"; import { UserTokenAction, type UserTokenData } from "$lib/types/tokens-page"; import type { Universe } from "$lib/types/universe"; import { buildWalletUrl } from "$lib/utils/navigation.utils"; @@ -10,7 +11,6 @@ import { UnavailableTokenAmount } from "$lib/utils/token.utils"; import { Principal } from "@dfinity/principal"; import { TokenAmountV2 } from "@dfinity/utils"; import { derived, type Readable } from "svelte/store"; -import { nnsUniverseStore } from "./nns-universe.derived"; export const icpTokensListVisitors = derived< Readable, diff --git a/frontend/src/lib/derived/neurons.derived.ts b/frontend/src/lib/derived/neurons.derived.ts index d8148bd09ad..d047c9f0dde 100644 --- a/frontend/src/lib/derived/neurons.derived.ts +++ b/frontend/src/lib/derived/neurons.derived.ts @@ -1,7 +1,7 @@ +import { neuronsStore } from "$lib/stores/neurons.store"; import type { NeuronInfo } from "@dfinity/nns"; import { nonNullish } from "@dfinity/utils"; import { derived, type Readable } from "svelte/store"; -import { neuronsStore } from "../stores/neurons.store"; import { hasValidStake, shouldDisplayRewardLossNotification, diff --git a/frontend/src/lib/derived/selectable-universes.derived.ts b/frontend/src/lib/derived/selectable-universes.derived.ts index 7b889338aac..d4e98eb554f 100644 --- a/frontend/src/lib/derived/selectable-universes.derived.ts +++ b/frontend/src/lib/derived/selectable-universes.derived.ts @@ -9,6 +9,7 @@ import { type IcrcCanistersStoreData, } from "$lib/derived/icrc-canisters.derived"; import { pageStore, type Page } from "$lib/derived/page.derived"; +import { universesStore } from "$lib/derived/universes.derived"; import type { Universe } from "$lib/types/universe"; import { createAscendingComparator, @@ -18,7 +19,6 @@ import { import { isAllTokensPath, isUniverseCkBTC } from "$lib/utils/universe.utils"; import { isNullish } from "@dfinity/utils"; import { derived, type Readable } from "svelte/store"; -import { universesStore } from "./universes.derived"; type UniverseWithActionableProposalCount = { universe: Universe; diff --git a/frontend/src/lib/derived/selected-universe.derived.ts b/frontend/src/lib/derived/selected-universe.derived.ts index 3ec7a00b487..392537f5828 100644 --- a/frontend/src/lib/derived/selected-universe.derived.ts +++ b/frontend/src/lib/derived/selected-universe.derived.ts @@ -7,6 +7,7 @@ import { type IcrcCanistersStore, type IcrcCanistersStoreData, } from "$lib/derived/icrc-canisters.derived"; +import { nnsUniverseStore } from "$lib/derived/nns-universe.derived"; import { pageStore, type Page } from "$lib/derived/page.derived"; import { selectableUniversesStore } from "$lib/derived/selectable-universes.derived"; import { ENABLE_CKTESTBTC } from "$lib/stores/feature-flags.store"; @@ -20,7 +21,6 @@ import { import { Principal } from "@dfinity/principal"; import { nonNullish } from "@dfinity/utils"; import { derived, type Readable } from "svelte/store"; -import { nnsUniverseStore } from "./nns-universe.derived"; /** * In Neurons or ultimately in Voting screen, user can select the "universe" - e.g. display Neurons of Nns or a particular Sns diff --git a/frontend/src/lib/derived/sns-functions.derived.ts b/frontend/src/lib/derived/sns-functions.derived.ts index c7f2452c407..467cbbb5bdf 100644 --- a/frontend/src/lib/derived/sns-functions.derived.ts +++ b/frontend/src/lib/derived/sns-functions.derived.ts @@ -1,7 +1,7 @@ +import { snsAggregatorDerived } from "$lib/derived/sns-aggregator.derived"; import { convertNervousFunction } from "$lib/utils/sns-aggregator-converters.utils"; import type { SnsNervousSystemFunction } from "@dfinity/sns"; import { type Readable } from "svelte/store"; -import { snsAggregatorDerived } from "./sns-aggregator.derived"; interface SnsNervousSystemFunctions { nsFunctions: SnsNervousSystemFunction[]; diff --git a/frontend/src/lib/derived/sns-total-token-supply.derived.ts b/frontend/src/lib/derived/sns-total-token-supply.derived.ts index 3a2fb0e804d..483f143a7b0 100644 --- a/frontend/src/lib/derived/sns-total-token-supply.derived.ts +++ b/frontend/src/lib/derived/sns-total-token-supply.derived.ts @@ -1,6 +1,6 @@ +import { snsAggregatorDerived } from "$lib/derived/sns-aggregator.derived"; import type { RootCanisterIdText } from "$lib/types/sns"; import { type Readable } from "svelte/store"; -import { snsAggregatorDerived } from "./sns-aggregator.derived"; interface ProjectTotalSupplyData { totalSupply: bigint; diff --git a/frontend/src/lib/derived/sns/sns-selected-project-new-tx-data.derived.ts b/frontend/src/lib/derived/sns/sns-selected-project-new-tx-data.derived.ts index fe30f9a74a3..5b6755adb61 100644 --- a/frontend/src/lib/derived/sns/sns-selected-project-new-tx-data.derived.ts +++ b/frontend/src/lib/derived/sns/sns-selected-project-new-tx-data.derived.ts @@ -1,9 +1,9 @@ +import { selectedUniverseIdStore } from "$lib/derived/selected-universe.derived"; +import { snsSelectedTransactionFeeStore } from "$lib/derived/sns/sns-selected-transaction-fee.store"; +import { snsTokenSymbolSelectedStore } from "$lib/derived/sns/sns-token-symbol-selected.store"; import type { Principal } from "@dfinity/principal"; import type { Token, TokenAmount } from "@dfinity/utils"; import { derived, type Readable } from "svelte/store"; -import { selectedUniverseIdStore } from "../selected-universe.derived"; -import { snsSelectedTransactionFeeStore } from "./sns-selected-transaction-fee.store"; -import { snsTokenSymbolSelectedStore } from "./sns-token-symbol-selected.store"; interface SnsNewTxData { token: Token; diff --git a/frontend/src/lib/derived/sns/sns-selected-transaction-fee.store.ts b/frontend/src/lib/derived/sns/sns-selected-transaction-fee.store.ts index 6690c1a9ded..b6b2bb72999 100644 --- a/frontend/src/lib/derived/sns/sns-selected-transaction-fee.store.ts +++ b/frontend/src/lib/derived/sns/sns-selected-transaction-fee.store.ts @@ -1,7 +1,7 @@ +import { snsOnlyProjectStore } from "$lib/derived/sns/sns-selected-project.derived"; import { snsTokensByRootCanisterIdStore } from "$lib/derived/sns/sns-tokens.derived"; import { TokenAmount, nonNullish } from "@dfinity/utils"; import { derived, type Readable } from "svelte/store"; -import { snsOnlyProjectStore } from "./sns-selected-project.derived"; export const snsSelectedTransactionFeeStore: Readable = derived( diff --git a/frontend/src/lib/derived/sns/sns-sorted-neurons.derived.ts b/frontend/src/lib/derived/sns/sns-sorted-neurons.derived.ts index ce67501fadd..1432bf63d57 100644 --- a/frontend/src/lib/derived/sns/sns-sorted-neurons.derived.ts +++ b/frontend/src/lib/derived/sns/sns-sorted-neurons.derived.ts @@ -1,3 +1,4 @@ +import { selectedUniverseIdStore } from "$lib/derived/selected-universe.derived"; import { snsNeuronsStore } from "$lib/stores/sns-neurons.store"; import { hasValidStake, @@ -6,7 +7,6 @@ import { } from "$lib/utils/sns-neuron.utils"; import type { SnsNeuron } from "@dfinity/sns"; import { derived, type Readable } from "svelte/store"; -import { selectedUniverseIdStore } from "../selected-universe.derived"; export const definedSnsNeuronStore: Readable = derived( [snsNeuronsStore, selectedUniverseIdStore], diff --git a/frontend/src/lib/derived/title-token-selector.derived.ts b/frontend/src/lib/derived/title-token-selector.derived.ts index 7c9f4a61d2c..a4ed8904d9e 100644 --- a/frontend/src/lib/derived/title-token-selector.derived.ts +++ b/frontend/src/lib/derived/title-token-selector.derived.ts @@ -1,8 +1,8 @@ import { AppPath } from "$lib/constants/routes.constants"; +import { pageStore } from "$lib/derived/page.derived"; import { i18n } from "$lib/stores/i18n"; import { isSelectedPath } from "$lib/utils/navigation.utils"; import { derived } from "svelte/store"; -import { pageStore } from "./page.derived"; export const titleTokenSelectorStore = derived( [i18n, pageStore], diff --git a/frontend/src/lib/derived/tokens-list-base.derived.ts b/frontend/src/lib/derived/tokens-list-base.derived.ts index b179eb5c9b7..7d1e4b8a863 100644 --- a/frontend/src/lib/derived/tokens-list-base.derived.ts +++ b/frontend/src/lib/derived/tokens-list-base.derived.ts @@ -1,9 +1,9 @@ +import { universesStore } from "$lib/derived/universes.derived"; import type { UserTokenBase } from "$lib/types/tokens-page"; import type { Universe } from "$lib/types/universe"; import { getLedgerCanisterIdFromUniverse } from "$lib/utils/universe.utils"; import { Principal } from "@dfinity/principal"; import { derived, type Readable } from "svelte/store"; -import { universesStore } from "./universes.derived"; const convertUniverseToBaseTokenData = (universe: Universe): UserTokenBase => ({ universeId: Principal.fromText(universe.canisterId), diff --git a/frontend/src/lib/derived/tokens-list-user.derived.ts b/frontend/src/lib/derived/tokens-list-user.derived.ts index 1c8c476d9b4..5ddc22e956e 100644 --- a/frontend/src/lib/derived/tokens-list-user.derived.ts +++ b/frontend/src/lib/derived/tokens-list-user.derived.ts @@ -1,10 +1,14 @@ import { OWN_CANISTER_ID_TEXT } from "$lib/constants/canister-ids.constants"; +import type { UniversesAccounts } from "$lib/derived/accounts-list.derived"; import { icpSwapUsdPricesStore, type IcpSwapUsdPricesStore, type IcpSwapUsdPricesStoreData, } from "$lib/derived/icp-swap.derived"; import { failedExistentImportedTokenLedgerIdsStore } from "$lib/derived/imported-tokens.derived"; +import { tokensListBaseStore } from "$lib/derived/tokens-list-base.derived"; +import { tokensByUniverseIdStore } from "$lib/derived/tokens.derived"; +import { universesAccountsStore } from "$lib/derived/universes-accounts.derived"; import type { IcrcTokenMetadata } from "$lib/types/icrc"; import { UserTokenAction, @@ -17,10 +21,6 @@ import { isUniverseNns } from "$lib/utils/universe.utils"; import { toUserTokenFailed } from "$lib/utils/user-token.utils"; import { isNullish, TokenAmountV2 } from "@dfinity/utils"; import { derived, type Readable } from "svelte/store"; -import type { UniversesAccounts } from "./accounts-list.derived"; -import { tokensListBaseStore } from "./tokens-list-base.derived"; -import { tokensByUniverseIdStore } from "./tokens.derived"; -import { universesAccountsStore } from "./universes-accounts.derived"; const getUsdValue = ({ balance, diff --git a/frontend/src/lib/derived/tokens-list-visitors.derived.ts b/frontend/src/lib/derived/tokens-list-visitors.derived.ts index 557c23fcef2..6754e4f9db4 100644 --- a/frontend/src/lib/derived/tokens-list-visitors.derived.ts +++ b/frontend/src/lib/derived/tokens-list-visitors.derived.ts @@ -1,3 +1,5 @@ +import { tokensListBaseStore } from "$lib/derived/tokens-list-base.derived"; +import { tokensByUniverseIdStore } from "$lib/derived/tokens.derived"; import type { IcrcTokenMetadata } from "$lib/types/icrc"; import { UserTokenAction, @@ -9,8 +11,6 @@ import { UnavailableTokenAmount } from "$lib/utils/token.utils"; import { isUniverseNns } from "$lib/utils/universe.utils"; import { TokenAmountV2, isNullish } from "@dfinity/utils"; import { derived, type Readable } from "svelte/store"; -import { tokensListBaseStore } from "./tokens-list-base.derived"; -import { tokensByUniverseIdStore } from "./tokens.derived"; const convertToUserToken = ({ tokenBaseData, diff --git a/frontend/src/lib/derived/universes.derived.ts b/frontend/src/lib/derived/universes.derived.ts index 9d55f35a609..0f245a2d2f5 100644 --- a/frontend/src/lib/derived/universes.derived.ts +++ b/frontend/src/lib/derived/universes.derived.ts @@ -1,4 +1,6 @@ import { ckBTCUniversesStore } from "$lib/derived/ckbtc-universes.derived"; +import { icrcTokensUniversesStore } from "$lib/derived/icrc-universes.derived"; +import { nnsUniverseStore } from "$lib/derived/nns-universe.derived"; import { snsProjectsCommittedStore, type SnsFullProject, @@ -6,8 +8,6 @@ import { import type { Universe } from "$lib/types/universe"; import { createUniverse } from "$lib/utils/universe.utils"; import { derived, type Readable } from "svelte/store"; -import { icrcTokensUniversesStore } from "./icrc-universes.derived"; -import { nnsUniverseStore } from "./nns-universe.derived"; export const universesStore = derived< [ diff --git a/frontend/src/lib/directives/debug.directives.ts b/frontend/src/lib/directives/debug.directives.ts index cbea4ea9cc4..930943be633 100644 --- a/frontend/src/lib/directives/debug.directives.ts +++ b/frontend/src/lib/directives/debug.directives.ts @@ -1,7 +1,9 @@ import { addHotkey } from "$lib/api/governance.api"; import type { FeatureKey } from "$lib/constants/environment.constants"; import { initDebugStore } from "$lib/derived/debug.derived"; +import { getAuthenticatedIdentity } from "$lib/services/auth.services"; import { listNeurons, removeFollowee } from "$lib/services/neurons.services"; +import { claimSeedNeurons } from "$lib/services/seed-neurons.services"; import { EDITABLE_FEATURE_FLAGS, overrideFeatureFlagsStore, @@ -14,8 +16,6 @@ import { enumKeys } from "$lib/utils/enum.utils"; import { followeesByTopic } from "$lib/utils/neuron.utils"; import { Topic, type NeuronId } from "@dfinity/nns"; import { get } from "svelte/store"; -import { getAuthenticatedIdentity } from "../services/auth.services"; -import { claimSeedNeurons } from "../services/seed-neurons.services"; /** * coo - original as object -> console diff --git a/frontend/src/lib/modals/accounts/AccountsModals.svelte b/frontend/src/lib/modals/accounts/AccountsModals.svelte index 1a529cdcd67..6e7fe48aa51 100644 --- a/frontend/src/lib/modals/accounts/AccountsModals.svelte +++ b/frontend/src/lib/modals/accounts/AccountsModals.svelte @@ -1,4 +1,7 @@