From 74823b1de3e529a522507693b758eaded93a0d62 Mon Sep 17 00:00:00 2001 From: Tom Meagher Date: Tue, 29 Aug 2023 16:47:00 -0400 Subject: [PATCH] refactor: create filenames --- packages/core/src/actions/connect.ts | 4 +-- packages/core/src/actions/disconnect.ts | 6 +++- .../core/src/actions/getAccount.test-d.ts | 2 +- packages/core/src/actions/getAccount.ts | 18 +++++------ packages/core/src/actions/getBalance.ts | 2 +- packages/core/src/actions/getBlockNumber.ts | 2 +- packages/core/src/actions/getChainId.ts | 2 +- .../core/src/actions/getConnections.test.ts | 2 +- packages/core/src/actions/getConnections.ts | 2 +- .../core/src/actions/getConnectorClient.ts | 2 +- packages/core/src/actions/getEnsAddress.ts | 2 +- packages/core/src/actions/getEnsAvatar.ts | 2 +- packages/core/src/actions/getEnsName.ts | 2 +- packages/core/src/actions/getEnsResolver.ts | 2 +- packages/core/src/actions/getFeeData.ts | 2 +- packages/core/src/actions/getToken.ts | 2 +- .../core/src/actions/getTransaction.test-d.ts | 2 +- packages/core/src/actions/getTransaction.ts | 2 +- packages/core/src/actions/multicall.ts | 2 +- .../actions/prepareSendTransaction.test-d.ts | 2 +- .../src/actions/prepareSendTransaction.ts | 2 +- packages/core/src/actions/readContract.ts | 2 +- .../core/src/actions/readContracts.test.ts | 2 +- packages/core/src/actions/readContracts.ts | 2 +- packages/core/src/actions/reconnect.ts | 4 +-- .../src/actions/sendTransaction.test-d.ts | 2 +- packages/core/src/actions/sendTransaction.ts | 2 +- packages/core/src/actions/signMessage.ts | 2 +- packages/core/src/actions/signTypedData.ts | 2 +- .../src/actions/simulateContract.test-d.ts | 2 +- packages/core/src/actions/simulateContract.ts | 2 +- packages/core/src/actions/switchAccount.ts | 2 +- packages/core/src/actions/switchChain.ts | 2 +- .../waitForTransactionReceipt.test-d.ts | 2 +- .../src/actions/waitForTransactionReceipt.ts | 2 +- .../src/actions/watchPendingTransactions.ts | 2 +- .../core/src/actions/writeContract.test-d.ts | 2 +- packages/core/src/actions/writeContract.ts | 2 +- ...onfig.test-d.ts => createConfig.test-d.ts} | 2 +- .../{config.test.ts => createConfig.test.ts} | 2 +- .../core/src/{config.ts => createConfig.ts} | 9 ++++-- .../src/{connector.ts => createConnector.ts} | 4 +-- .../core/src/{emitter.ts => createEmitter.ts} | 0 ...rage.test-d.ts => createStorage.test-d.ts} | 4 +-- ...{storage.test.ts => createStorage.test.ts} | 2 +- .../core/src/{storage.ts => createStorage.ts} | 2 +- packages/core/src/errors/connector.ts | 2 +- packages/core/src/index.ts | 30 +++++++++---------- packages/core/src/internal.ts | 2 +- packages/core/src/query/connect.ts | 2 +- packages/core/src/query/disconnect.ts | 2 +- packages/core/src/query/getBalance.ts | 2 +- packages/core/src/query/getBlockNumber.ts | 2 +- packages/core/src/query/getConnectorClient.ts | 2 +- packages/core/src/query/getEnsAddress.ts | 2 +- packages/core/src/query/getEnsAvatar.ts | 2 +- packages/core/src/query/getEnsName.ts | 2 +- packages/core/src/query/getEnsResolver.ts | 2 +- packages/core/src/query/getFeeData.ts | 2 +- packages/core/src/query/getToken.ts | 2 +- packages/core/src/query/getTransaction.ts | 2 +- .../core/src/query/prepareSendTransaction.ts | 2 +- packages/core/src/query/readContract.ts | 2 +- packages/core/src/query/readContracts.ts | 2 +- packages/core/src/query/reconnect.ts | 2 +- packages/core/src/query/sendTransaction.ts | 2 +- packages/core/src/query/signMessage.ts | 2 +- packages/core/src/query/signTypedData.ts | 2 +- .../core/src/query/simulateContract.test-d.ts | 2 +- packages/core/src/query/simulateContract.ts | 2 +- packages/core/src/query/switchAccount.ts | 2 +- packages/core/src/query/switchChain.ts | 2 +- .../src/query/waitForTransactionReceipt.ts | 2 +- packages/core/src/query/writeContract.ts | 2 +- packages/core/src/types/chain.test-d.ts | 2 +- packages/core/src/types/chain.ts | 2 +- packages/core/src/types/properties.ts | 2 +- packages/core/src/types/register.ts | 2 +- packages/core/src/utils/assertActiveChain.ts | 2 +- 79 files changed, 111 insertions(+), 108 deletions(-) rename packages/core/src/{config.test-d.ts => createConfig.test-d.ts} (96%) rename packages/core/src/{config.test.ts => createConfig.test.ts} (88%) rename packages/core/src/{config.ts => createConfig.ts} (97%) rename packages/core/src/{connector.ts => createConnector.ts} (95%) rename packages/core/src/{emitter.ts => createEmitter.ts} (100%) rename packages/core/src/{storage.test-d.ts => createStorage.test-d.ts} (91%) rename packages/core/src/{storage.test.ts => createStorage.test.ts} (96%) rename packages/core/src/{storage.ts => createStorage.ts} (97%) diff --git a/packages/core/src/actions/connect.ts b/packages/core/src/actions/connect.ts index 3517f4e9c0..41ca8bc97b 100644 --- a/packages/core/src/actions/connect.ts +++ b/packages/core/src/actions/connect.ts @@ -1,8 +1,8 @@ import { ResourceUnavailableRpcError, UserRejectedRequestError } from 'viem' import { type Address } from 'viem' -import { type Config, type Connector } from '../config.js' -import { type CreateConnectorFn } from '../connector.js' +import { type Config, type Connector } from '../createConfig.js' +import { type CreateConnectorFn } from '../createConnector.js' import type { BaseError } from '../errors/base.js' import { ConnectorAlreadyConnectedError } from '../errors/config.js' import type { ChainIdParameter } from '../types/properties.js' diff --git a/packages/core/src/actions/disconnect.ts b/packages/core/src/actions/disconnect.ts index ae8ac39da5..1c5be1597b 100644 --- a/packages/core/src/actions/disconnect.ts +++ b/packages/core/src/actions/disconnect.ts @@ -1,4 +1,8 @@ -import { type Config, type Connection, type Connector } from '../config.js' +import { + type Config, + type Connection, + type Connector, +} from '../createConfig.js' import { ConnectorNotFoundError } from '../errors/config.js' export type DisconnectParameters = { diff --git a/packages/core/src/actions/getAccount.test-d.ts b/packages/core/src/actions/getAccount.test-d.ts index 6d4ee71045..9ffc4098dc 100644 --- a/packages/core/src/actions/getAccount.test-d.ts +++ b/packages/core/src/actions/getAccount.test-d.ts @@ -2,7 +2,7 @@ import { config } from '@wagmi/test' import type { Address } from 'viem' import { expectTypeOf, test } from 'vitest' -import type { Connector } from '../config.js' +import type { Connector } from '../createConfig.js' import { getAccount } from './getAccount.js' test('states', () => { diff --git a/packages/core/src/actions/getAccount.ts b/packages/core/src/actions/getAccount.ts index 2277c43e86..2aaa32b11e 100644 --- a/packages/core/src/actions/getAccount.ts +++ b/packages/core/src/actions/getAccount.ts @@ -1,6 +1,6 @@ import { type Address } from 'viem' -import { type Config, type Connector } from '../config.js' +import { type Config, type Connector } from '../createConfig.js' import { deepEqual } from '../utils/deepEqual.js' export type GetAccountReturnType = @@ -125,17 +125,13 @@ export function watchAccount( ): WatchAccountReturnType { return config.subscribe(() => getAccount(config), onChange, { equalityFn(a, b) { + const { connector: aConnector, ...aRest } = a + const { connector: bConnector, ...bRest } = b return ( - // check addresses - a.address === b.address && - deepEqual(a.addresses, b.addresses) && - // check chain - a.chainId === b.chainId && - // check stable connector id properties - a.connector?.id === b.connector?.id && - a.connector?.uid === b.connector?.uid && - // check status - a.status === b.status + deepEqual(aRest, bRest) && + // check connector separately + aConnector?.id === bConnector?.id && + aConnector?.uid === bConnector?.uid ) }, }) diff --git a/packages/core/src/actions/getBalance.ts b/packages/core/src/actions/getBalance.ts index 722c8da036..bf53c0e46a 100644 --- a/packages/core/src/actions/getBalance.ts +++ b/packages/core/src/actions/getBalance.ts @@ -11,7 +11,7 @@ import { getBalance as viem_getBalance, } from 'viem/actions' -import type { Config } from '../config.js' +import type { Config } from '../createConfig.js' import type { ChainIdParameter } from '../types/properties.js' import { type Unit } from '../types/unit.js' import { type Evaluate } from '../types/utils.js' diff --git a/packages/core/src/actions/getBlockNumber.ts b/packages/core/src/actions/getBlockNumber.ts index 24b87b183f..e046ee9d35 100644 --- a/packages/core/src/actions/getBlockNumber.ts +++ b/packages/core/src/actions/getBlockNumber.ts @@ -7,7 +7,7 @@ import { watchBlockNumber as viem_watchBlockNumber, } from 'viem/actions' -import { type Config } from '../config.js' +import { type Config } from '../createConfig.js' import type { ChainIdParameter } from '../types/properties.js' import type { Evaluate } from '../types/utils.js' diff --git a/packages/core/src/actions/getChainId.ts b/packages/core/src/actions/getChainId.ts index 6c7ad1d750..47fb8dbc96 100644 --- a/packages/core/src/actions/getChainId.ts +++ b/packages/core/src/actions/getChainId.ts @@ -1,4 +1,4 @@ -import type { Config } from '../config.js' +import type { Config } from '../createConfig.js' export type GetChainIdReturnType = config['chains'][number]['id'] diff --git a/packages/core/src/actions/getConnections.test.ts b/packages/core/src/actions/getConnections.test.ts index 9dada7ccc6..ce20e7154d 100644 --- a/packages/core/src/actions/getConnections.test.ts +++ b/packages/core/src/actions/getConnections.test.ts @@ -1,7 +1,7 @@ import { config } from '@wagmi/test' import { describe, expect, test } from 'vitest' -import type { Connection } from '../config.js' +import type { Connection } from '../createConfig.js' import { connect } from './connect.js' import { disconnect } from './disconnect.js' import { getConnections, watchConnections } from './getConnections.js' diff --git a/packages/core/src/actions/getConnections.ts b/packages/core/src/actions/getConnections.ts index de7562ce62..c2aaede0e3 100644 --- a/packages/core/src/actions/getConnections.ts +++ b/packages/core/src/actions/getConnections.ts @@ -1,4 +1,4 @@ -import type { Config, Connection } from '../config.js' +import type { Config, Connection } from '../createConfig.js' import type { Evaluate } from '../types/utils.js' import { deepEqual } from '../utils/deepEqual.js' diff --git a/packages/core/src/actions/getConnectorClient.ts b/packages/core/src/actions/getConnectorClient.ts index 6b980e7caa..6828d11057 100644 --- a/packages/core/src/actions/getConnectorClient.ts +++ b/packages/core/src/actions/getConnectorClient.ts @@ -7,7 +7,7 @@ import { custom, } from 'viem' -import type { Config, Connection, Connector } from '../config.js' +import type { Config, Connection, Connector } from '../createConfig.js' import { ConnectorNotFoundError } from '../errors/config.js' import type { ChainIdParameter } from '../types/properties.js' import type { Evaluate } from '../types/utils.js' diff --git a/packages/core/src/actions/getEnsAddress.ts b/packages/core/src/actions/getEnsAddress.ts index b8fd5f6d77..f4fef30e28 100644 --- a/packages/core/src/actions/getEnsAddress.ts +++ b/packages/core/src/actions/getEnsAddress.ts @@ -4,7 +4,7 @@ import { getEnsAddress as viem_getEnsAddress, } from 'viem/actions' -import { type Config } from '../config.js' +import { type Config } from '../createConfig.js' import type { ChainIdParameter } from '../types/properties.js' import type { Evaluate } from '../types/utils.js' diff --git a/packages/core/src/actions/getEnsAvatar.ts b/packages/core/src/actions/getEnsAvatar.ts index 23b5bda773..7fc2d8d998 100644 --- a/packages/core/src/actions/getEnsAvatar.ts +++ b/packages/core/src/actions/getEnsAvatar.ts @@ -4,7 +4,7 @@ import { getEnsAvatar as viem_getEnsAvatar, } from 'viem/actions' -import { type Config } from '../config.js' +import { type Config } from '../createConfig.js' import type { ChainIdParameter } from '../types/properties.js' import type { Evaluate } from '../types/utils.js' diff --git a/packages/core/src/actions/getEnsName.ts b/packages/core/src/actions/getEnsName.ts index a477b662cd..e83dd91f96 100644 --- a/packages/core/src/actions/getEnsName.ts +++ b/packages/core/src/actions/getEnsName.ts @@ -4,7 +4,7 @@ import { getEnsName as viem_getEnsName, } from 'viem/actions' -import { type Config } from '../config.js' +import { type Config } from '../createConfig.js' import type { ChainIdParameter } from '../types/properties.js' import type { Evaluate } from '../types/utils.js' diff --git a/packages/core/src/actions/getEnsResolver.ts b/packages/core/src/actions/getEnsResolver.ts index 714223edda..bf2e2556e1 100644 --- a/packages/core/src/actions/getEnsResolver.ts +++ b/packages/core/src/actions/getEnsResolver.ts @@ -4,7 +4,7 @@ import { getEnsResolver as viem_getEnsResolver, } from 'viem/actions' -import { type Config } from '../config.js' +import { type Config } from '../createConfig.js' import type { ChainIdParameter } from '../types/properties.js' import type { Evaluate } from '../types/utils.js' diff --git a/packages/core/src/actions/getFeeData.ts b/packages/core/src/actions/getFeeData.ts index 70e0e72000..75f35f561e 100644 --- a/packages/core/src/actions/getFeeData.ts +++ b/packages/core/src/actions/getFeeData.ts @@ -1,7 +1,7 @@ import { formatUnits, parseGwei } from 'viem' import { getBlock, getGasPrice } from 'viem/actions' -import { type Config } from '../config.js' +import { type Config } from '../createConfig.js' import type { ChainIdParameter } from '../types/properties.js' import type { Unit } from '../types/unit.js' import type { Evaluate } from '../types/utils.js' diff --git a/packages/core/src/actions/getToken.ts b/packages/core/src/actions/getToken.ts index 1baebf5612..af30a54a6b 100644 --- a/packages/core/src/actions/getToken.ts +++ b/packages/core/src/actions/getToken.ts @@ -6,7 +6,7 @@ import { trim, } from 'viem' -import type { Config } from '../config.js' +import type { Config } from '../createConfig.js' import type { ChainIdParameter } from '../types/properties.js' import type { Unit } from '../types/unit.js' import type { Evaluate } from '../types/utils.js' diff --git a/packages/core/src/actions/getTransaction.test-d.ts b/packages/core/src/actions/getTransaction.test-d.ts index 66454dbfb7..34f7b5b399 100644 --- a/packages/core/src/actions/getTransaction.test-d.ts +++ b/packages/core/src/actions/getTransaction.test-d.ts @@ -2,7 +2,7 @@ import { http } from 'viem' import { celo, mainnet } from 'viem/chains' import { expectTypeOf, test } from 'vitest' -import { createConfig } from '../config.js' +import { createConfig } from '../createConfig.js' import { getTransaction } from './getTransaction.js' test('chain formatters', async () => { diff --git a/packages/core/src/actions/getTransaction.ts b/packages/core/src/actions/getTransaction.ts index 117275728a..aaaa894bee 100644 --- a/packages/core/src/actions/getTransaction.ts +++ b/packages/core/src/actions/getTransaction.ts @@ -5,7 +5,7 @@ import { getTransaction as viem_getTransaction, } from 'viem/actions' -import { type Config } from '../config.js' +import { type Config } from '../createConfig.js' import type { SelectChains } from '../types/chain.js' import type { ChainIdParameter } from '../types/properties.js' import { type Evaluate } from '../types/utils.js' diff --git a/packages/core/src/actions/multicall.ts b/packages/core/src/actions/multicall.ts index d1cd723327..174f67c696 100644 --- a/packages/core/src/actions/multicall.ts +++ b/packages/core/src/actions/multicall.ts @@ -5,7 +5,7 @@ import type { } from 'viem' import { multicall as viem_multicall } from 'viem/actions' -import type { Config } from '../config.js' +import type { Config } from '../createConfig.js' import type { ChainIdParameter } from '../types/properties.js' export type MulticallParameters< diff --git a/packages/core/src/actions/prepareSendTransaction.test-d.ts b/packages/core/src/actions/prepareSendTransaction.test-d.ts index aa2fc2882f..eb61e6c5e5 100644 --- a/packages/core/src/actions/prepareSendTransaction.test-d.ts +++ b/packages/core/src/actions/prepareSendTransaction.test-d.ts @@ -2,7 +2,7 @@ import { http } from 'viem' import { celo, mainnet } from 'viem/chains' import { expectTypeOf, test } from 'vitest' -import { createConfig } from '../config.js' +import { createConfig } from '../createConfig.js' import { type PrepareSendTransactionParameters, prepareSendTransaction, diff --git a/packages/core/src/actions/prepareSendTransaction.ts b/packages/core/src/actions/prepareSendTransaction.ts index e829147052..8b97e9cca0 100644 --- a/packages/core/src/actions/prepareSendTransaction.ts +++ b/packages/core/src/actions/prepareSendTransaction.ts @@ -1,7 +1,7 @@ import type { Account, Address, Chain, SendTransactionParameters } from 'viem' import { estimateGas } from 'viem/actions' -import type { Config } from '../config.js' +import type { Config } from '../createConfig.js' import type { SelectChains } from '../types/chain.js' import type { ChainIdParameter, diff --git a/packages/core/src/actions/readContract.ts b/packages/core/src/actions/readContract.ts index 1733807f5c..dabd9d9457 100644 --- a/packages/core/src/actions/readContract.ts +++ b/packages/core/src/actions/readContract.ts @@ -6,7 +6,7 @@ import { readContract as viem_readContract, } from 'viem/actions' -import { type Config } from '../config.js' +import { type Config } from '../createConfig.js' import type { ChainIdParameter } from '../types/properties.js' export type ReadContractParameters< diff --git a/packages/core/src/actions/readContracts.test.ts b/packages/core/src/actions/readContracts.test.ts index b24e9f6ebd..f46dab7c2b 100644 --- a/packages/core/src/actions/readContracts.test.ts +++ b/packages/core/src/actions/readContracts.test.ts @@ -2,7 +2,7 @@ import { abi, address, chain } from '@wagmi/test' import { http, type MulticallResponse } from 'viem' import { expect, expectTypeOf, test, vi } from 'vitest' -import { createConfig } from '../config.js' +import { createConfig } from '../createConfig.js' import * as multicall from './multicall.js' import * as readContract from './readContract.js' import { readContracts } from './readContracts.js' diff --git a/packages/core/src/actions/readContracts.ts b/packages/core/src/actions/readContracts.ts index 63c9d6d455..a7dbf61334 100644 --- a/packages/core/src/actions/readContracts.ts +++ b/packages/core/src/actions/readContracts.ts @@ -5,7 +5,7 @@ import type { } from 'viem' import { ContractFunctionExecutionError } from 'viem' -import { type Config } from '../config.js' +import { type Config } from '../createConfig.js' import { type ChainIdParameter } from '../types/properties.js' import { multicall } from './multicall.js' import { readContract } from './readContract.js' diff --git a/packages/core/src/actions/reconnect.ts b/packages/core/src/actions/reconnect.ts index ebbe8a88d2..78fcad6d5b 100644 --- a/packages/core/src/actions/reconnect.ts +++ b/packages/core/src/actions/reconnect.ts @@ -1,7 +1,7 @@ import type { Address } from 'viem' -import type { Config, Connection, Connector } from '../config.js' -import { type CreateConnectorFn } from '../connector.js' +import type { Config, Connection, Connector } from '../createConfig.js' +import { type CreateConnectorFn } from '../createConnector.js' import type { Evaluate } from '../types/utils.js' export type ReconnectParameters = { diff --git a/packages/core/src/actions/sendTransaction.test-d.ts b/packages/core/src/actions/sendTransaction.test-d.ts index 401b2f8a9f..511fff568f 100644 --- a/packages/core/src/actions/sendTransaction.test-d.ts +++ b/packages/core/src/actions/sendTransaction.test-d.ts @@ -2,7 +2,7 @@ import { http, parseEther } from 'viem' import { celo, mainnet } from 'viem/chains' import { expectTypeOf, test } from 'vitest' -import { createConfig } from '../config.js' +import { createConfig } from '../createConfig.js' import { prepareSendTransaction } from './prepareSendTransaction.js' import { type SendTransactionParameters, diff --git a/packages/core/src/actions/sendTransaction.ts b/packages/core/src/actions/sendTransaction.ts index 51e91741b9..63bba2263a 100644 --- a/packages/core/src/actions/sendTransaction.ts +++ b/packages/core/src/actions/sendTransaction.ts @@ -7,7 +7,7 @@ import type { } from 'viem' import { sendTransaction as viem_sendTransaction } from 'viem/actions' -import type { Config } from '../config.js' +import type { Config } from '../createConfig.js' import type { SelectChains } from '../types/chain.js' import type { ChainIdParameter, diff --git a/packages/core/src/actions/signMessage.ts b/packages/core/src/actions/signMessage.ts index a38e78ae5a..1fc17c02f4 100644 --- a/packages/core/src/actions/signMessage.ts +++ b/packages/core/src/actions/signMessage.ts @@ -4,7 +4,7 @@ import { signMessage as viem_signMessage, } from 'viem/actions' -import { type Config } from '../config.js' +import { type Config } from '../createConfig.js' import type { ConnectorParameter } from '../types/properties.js' import type { Evaluate, Omit } from '../types/utils.js' import { getConnectorClient } from './getConnectorClient.js' diff --git a/packages/core/src/actions/signTypedData.ts b/packages/core/src/actions/signTypedData.ts index 152a01a90d..5ba863bfc3 100644 --- a/packages/core/src/actions/signTypedData.ts +++ b/packages/core/src/actions/signTypedData.ts @@ -5,7 +5,7 @@ import { signTypedData as viem_signTypedData, } from 'viem/actions' -import { type Config } from '../config.js' +import { type Config } from '../createConfig.js' import type { ConnectorParameter } from '../types/properties.js' import { getConnectorClient } from './getConnectorClient.js' diff --git a/packages/core/src/actions/simulateContract.test-d.ts b/packages/core/src/actions/simulateContract.test-d.ts index 860eb50e45..2ee1540cdc 100644 --- a/packages/core/src/actions/simulateContract.test-d.ts +++ b/packages/core/src/actions/simulateContract.test-d.ts @@ -3,7 +3,7 @@ import { http, type Address } from 'viem' import { celo, mainnet } from 'viem/chains' import { expectTypeOf, test } from 'vitest' -import { createConfig } from '../config.js' +import { createConfig } from '../createConfig.js' import { type SimulateContractParameters, type SimulateContractReturnType, diff --git a/packages/core/src/actions/simulateContract.ts b/packages/core/src/actions/simulateContract.ts index 194afe5bbe..faba64c07b 100644 --- a/packages/core/src/actions/simulateContract.ts +++ b/packages/core/src/actions/simulateContract.ts @@ -13,7 +13,7 @@ import { simulateContract as viem_simulateContract, } from 'viem/actions' -import { type Config } from '../config.js' +import { type Config } from '../createConfig.js' import type { SelectChains } from '../types/chain.js' import type { ChainIdParameter, diff --git a/packages/core/src/actions/switchAccount.ts b/packages/core/src/actions/switchAccount.ts index 7666f5cb54..031f45efa4 100644 --- a/packages/core/src/actions/switchAccount.ts +++ b/packages/core/src/actions/switchAccount.ts @@ -1,6 +1,6 @@ import type { Address } from 'viem' -import { type Config, type Connector } from '../config.js' +import { type Config, type Connector } from '../createConfig.js' import { ConnectorNotFoundError } from '../errors/config.js' export type SwitchAccountParameters = { diff --git a/packages/core/src/actions/switchChain.ts b/packages/core/src/actions/switchChain.ts index 2b227aaac5..7b9a70bef4 100644 --- a/packages/core/src/actions/switchChain.ts +++ b/packages/core/src/actions/switchChain.ts @@ -3,7 +3,7 @@ import { UserRejectedRequestError, } from 'viem' -import { type Config } from '../config.js' +import { type Config } from '../createConfig.js' import type { BaseError } from '../errors/base.js' import { ChainNotConfiguredError } from '../errors/config.js' import { SwitchChainNotSupportedError } from '../errors/connector.js' diff --git a/packages/core/src/actions/waitForTransactionReceipt.test-d.ts b/packages/core/src/actions/waitForTransactionReceipt.test-d.ts index e6decbbc46..78510909e8 100644 --- a/packages/core/src/actions/waitForTransactionReceipt.test-d.ts +++ b/packages/core/src/actions/waitForTransactionReceipt.test-d.ts @@ -2,7 +2,7 @@ import { http } from 'viem' import { celo, mainnet } from 'viem/chains' import { expectTypeOf, test } from 'vitest' -import { createConfig } from '../config.js' +import { createConfig } from '../createConfig.js' import { waitForTransactionReceipt } from './waitForTransactionReceipt.js' test('chain formatters', async () => { diff --git a/packages/core/src/actions/waitForTransactionReceipt.ts b/packages/core/src/actions/waitForTransactionReceipt.ts index 410dd9887b..6b301ea722 100644 --- a/packages/core/src/actions/waitForTransactionReceipt.ts +++ b/packages/core/src/actions/waitForTransactionReceipt.ts @@ -11,7 +11,7 @@ import { waitForTransactionReceipt as viem_waitForTransactionReceipt, } from 'viem/actions' -import type { Config } from '../config.js' +import type { Config } from '../createConfig.js' import type { SelectChains } from '../types/chain.js' import type { ChainIdParameter } from '../types/properties.js' import type { Evaluate } from '../types/utils.js' diff --git a/packages/core/src/actions/watchPendingTransactions.ts b/packages/core/src/actions/watchPendingTransactions.ts index 439782f90a..187ca5d231 100644 --- a/packages/core/src/actions/watchPendingTransactions.ts +++ b/packages/core/src/actions/watchPendingTransactions.ts @@ -4,7 +4,7 @@ import { watchPendingTransactions as viem_watchPendingTransactions, } from 'viem/actions' -import type { Config } from '../config.js' +import type { Config } from '../createConfig.js' import type { ChainIdParameter } from '../types/properties.js' import type { Evaluate } from '../types/utils.js' diff --git a/packages/core/src/actions/writeContract.test-d.ts b/packages/core/src/actions/writeContract.test-d.ts index e0d18676b6..bc66d28635 100644 --- a/packages/core/src/actions/writeContract.test-d.ts +++ b/packages/core/src/actions/writeContract.test-d.ts @@ -3,7 +3,7 @@ import { http, type Address } from 'viem' import { celo, mainnet } from 'viem/chains' import { expectTypeOf, test } from 'vitest' -import { createConfig } from '../config.js' +import { createConfig } from '../createConfig.js' import { simulateContract } from './simulateContract.js' import { type WriteContractParameters, writeContract } from './writeContract.js' diff --git a/packages/core/src/actions/writeContract.ts b/packages/core/src/actions/writeContract.ts index 523a58138d..ab708b2e27 100644 --- a/packages/core/src/actions/writeContract.ts +++ b/packages/core/src/actions/writeContract.ts @@ -9,7 +9,7 @@ import type { } from 'viem' import { writeContract as viem_writeContract } from 'viem/actions' -import type { Config } from '../config.js' +import type { Config } from '../createConfig.js' import type { SelectChains } from '../types/chain.js' import type { ChainIdParameter, diff --git a/packages/core/src/config.test-d.ts b/packages/core/src/createConfig.test-d.ts similarity index 96% rename from packages/core/src/config.test-d.ts rename to packages/core/src/createConfig.test-d.ts index 1665c209d8..ddcb391b7d 100644 --- a/packages/core/src/config.test-d.ts +++ b/packages/core/src/createConfig.test-d.ts @@ -3,7 +3,7 @@ import { http, createClient } from 'viem' import { mainnet, sepolia } from 'viem/chains' import { expectTypeOf, test } from 'vitest' -import { createConfig } from './config.js' +import { createConfig } from './createConfig.js' test('high-level config', () => { // Create config without needing to import viem modules. diff --git a/packages/core/src/config.test.ts b/packages/core/src/createConfig.test.ts similarity index 88% rename from packages/core/src/config.test.ts rename to packages/core/src/createConfig.test.ts index f0f44714d8..d6f5fc3889 100644 --- a/packages/core/src/config.test.ts +++ b/packages/core/src/createConfig.test.ts @@ -3,7 +3,7 @@ import { http } from 'viem' import { mainnet } from 'viem/chains' import { expect, test } from 'vitest' -import { createConfig } from './config.js' +import { createConfig } from './createConfig.js' test('exports', () => { const config = createConfig({ diff --git a/packages/core/src/config.ts b/packages/core/src/createConfig.ts similarity index 97% rename from packages/core/src/config.ts rename to packages/core/src/createConfig.ts index a5d7f6b766..f6bebe2ea8 100644 --- a/packages/core/src/config.ts +++ b/packages/core/src/createConfig.ts @@ -8,10 +8,13 @@ import { import { persist, subscribeWithSelector } from 'zustand/middleware' import { createStore } from 'zustand/vanilla' -import { type ConnectorEventMap, type CreateConnectorFn } from './connector.js' -import { Emitter, type EventData, createEmitter } from './emitter.js' +import { + type ConnectorEventMap, + type CreateConnectorFn, +} from './createConnector.js' +import { Emitter, type EventData, createEmitter } from './createEmitter.js' +import { type Storage, createStorage, noopStorage } from './createStorage.js' import { ChainNotConfiguredError } from './errors/config.js' -import { type Storage, createStorage, noopStorage } from './storage.js' import type { Evaluate, OneOf } from './types/utils.js' import { uid } from './utils/uid.js' diff --git a/packages/core/src/connector.ts b/packages/core/src/createConnector.ts similarity index 95% rename from packages/core/src/connector.ts rename to packages/core/src/createConnector.ts index e6671efdf5..0651f723e8 100644 --- a/packages/core/src/connector.ts +++ b/packages/core/src/createConnector.ts @@ -6,8 +6,8 @@ import { type ProviderMessage, } from 'viem' -import { Emitter } from './emitter.js' -import { type Storage } from './storage.js' +import { Emitter } from './createEmitter.js' +import { type Storage } from './createStorage.js' import { type Evaluate } from './types/utils.js' export type ConnectorEventMap = { diff --git a/packages/core/src/emitter.ts b/packages/core/src/createEmitter.ts similarity index 100% rename from packages/core/src/emitter.ts rename to packages/core/src/createEmitter.ts diff --git a/packages/core/src/storage.test-d.ts b/packages/core/src/createStorage.test-d.ts similarity index 91% rename from packages/core/src/storage.test-d.ts rename to packages/core/src/createStorage.test-d.ts index eaaa11edd3..8dd2cdf84b 100644 --- a/packages/core/src/storage.test-d.ts +++ b/packages/core/src/createStorage.test-d.ts @@ -1,7 +1,7 @@ import { expectTypeOf, test } from 'vitest' -import { createStorage } from './storage.js' +import { createStorage } from './createStorage.js' -import type { Connection } from './config.js' +import type { Connection } from './createConfig.js' const storage = createStorage({ storage: localStorage }) diff --git a/packages/core/src/storage.test.ts b/packages/core/src/createStorage.test.ts similarity index 96% rename from packages/core/src/storage.test.ts rename to packages/core/src/createStorage.test.ts index a6474cd8c6..06aa0f89d6 100644 --- a/packages/core/src/storage.test.ts +++ b/packages/core/src/createStorage.test.ts @@ -1,6 +1,6 @@ import { expect, test, vi } from 'vitest' -import { createStorage } from './storage.js' +import { createStorage } from './createStorage.js' Object.defineProperty(window, 'localStorage', { value: { diff --git a/packages/core/src/storage.ts b/packages/core/src/createStorage.ts similarity index 97% rename from packages/core/src/storage.ts rename to packages/core/src/createStorage.ts index 8ec01edc7d..b2c11e808f 100644 --- a/packages/core/src/storage.ts +++ b/packages/core/src/createStorage.ts @@ -1,4 +1,4 @@ -import { type PartializedState } from './config.js' +import { type PartializedState } from './createConfig.js' import { deserialize as deserialize_ } from './utils/deserialize.js' import { serialize as serialize_ } from './utils/serialize.js' diff --git a/packages/core/src/errors/connector.ts b/packages/core/src/errors/connector.ts index 411d48ee20..5010f52273 100644 --- a/packages/core/src/errors/connector.ts +++ b/packages/core/src/errors/connector.ts @@ -1,4 +1,4 @@ -import type { Connector } from '../config.js' +import type { Connector } from '../createConfig.js' import { BaseError } from './base.js' export class ProviderNotFoundError extends BaseError { diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index c7cfa7491e..d353cf7c08 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -214,7 +214,7 @@ export { } from './actions/writeContract.js' //////////////////////////////////////////////////////////////////////////////// -// Config +// createConfig export { type Connection, @@ -223,16 +223,27 @@ export { type CreateConfigParameters, type State, createConfig, -} from './config.js' +} from './createConfig.js' //////////////////////////////////////////////////////////////////////////////// -// Connector +// createConnector export { type ConnectorEventMap, type CreateConnectorFn, createConnector, -} from './connector.js' +} from './createConnector.js' + +//////////////////////////////////////////////////////////////////////////////// +// createStorage + +export { + type CreateStorageParameters, + type Storage, + type StorageItemMap, + createStorage, + noopStorage, +} from './createStorage.js' //////////////////////////////////////////////////////////////////////////////// // Errors @@ -251,17 +262,6 @@ export { SwitchChainNotSupportedError, } from './errors/connector.js' -//////////////////////////////////////////////////////////////////////////////// -// Storage - -export { - type CreateStorageParameters, - type Storage, - type StorageItemMap, - createStorage, - noopStorage, -} from './storage.js' - //////////////////////////////////////////////////////////////////////////////// // Types diff --git a/packages/core/src/internal.ts b/packages/core/src/internal.ts index bbabc3aa1d..85b2771790 100644 --- a/packages/core/src/internal.ts +++ b/packages/core/src/internal.ts @@ -5,7 +5,7 @@ export { type EventData, Emitter, createEmitter, -} from './emitter.js' +} from './createEmitter.js' //////////////////////////////////////////////////////////////////////////////// // Types diff --git a/packages/core/src/query/connect.ts b/packages/core/src/query/connect.ts index 3b9c2cc71d..a6e1f82c7e 100644 --- a/packages/core/src/query/connect.ts +++ b/packages/core/src/query/connect.ts @@ -6,7 +6,7 @@ import { type ConnectReturnType, connect, } from '../actions/connect.js' -import { type Config } from '../config.js' +import { type Config } from '../createConfig.js' import type { Mutate, MutateAsync } from './types.js' diff --git a/packages/core/src/query/disconnect.ts b/packages/core/src/query/disconnect.ts index b15f2efdd0..74aed5a1f5 100644 --- a/packages/core/src/query/disconnect.ts +++ b/packages/core/src/query/disconnect.ts @@ -6,7 +6,7 @@ import { type DisconnectReturnType, disconnect, } from '../actions/disconnect.js' -import type { Config } from '../config.js' +import type { Config } from '../createConfig.js' import type { Mutate, MutateAsync } from './types.js' export function disconnectMutationOptions( diff --git a/packages/core/src/query/getBalance.ts b/packages/core/src/query/getBalance.ts index 066efba1e7..47be6f84b0 100644 --- a/packages/core/src/query/getBalance.ts +++ b/packages/core/src/query/getBalance.ts @@ -6,7 +6,7 @@ import { type GetBalanceReturnType, getBalance, } from '../actions/getBalance.js' -import type { Config } from '../config.js' +import type { Config } from '../createConfig.js' import type { Evaluate, PartialBy } from '../types/utils.js' import type { ScopeKeyParameter } from './types.js' import { filterQueryOptions } from './utils.js' diff --git a/packages/core/src/query/getBlockNumber.ts b/packages/core/src/query/getBlockNumber.ts index ed53c98558..a5a2b81021 100644 --- a/packages/core/src/query/getBlockNumber.ts +++ b/packages/core/src/query/getBlockNumber.ts @@ -6,7 +6,7 @@ import { type GetBlockNumberReturnType, getBlockNumber, } from '../actions/getBlockNumber.js' -import type { Config } from '../config.js' +import type { Config } from '../createConfig.js' import type { Evaluate, ExactPartial } from '../types/utils.js' import type { ScopeKeyParameter } from './types.js' import { filterQueryOptions } from './utils.js' diff --git a/packages/core/src/query/getConnectorClient.ts b/packages/core/src/query/getConnectorClient.ts index d6cbe21e1e..4d83a2bf78 100644 --- a/packages/core/src/query/getConnectorClient.ts +++ b/packages/core/src/query/getConnectorClient.ts @@ -6,7 +6,7 @@ import { type GetConnectorClientReturnType, getConnectorClient, } from '../actions/getConnectorClient.js' -import type { Config } from '../config.js' +import type { Config } from '../createConfig.js' import type { Evaluate, ExactPartial } from '../types/utils.js' import type { ScopeKeyParameter } from './types.js' import { filterQueryOptions } from './utils.js' diff --git a/packages/core/src/query/getEnsAddress.ts b/packages/core/src/query/getEnsAddress.ts index 0ac253663d..14b5ca1124 100644 --- a/packages/core/src/query/getEnsAddress.ts +++ b/packages/core/src/query/getEnsAddress.ts @@ -6,7 +6,7 @@ import { type GetEnsAddressReturnType, getEnsAddress, } from '../actions/getEnsAddress.js' -import type { Config } from '../config.js' +import type { Config } from '../createConfig.js' import type { Evaluate, ExactPartial } from '../types/utils.js' import type { ScopeKeyParameter } from './types.js' import { filterQueryOptions } from './utils.js' diff --git a/packages/core/src/query/getEnsAvatar.ts b/packages/core/src/query/getEnsAvatar.ts index e8f89fde3c..281d17331f 100644 --- a/packages/core/src/query/getEnsAvatar.ts +++ b/packages/core/src/query/getEnsAvatar.ts @@ -6,7 +6,7 @@ import { type GetEnsAvatarReturnType, getEnsAvatar, } from '../actions/getEnsAvatar.js' -import type { Config } from '../config.js' +import type { Config } from '../createConfig.js' import type { Evaluate, ExactPartial } from '../types/utils.js' import type { ScopeKeyParameter } from './types.js' import { filterQueryOptions } from './utils.js' diff --git a/packages/core/src/query/getEnsName.ts b/packages/core/src/query/getEnsName.ts index dc65549133..f7946f55bb 100644 --- a/packages/core/src/query/getEnsName.ts +++ b/packages/core/src/query/getEnsName.ts @@ -6,7 +6,7 @@ import { type GetEnsNameReturnType, getEnsName, } from '../actions/getEnsName.js' -import type { Config } from '../config.js' +import type { Config } from '../createConfig.js' import type { Evaluate, ExactPartial } from '../types/utils.js' import type { ScopeKeyParameter } from './types.js' import { filterQueryOptions } from './utils.js' diff --git a/packages/core/src/query/getEnsResolver.ts b/packages/core/src/query/getEnsResolver.ts index aa4ba3c044..cdf984660b 100644 --- a/packages/core/src/query/getEnsResolver.ts +++ b/packages/core/src/query/getEnsResolver.ts @@ -6,7 +6,7 @@ import { type GetEnsResolverReturnType, getEnsResolver, } from '../actions/getEnsResolver.js' -import type { Config } from '../config.js' +import type { Config } from '../createConfig.js' import type { Evaluate, ExactPartial } from '../types/utils.js' import type { ScopeKeyParameter } from './types.js' import { filterQueryOptions } from './utils.js' diff --git a/packages/core/src/query/getFeeData.ts b/packages/core/src/query/getFeeData.ts index bf9dd770df..c4b900c564 100644 --- a/packages/core/src/query/getFeeData.ts +++ b/packages/core/src/query/getFeeData.ts @@ -6,7 +6,7 @@ import { type GetFeeDataReturnType, getFeeData, } from '../actions/getFeeData.js' -import type { Config } from '../config.js' +import type { Config } from '../createConfig.js' import type { Evaluate, ExactPartial } from '../types/utils.js' import type { ScopeKeyParameter } from './types.js' import { filterQueryOptions } from './utils.js' diff --git a/packages/core/src/query/getToken.ts b/packages/core/src/query/getToken.ts index c03f17d7b4..dbf06061fa 100644 --- a/packages/core/src/query/getToken.ts +++ b/packages/core/src/query/getToken.ts @@ -6,7 +6,7 @@ import { type GetTokenReturnType, getToken, } from '../actions/getToken.js' -import type { Config } from '../config.js' +import type { Config } from '../createConfig.js' import type { Evaluate, ExactPartial } from '../types/utils.js' import type { ScopeKeyParameter } from './types.js' import { filterQueryOptions } from './utils.js' diff --git a/packages/core/src/query/getTransaction.ts b/packages/core/src/query/getTransaction.ts index a020234fe2..e6ef4459d4 100644 --- a/packages/core/src/query/getTransaction.ts +++ b/packages/core/src/query/getTransaction.ts @@ -6,7 +6,7 @@ import { type GetTransactionReturnType, getTransaction, } from '../actions/getTransaction.js' -import type { Config } from '../config.js' +import type { Config } from '../createConfig.js' import type { Evaluate, ExactPartial } from '../types/utils.js' import type { ScopeKeyParameter } from './types.js' import { filterQueryOptions } from './utils.js' diff --git a/packages/core/src/query/prepareSendTransaction.ts b/packages/core/src/query/prepareSendTransaction.ts index 977537c060..e7c07b15f1 100644 --- a/packages/core/src/query/prepareSendTransaction.ts +++ b/packages/core/src/query/prepareSendTransaction.ts @@ -6,7 +6,7 @@ import { type PrepareSendTransactionReturnType, prepareSendTransaction, } from '../actions/prepareSendTransaction.js' -import type { Config } from '../config.js' +import type { Config } from '../createConfig.js' import type { UnionPartialBy } from '../types/utils.js' import type { ScopeKeyParameter } from './types.js' import { filterQueryOptions } from './utils.js' diff --git a/packages/core/src/query/readContract.ts b/packages/core/src/query/readContract.ts index 5944599a1a..3914a57434 100644 --- a/packages/core/src/query/readContract.ts +++ b/packages/core/src/query/readContract.ts @@ -11,7 +11,7 @@ import { type ReadContractReturnType, readContract, } from '../actions/readContract.js' -import type { Config } from '../config.js' +import type { Config } from '../createConfig.js' import type { UnionPartial } from '../types/utils.js' import type { ScopeKeyParameter } from './types.js' import { filterQueryOptions } from './utils.js' diff --git a/packages/core/src/query/readContracts.ts b/packages/core/src/query/readContracts.ts index 86485a1cdf..181aac6ca7 100644 --- a/packages/core/src/query/readContracts.ts +++ b/packages/core/src/query/readContracts.ts @@ -9,7 +9,7 @@ import { type ReadContractsReturnType, readContracts, } from '../actions/readContracts.js' -import type { Config } from '../config.js' +import type { Config } from '../createConfig.js' import type { ChainIdParameter } from '../types/properties.js' import type { ExactPartial } from '../types/utils.js' import type { ScopeKeyParameter } from './types.js' diff --git a/packages/core/src/query/reconnect.ts b/packages/core/src/query/reconnect.ts index 8b42975ac7..34f98ca58c 100644 --- a/packages/core/src/query/reconnect.ts +++ b/packages/core/src/query/reconnect.ts @@ -6,7 +6,7 @@ import { type ReconnectReturnType, reconnect, } from '../actions/reconnect.js' -import type { Config } from '../config.js' +import type { Config } from '../createConfig.js' import type { Evaluate } from '../types/utils.js' import type { Mutate, MutateAsync } from './types.js' diff --git a/packages/core/src/query/sendTransaction.ts b/packages/core/src/query/sendTransaction.ts index 3c37c5375e..df58ebd227 100644 --- a/packages/core/src/query/sendTransaction.ts +++ b/packages/core/src/query/sendTransaction.ts @@ -6,7 +6,7 @@ import { type SendTransactionReturnType, sendTransaction, } from '../actions/sendTransaction.js' -import { type Config } from '../config.js' +import { type Config } from '../createConfig.js' import type { Evaluate } from '../types/utils.js' export function sendTransactionMutationOptions( diff --git a/packages/core/src/query/signMessage.ts b/packages/core/src/query/signMessage.ts index 144392ec2a..c8cce1cb2c 100644 --- a/packages/core/src/query/signMessage.ts +++ b/packages/core/src/query/signMessage.ts @@ -6,7 +6,7 @@ import { type SignMessageReturnType, signMessage, } from '../actions/signMessage.js' -import { type Config } from '../config.js' +import { type Config } from '../createConfig.js' import { type Evaluate } from '../types/utils.js' import { type Mutate, type MutateAsync } from './types.js' diff --git a/packages/core/src/query/signTypedData.ts b/packages/core/src/query/signTypedData.ts index 997fe5a3c0..60f8bd2cd2 100644 --- a/packages/core/src/query/signTypedData.ts +++ b/packages/core/src/query/signTypedData.ts @@ -7,7 +7,7 @@ import { type SignTypedDataReturnType, signTypedData, } from '../actions/signTypedData.js' -import { type Config } from '../config.js' +import { type Config } from '../createConfig.js' import type { Evaluate } from '../types/utils.js' export function signTypedDataMutationOptions( diff --git a/packages/core/src/query/simulateContract.test-d.ts b/packages/core/src/query/simulateContract.test-d.ts index d0654161eb..348dc2f9c0 100644 --- a/packages/core/src/query/simulateContract.test-d.ts +++ b/packages/core/src/query/simulateContract.test-d.ts @@ -3,7 +3,7 @@ import { http, type Address } from 'viem' import { celo, mainnet } from 'viem/chains' import { expectTypeOf, test } from 'vitest' -import { createConfig } from '../config.js' +import { createConfig } from '../createConfig.js' import { type SimulateContractOptions, simulateContractQueryOptions, diff --git a/packages/core/src/query/simulateContract.ts b/packages/core/src/query/simulateContract.ts index ce29652325..daf16b24a1 100644 --- a/packages/core/src/query/simulateContract.ts +++ b/packages/core/src/query/simulateContract.ts @@ -7,7 +7,7 @@ import { type SimulateContractReturnType, simulateContract, } from '../actions/simulateContract.js' -import type { Config } from '../config.js' +import type { Config } from '../createConfig.js' import type { UnionPartial } from '../types/utils.js' import type { ScopeKeyParameter } from './types.js' import { filterQueryOptions } from './utils.js' diff --git a/packages/core/src/query/switchAccount.ts b/packages/core/src/query/switchAccount.ts index 798c9d3d4c..bc01d1feb9 100644 --- a/packages/core/src/query/switchAccount.ts +++ b/packages/core/src/query/switchAccount.ts @@ -6,7 +6,7 @@ import { type SwitchAccountReturnType, switchAccount, } from '../actions/switchAccount.js' -import { type Config } from '../config.js' +import { type Config } from '../createConfig.js' import type { Evaluate } from '../types/utils.js' import type { Mutate, MutateAsync } from './types.js' diff --git a/packages/core/src/query/switchChain.ts b/packages/core/src/query/switchChain.ts index 39fbbe164e..9cd7ff6a8b 100644 --- a/packages/core/src/query/switchChain.ts +++ b/packages/core/src/query/switchChain.ts @@ -6,7 +6,7 @@ import { type SwitchChainReturnType, switchChain, } from '../actions/switchChain.js' -import { type Config } from '../config.js' +import { type Config } from '../createConfig.js' import type { Evaluate } from '../types/utils.js' export function switchChainMutationOptions( diff --git a/packages/core/src/query/waitForTransactionReceipt.ts b/packages/core/src/query/waitForTransactionReceipt.ts index 390649ecb2..fddd552025 100644 --- a/packages/core/src/query/waitForTransactionReceipt.ts +++ b/packages/core/src/query/waitForTransactionReceipt.ts @@ -6,7 +6,7 @@ import { type WaitForTransactionReceiptReturnType, waitForTransactionReceipt, } from '../actions/waitForTransactionReceipt.js' -import type { Config } from '../config.js' +import type { Config } from '../createConfig.js' import type { Evaluate, ExactPartial } from '../types/utils.js' import type { ScopeKeyParameter } from './types.js' import { filterQueryOptions } from './utils.js' diff --git a/packages/core/src/query/writeContract.ts b/packages/core/src/query/writeContract.ts index 36b651ea11..8c655fc73d 100644 --- a/packages/core/src/query/writeContract.ts +++ b/packages/core/src/query/writeContract.ts @@ -7,7 +7,7 @@ import { type WriteContractReturnType, writeContract, } from '../actions/writeContract.js' -import { type Config } from '../config.js' +import { type Config } from '../createConfig.js' import type { Evaluate } from '../types/utils.js' export function writeContractMutationOptions( diff --git a/packages/core/src/types/chain.test-d.ts b/packages/core/src/types/chain.test-d.ts index 76e4ee588f..65632709e1 100644 --- a/packages/core/src/types/chain.test-d.ts +++ b/packages/core/src/types/chain.test-d.ts @@ -1,7 +1,7 @@ import type { Chain, mainnet, optimism, sepolia } from 'viem/chains' import { expectTypeOf, test } from 'vitest' -import type { Config } from '../config.js' +import type { Config } from '../createConfig.js' import type { SelectChains } from './chain.js' import type { Merge } from './utils.js' diff --git a/packages/core/src/types/chain.ts b/packages/core/src/types/chain.ts index f2bde99d29..1d968d0796 100644 --- a/packages/core/src/types/chain.ts +++ b/packages/core/src/types/chain.ts @@ -1,6 +1,6 @@ import type { Chain, ChainFormatters } from 'viem' -import type { Config } from '../config.js' +import type { Config } from '../createConfig.js' import type { IsNarrowable, Merge } from './utils.js' /** Filters {@link Config} chains by {@link chainId} or simplifies if no `ChainFormatters` are present. */ diff --git a/packages/core/src/types/properties.ts b/packages/core/src/types/properties.ts index 876bbae2dd..23067409a6 100644 --- a/packages/core/src/types/properties.ts +++ b/packages/core/src/types/properties.ts @@ -1,4 +1,4 @@ -import type { Config, Connector } from '../config.js' +import type { Config, Connector } from '../createConfig.js' export type ChainIdParameter< config extends Config, diff --git a/packages/core/src/types/register.ts b/packages/core/src/types/register.ts index 85efa8ebce..996c7569ac 100644 --- a/packages/core/src/types/register.ts +++ b/packages/core/src/types/register.ts @@ -1,4 +1,4 @@ -import type { Config } from '../config.js' +import type { Config } from '../createConfig.js' // rome-ignore lint/suspicious/noEmptyInterface: For extending global type export interface Register {} diff --git a/packages/core/src/utils/assertActiveChain.ts b/packages/core/src/utils/assertActiveChain.ts index 06ebbab568..3c29ea4bf5 100644 --- a/packages/core/src/utils/assertActiveChain.ts +++ b/packages/core/src/utils/assertActiveChain.ts @@ -1,5 +1,5 @@ import { getChainId } from '../actions/getChainId.js' -import type { Config } from '../config.js' +import type { Config } from '../createConfig.js' import { ChainMismatchError } from '../errors/config.js' type AssertActiveChainParamters = {