@1001-digital/layers.evm 1.0.10 → 1.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -36,10 +36,16 @@ export default defineNuxtPlugin({
36
36
  const chainEntries = appConfig.evm?.chains || {}
37
37
 
38
38
  // Build chains and transports from config
39
+ // Ensure defaultChain is first — wagmi uses chains[0] as its default
40
+ const defaultChain = appConfig.evm?.defaultChain || 'mainnet'
41
+ const sortedEntries = Object.entries(chainEntries).sort(([a], [b]) =>
42
+ a === defaultChain ? -1 : b === defaultChain ? 1 : 0,
43
+ )
44
+
39
45
  const chains: [Chain, ...Chain[]] = [] as unknown as [Chain, ...Chain[]]
40
46
  const transports: Record<number, Transport> = {}
41
47
 
42
- for (const [key, entry] of Object.entries(chainEntries)) {
48
+ for (const [key, entry] of sortedEntries) {
43
49
  const chain = resolveChain(entry.id!)
44
50
  chains.push(chain)
45
51
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@1001-digital/layers.evm",
3
3
  "type": "module",
4
- "version": "1.0.10",
4
+ "version": "1.0.11",
5
5
  "main": "./nuxt.config.ts",
6
6
  "devDependencies": {
7
7
  "@nuxt/eslint": "latest",