If I a have a
Connection object from web3js, is there a way I can determine from this if it is operating on mainnet or devnet (or some local network)? The only thing in this direction I could think of was to check it's
rpcEndpoint property against some known rpc urls for which I know if they are on mainnet or devnet. This is not portable and breaks as soon as someone uses a different endpoint I don't have saved. Is there a general solution for this?
Edit: I'm basically looking for a reverse