connectNetwork
Connects to the Solana network through an RPC endpoint
Parameters:
network (optional, default: default RPC network): string - the RPC URL to use for the connection
commitment (optional, default:
"confirmed"
): string - the commitment to use for the connection
Networks:
For more information on networks, see networks.
Returns:
object ({"network": "...", "commitment": "..."}
) - the connection details
network: string (
"
https://solana-api.projectserum.com
"
) - the RPC URL used for the connectioncommitment: string (
"confirmed"
) - the commitment used for the connection
Throws:
SOL Pay SDK Fatal Error: Invalid network ${network}.
- network not specified or unable to connect to the network
Last updated