SimpleAccount or Biconomy (V1/V2), depending on the application’s
requirements.
This guide provides a high-level overview of the steps required to build a demo
application on Sei using the
Particle Connect SDK,
Particle’s leading onboarding solution. We’ll implement the aforementioned
modal, enabling social logins and wallet connection, while also using account
abstraction to send a gasless transaction.
Thus, the demo application we’ll build will:
- Use a SimpleAccount instance of a smart account to onboard users via social login.
- Execute a gasless (sponsored) transaction, showcasing the SDK’s capability to simplify user interactions on the Sei blockchain.
Getting started
Dependencies
To integrate Particle Connect into your Sei application, you’ll need just a few dependencies. While Particle Connect includes built-in support for Account Abstraction (AA), this example demonstrates using the Particle AA SDK alongside an EIP-1193 provider, such as ethers.js.Setting up the Particle dashboard
Before jumping into the configuration process, you’ll need to go to the Particle dashboard to retrieve three keys required for your project. When using any SDK offered by Particle Network, you’ll routinely need aprojectId, clientKey, and appId. These exist to authenticate your project
and create a connection between your instance of Particle Auth and the Particle
dashboard (which allows you to customize the application-embedded modals, track
users, fund gasless transactions, and so on).
Once you’ve navigated to the Particle dashboard, follow the process below:
- Create a new project through Add New Project.
- Click Web under Your Apps (if you intend to use an alternative platform, take a look at the platform-specific guides on Particle’s documentation)
- Choose a name and domain for your application (if you have yet to deploy or decide on a domain where you intend to deploy, feel free to use any filler one).
- Copy the Project ID, Client Key and App ID.
.env file with this format:
Configuring Particle Connect
To get started, we’ll configure and initialize Particle Connect. Begin by creating a newConnectKit.tsx file in your src directory.
This file will define the ParticleConnectKit component, which wraps the
configured ConnectKitProvider instance. This component will be the central hub
for managing and providing Particle Connect configuration across your
application.
SimpleAccount instance version 2.0.0. The
configured ConnectKitProvider component then wraps the app’s content, making
this configuration available.
Integrate Particle Connect in Your App
Once configured, wrap your application with theParticleConnectKit component
to make the Particle Connect SDK accessible throughout the app. Update the
layout.tsx file in the src directory as shown below:
Building the Application
With your project set up, dependencies installed, and Particle Connect configured, you can start building in thepage.tsx file.
In page.tsx, you’ll define the core features: login flow, transaction
handling, and the UI.
Connecting the Wallet
Withlayout.tsx configured, the next step is to add a primary Connect
Wallet button to facilitate user login. Import ConnectButton from
@particle-network/connectkit and add it to the interface. After the user logs
in, the ConnectButton component will throw a unified login modal upon
clicking, an example of this modal is viewable
here.
Sending Transactions with an EIP-1193 Provider
Particle Connect includes AA features out of the box, but using it with the Particle AA SDK allows you to work with EIP-1193 providers, likeethers. This
approach is especially helpful if you’re already familiar with these providers
or are integrating Particle Connect into an existing app.
To implement this, wrap the smart account provided by Particle Connect in an
instance of ethers to create a customProvider. With this setup, you can use
ethers as usual, with the smart account handling the signing of transactions
in the background.
- Gasless Mode Configuration: By setting
SendTransactionMode.GaslesswithinAAWrapProvider, we’ve specified that the transaction should be gasless and sponsored. - Funding Requirements: On Sei testnet, all transactions are automatically sponsored, meaning you don’t need to deposit funds to cover transaction fees. However, on Sei mainnet, the Paymaster (configurable in the Particle dashboard) would need sufficient funds to sponsor these transactions.
userOp directly with Particle Connect. For an example, refer
to the
starter repository.
Full app example
With the setup complete, Particle Connect can now be leveraged, as demonstrated in the example application below. In this example, the application creates a smart account on Sei using a social login or a Web3 login and sends a gasless transaction of 0.001 SEI via theethers provider.