Add cursor and privy provider

This commit is contained in:
2025-03-05 22:40:24 +07:00
parent 9498696d6d
commit ead68573a5
14 changed files with 698 additions and 72 deletions

View File

@@ -148,3 +148,56 @@ Bot types availables :
| ScalpingBot | This bot will open position and wait before opening a new one |
| FlippingBot | The flipping bot flipping the position only when a strategy trigger an opposite signal |
## Privy Integration
This project uses [Privy](https://privy.io/) for wallet authentication and management. Privy provides a seamless authentication experience with support for both embedded wallets and external wallet connections.
### Supported Networks
- Ethereum Mainnet
- Arbitrum One
### Configuration
To use Privy in this project, you need to:
1. Create a Privy account at [https://console.privy.io/](https://console.privy.io/)
2. Create a new app in the Privy dashboard
3. Copy your Privy App ID to the `.env` file:
```
VITE_PRIVY_APP_ID=your-privy-app-id
```
### Features
- **Multi-chain support**: Connect to Ethereum and Arbitrum networks
- **Embedded wallets**: Create and manage wallets directly in the browser
- **Social login**: Authenticate with email, Google, and other providers
- **Seamless integration**: Works with wagmi for blockchain interactions
### Usage
The Privy provider is configured in `src/main.tsx` and can be used throughout the application with the `usePrivy` hook:
```tsx
import { usePrivy } from '@privy-io/react-auth';
function MyComponent() {
const { user, login, logout, authenticated } = usePrivy();
if (!authenticated) {
return <button onClick={login}>Login</button>;
}
return (
<div>
<p>Welcome, {user.email}</p>
<button onClick={logout}>Logout</button>
</div>
);
}
```
For more information, see the [Privy documentation](https://docs.privy.io/).