This tutorial demonstrates how to integrate Particle Network's Universal Accounts into your dApp.
-
Wallet Connection
- Connect with MetaMask
- Handle wallet state and events
-
Universal Account Creation
- Initialize Universal Account with user's EOA
- Configure account settings
-
Account Information
- View EVM address
- View Solana address
- Check account unified balance
-
Cross-Chain Transactions
- Execute a simple BNB purchase
- Handle transaction states and errors
- View transaction details
-
Install dependencies:
npm install # or yarn
-
Configure environment variables: Create a
.env.local
file:NEXT_PUBLIC_UA_PROJECT_ID=your_project_id
-
Run the development server:
npm run dev # or yarn dev
-
Connect Wallet
- The app starts by requesting MetaMask connection
- User's EOA address is captured and displayed
-
Initialize Universal Account
- A Universal Account instance is created using the connected wallet
- Account configuration is set up
-
View Account Information
- The app fetches and displays both EVM and Solana account addresses
- Account balances are retrieved and shown
-
Execute Transactions
- Users can initiate a simple BNB purchase
- Transaction progress and results are clearly displayed
Check the guide on the Particle Docs.