The network selection is abstracted from MyAlgo Connect and is instead defined by the transaction parameters. To connect/select a network, simply define the network genesisID and genesisHash that you desire in the transaction’s param field when creating the transaction(s). You may decide to use Algorand public networks (Mainnet, Testnet or Betanet) or use your own custom private network.
Follow this example to create a transaction choosing the Testnet network and send it to MyAlgo Connect to be signed:
import algosdk from "algosdk";import MyAlgoConnect from '@randlabs/myalgo-connect'; const algodClient = new algosdk.Algodv2("",'https://node.testnet.algoexplorerapi.io', ''); const params = await algodClient.getTransactionParams().do(); const txToSigned = algosdk.makePaymentTxnWithSuggestedParams(from, to, amount, undefined, undefined, params); const myAlgoConnect = new MyAlgoConnect(); const txnSignedByTheUser = await myAlgoConnect.signTransaction(txToSigned.toByte());