Summary

This utility function merges two arrays of EvmNetwork objects, with the first array taking precedence in case of a conflict. It is imported from @dynamic-labs/sdk-react-core.

Annotation

export declare const mergeNetworks: (priorityNetworks: GenericNetwork[], secondaryNetworks: GenericNetwork[]) => GenericNetwork[];

Example

It is commonly used when you declare custom EVM networks for Dynamic, and you want to merge them with the networks you get from the dashboard configurations:

import { mergeNetworks } from "@dynamic-labs/sdk-react-core";

const myEvmNetworks = [
    ...
]

const DynamicSettings = {
  overrides: {
    evmNetworks: (networks) => mergeNetworks(myEvmNetworks, networks),
  }
};