diff --git a/packages/networks/src/index.test.ts b/packages/networks/src/index.test.ts index 2b3205a..a4326e7 100644 --- a/packages/networks/src/index.test.ts +++ b/packages/networks/src/index.test.ts @@ -1,4 +1,5 @@ import { describe, it, expect } from 'vitest'; +import * as rootBarrel from './index.js'; import { SUPPORTED_CHAINS, CHAINS, getPublicRpcUrl } from './index.js'; describe('CHAINS / SUPPORTED_CHAINS', () => { @@ -40,6 +41,29 @@ describe('CHAINS / SUPPORTED_CHAINS', () => { }); }); +describe('root barrel viem isolation', () => { + it('does not export wagmi symbols', () => { + expect((rootBarrel as Record)['ethereumWagmi']).toBeUndefined(); + expect((rootBarrel as Record)['baseWagmi']).toBeUndefined(); + expect((rootBarrel as Record)['arbitrumWagmi']).toBeUndefined(); + expect((rootBarrel as Record)['optimismWagmi']).toBeUndefined(); + expect((rootBarrel as Record)['polygonWagmi']).toBeUndefined(); + expect((rootBarrel as Record)['ALL_WAGMI_CHAINS']).toBeUndefined(); + }); + + it('exports the viem-free surface', () => { + expect(rootBarrel.CHAINS).toBeDefined(); + expect(rootBarrel.SUPPORTED_CHAINS).toBeDefined(); + expect(rootBarrel.TOKENS).toBeDefined(); + expect(rootBarrel.SUPPORTED_TOKENS).toBeDefined(); + expect(typeof rootBarrel.getPublicRpcUrl).toBe('function'); + expect(typeof rootBarrel.getChainConfig).toBe('function'); + expect(typeof rootBarrel.tryGetChainConfig).toBe('function'); + expect(typeof rootBarrel.getExplorerTxUrl).toBe('function'); + expect(typeof rootBarrel.getExplorerAddressUrl).toBe('function'); + }); +}); + describe('getPublicRpcUrl', () => { it.each([1, 8453, 42161, 10, 137] as const)( 'returns a non-empty URL for chainId %i', diff --git a/packages/networks/src/index.ts b/packages/networks/src/index.ts index 45109f3..4c5f79f 100644 --- a/packages/networks/src/index.ts +++ b/packages/networks/src/index.ts @@ -3,11 +3,3 @@ export { TOKENS, SUPPORTED_TOKENS, getTokenInfo, type TokenInfo } from './tokens export { getPublicRpcUrl } from './rpc.js'; export { getChainConfig, tryGetChainConfig } from './get-chain.js'; export { getExplorerTxUrl, getExplorerAddressUrl } from './explorer.js'; -export { - ethereumWagmi, - baseWagmi, - arbitrumWagmi, - optimismWagmi, - polygonWagmi, - ALL_WAGMI_CHAINS, -} from './wagmi.js';