Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.dynamic.xyz/docs/llms.txt

Use this file to discover all available pages before exploring further.

Summary

This utility function merges two arrays of GenericNetwork 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 or custom SVM 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 mySolNetworks = [
    ...
]

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