Prerequisites
Before you begin, ensure you have the following installed:- Node.js 18.x or higher
- pnpm package manager (recommended) or npm
- Git for version control
- A code editor (VS Code recommended)
Clone the repository
Start by cloning the OneBalance Chain-Abstracted Swap repository:Install dependencies
Install all required packages using pnpm:Core dependencies
The project includes these essential dependencies:OneBalance
Chain abstraction and token swapping via API integration
Privy
Web3 authentication and embedded wallet management
Next.js 15
React framework with App Router and TypeScript
TanStack Query
Asynchronous state management for API calls
Project structure
Once installed, your project will have this structure:Development scripts
The following npm scripts are available inpackage.json:
Start the development server
After completing the setup, start the development server:TypeScript configuration
The project uses TypeScript with strict mode enabled. The configuration is defined intsconfig.json:
- Strict mode: Enabled for better type safety
- Path aliases:
@/maps to the root directory for clean imports - JSX: Configured for React 19
Next steps
Now that your development environment is set up:Configure environment variables
Set up your API keys and credentials in the configuration section.
Integrate OneBalance API
Learn how to use the OneBalance API for chain abstraction in the OneBalance API guide.
Set up Privy authentication
Configure Privy for wallet authentication in the Privy wallet guide.