Skip to content

switchNetwork ​

switchNetwork(config, network): Promise<void>

Switches the network to the given network.

Import ​

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

Example ​

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

await switchNetwork(config, mainnet);

Parameters ​

NameTypeDescription
configConfigThe configuration object
networkBitcoinNetworkThe network to switch to

Returns ​

Promise<void>

Released under the MIT License