window.solana.connect(). However, the provider also exposes a
requestJSON RPC interface.
onlyIfTrustedoption into the
connectevent if the application is trusted. If the application is not trusted, Phantom will throw a
4001error and remain disconnected until the user is prompted to connect without an
onlyIfTrustedflag. In either case, Phantom will not open a pop-up window, making this convenient to use on all page loads.