Skip to content

switchNetwork

switchNetwork(config, network): Promise<void>

Switches the network to the given network.

Import

ts
import { switchNetwork } from "@midl-xyz/midl-js-core";

Example

ts
import { switchNetwork, mainnet } from "@midl-xyz/midl-js-core";

await switchNetwork(config, mainnet);

Parameters

NameTypeDescription
configConfigThe configuration object
networkBitcoinNetworkThe network to switch to

Returns

Promise<void>