@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.
- package/app/plugins/wagmi.ts +7 -1
- package/package.json +1 -1
package/app/plugins/wagmi.ts
CHANGED
|
@@ -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
|
|
48
|
+
for (const [key, entry] of sortedEntries) {
|
|
43
49
|
const chain = resolveChain(entry.id!)
|
|
44
50
|
chains.push(chain)
|
|
45
51
|
|