Skip to main content
Particle Network uses its Wallet Abstraction stack to simplify onboarding into both EOAs and ERC-4337 smart accounts. Particle gives you an aggregated modal with social logins and wallet adapters, such as MetaMask. The modal is fully compatible with Sei and supports 2-click onboarding. The Particle Connect user flow starts with social login. Users log in with custom authentication or with predefined options from the platform, such as email, Google, or X. This process uses MPC-TSS to generate an EOA. The EOA can then be the signer for a smart account. You can use a smart account implementation such as SimpleAccount or Biconomy (V1 or V2), depending on the requirements of your dApp. This guide gives a high-level overview of how to build a demo dApp on Sei. The demo uses the Particle Connect SDK, Particle’s onboarding solution. It implements the modal described above for social logins and wallet connection. It also uses account abstraction to send a gasless transaction. In this guide, you build a demo dApp that:
  1. Uses a SimpleAccount instance of a smart account to onboard users through social login.
  2. Executes a gasless (sponsored) transaction. This shows how the SDK simplifies user interactions on Sei.

Getting started

Dependencies

To integrate Particle Connect into your Sei dApp, you need only a few dependencies. Particle Connect has built-in support for account abstraction (AA). However, this example uses the Particle AA SDK with an EIP-1193 provider, such as ethers.js.

Setting up the Particle dashboard

Before you start the configuration, go to the Particle dashboard to get the three keys that your project requires. When you use any SDK from Particle Network, you routinely need a projectId, a clientKey, and an appId. These keys authenticate your project. They also connect your instance of Particle Auth to the Particle dashboard. In the dashboard, you can customize the modals embedded in your dApp, track users, and fund gasless transactions, among other tasks. In the Particle dashboard, follow these steps:
  1. Create a new project through Add New Project.
  2. Under Your Apps, click Web. If you intend to use a different platform, see the platform-specific guides in the Particle documentation.
  3. Choose a name and a domain for your dApp. If you have not deployed yet, or you have not decided where to deploy, you can use any placeholder domain.
  4. Copy the Project ID, Client Key, and App ID.
Because these values authenticate your project, store them in a .env file with this format:

Configuring Particle Connect

First, configure and initialize Particle Connect. Create a new ConnectKit.tsx file in your src directory. This file defines the ParticleConnectKit component, which wraps the configured ConnectKitProvider instance. This component manages the Particle Connect configuration and makes it available across your dApp.
This code configures Particle Connect for wallet authentication and blockchain interactions on Sei Mainnet and Sei Testnet. It includes social logins and traditional Web3 options through WalletConnect. It also enables account abstraction (AA) with a SimpleAccount instance, version 2.0.0. The configured ConnectKitProvider component then wraps the content of your dApp and makes this configuration available to it.

Integrate Particle Connect in your app

After you configure Particle Connect, wrap your dApp with the ParticleConnectKit component. This makes the Particle Connect SDK available throughout the dApp. Update the layout.tsx file in the src directory with this code:

Building the application

With your project set up, the dependencies installed, and Particle Connect configured, you can start to build in the page.tsx file. In page.tsx, you define the core features: the login flow, transaction handling, and the UI.

Connecting the wallet

After you configure layout.tsx, add a primary Connect Wallet button so that users can log in. Import ConnectButton from @particle-network/connectkit. Then add it to the interface. When a user clicks the ConnectButton component to log in, it opens a unified login modal. You can see an example of this modal in the Particle demo.

Sending transactions with an EIP-1193 provider

Particle Connect has built-in AA features. If you also use the Particle AA SDK, you can work with EIP-1193 providers, such as ethers. This approach is especially helpful if you already know these providers or you are integrating Particle Connect into an existing dApp. To do this, wrap the smart account from Particle Connect in an instance of ethers to create a customProvider. You can then use ethers as usual. The smart account signs the transactions in the background.
This transaction is gasless because it meets two conditions:
  1. Gasless mode configuration: The code sets SendTransactionMode.Gasless in AAWrapProvider. This setting specifies that the transaction should be gasless and sponsored.
  2. Funding requirements: On Sei Testnet, all transactions are sponsored automatically, so you do not need to deposit funds to pay transaction fees. On Sei Mainnet, however, the paymaster needs sufficient funds to sponsor these transactions. You can configure the paymaster in the Particle dashboard.
This example shows how to use an existing EIP-1193 provider. You can also build a userOp directly with Particle Connect. For an example, see the starter repository.

Full app example

With the setup complete, you can use Particle Connect as this example dApp shows. In this example, the dApp uses a social login or a Web3 login to create a smart account on Sei. Then it sends a gasless transaction of 0.001 SEI through the ethers provider.

Available Particle Connect hooks

This example shows a basic use of Particle Connect. For the complete list of available hooks, see the Particle Connect documentation.

Conclusion

A Sei dApp that uses both social logins and smart accounts needs only a few lines of code. If you already use ethers, Web3.js, or another standard library that supports EIP-1193 providers, the code is even shorter. To see the complete demo dApp that uses the code snippets in this guide, go to the GitHub repository. To learn more about Particle Network, see these resources: