Skip to main content

Connect Nightly

In order to start using Nightly extension, an app needs to establish a connection. Once the connection request is initiated on the application side, it will prompt the user to provide permission to connect to the app with Nightly.


Connect​

After detecting the Nightly provider, you can initiate a connection by calling the standard EIP-1193 method eth_requestAccounts.
This method is also used by most wallets in the EVM ecosystem.

const accounts = await nightly.request({ method: 'eth_requestAccounts' })

The returned value is an array of accounts that the user approved for your DApp. Once connected, you can use the same request method for all subsequent interactions such as signing messages and sending transactions.

Disconnect​

EIP-1193 does not define a standard disconnect method, and most wallets — including Nightly — do not expose a dedicated RPC call for it. Because of this, the recommended approach to handling “disconnect” on the DApp side is:

  • Clear any cached account/address state in your application
  • Stop using the provider instance
  • Update your UI to reflect that the user is no longer connected