A full working example that combines Particle Auth (for social login) with the Universal Accounts SDK. Use it as a tour of the integration surface or fork it as a starting point for your own app.Documentation Index
Fetch the complete documentation index at: https://developers.particle.network/llms.txt
Use this file to discover all available pages before exploring further.
Demo repository
Clone the complete Next.js demo from GitHub.
The Quickstart is a short Node script that verifies the SDK end-to-end in a terminal. This page covers the full browser-side integration — Particle Auth login, React wiring, multiple transaction types.
What the demo shows
The demo is a Next.js app using Particle Auth for login. After the user signs in, the page initializes a Universal Account from their EOA and renders:- The user’s owner EOA, EVM Universal Account address, and Solana Universal Account address.
- A live unified balance across all supported chains.
- Two transaction examples — a payable contract call and a token swap.
provider returned by Particle Auth’s useEthereum() hook. Any other EOA-based provider can be swapped in.
Universal Accounts are standalone smart accounts. To fund yours, transfer assets in — unless you’re logging into a pre-existing UA created through UniversalX or another UA-enabled app.
1. Universal Account initialization
After the user logs in, the app creates a Universal Account instance inside auseEffect. The constructor needs the user’s EOA address and your Particle project credentials:
page.tsx
Initialization in the repo
page.tsx → useEffect watching connected && address2. Addresses and unified balance
The demo fetches the UA’s EVM and Solana addresses withgetSmartAccountOptions() and its unified balance with getPrimaryAssets(). Both are covered in more detail elsewhere:
- Quickstart §3 — minimal balance fetch.
- Build a balance widget — full per-chain breakdown rendered as a React component.
- SDK reference: Addresses — full response shape.
3. Sending transactions
The demo includes two transaction patterns. Both route through the Universal Account and use Particle Auth’sprovider as the signer.
Payable contract call (createUniversalTransaction)
To call an arbitrary contract method — here, a checkIn() function on Base Mainnet that requires 0.0000001 ETH — the demo uses createUniversalTransaction() with transactions and expectTokens:
page.tsx
Even if the user has no ETH on Base, the SDK sources assets from other chains and converts them to satisfy the
expectTokens requirement.Token swap (createBuyTransaction)
To swap into a specific token by USD amount — here, 1 USDT on Arbitrum — the demo uses createBuyTransaction():
page.tsx
Running the demo
- Clone
particle-network/universal-accounts-quickstart. - Create
.env.localwithNEXT_PUBLIC_PROJECT_ID,NEXT_PUBLIC_CLIENT_KEY, andNEXT_PUBLIC_APP_IDfrom the Particle Dashboard. npm install && npm run dev.- Log in via Particle Auth — your UA addresses and balance render automatically.
Next steps
How-to guides
Task-oriented guides — browser wallets, balance widgets, deposit flows.
SDK reference
Full Universal Accounts SDK API surface.
Supported chains
EVM and non-EVM chains supported by Universal Accounts.
Demo repository
Browse the complete code on GitHub.
