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 @@