The Piteas API/SDK Monorepo provides a comprehensive development environment to interact with the Piteas API. It offers two modes of operation: Basic and Advanced, designed to cater to developers of varying needs and expertise.
- Simple interface for quick quotes and swaps.
- Only requires:
- Input token address.
- Output token address.
- Input amount.
- Slippage settings.
- (Optional) Receiver address.
- Full-featured DApp with:
- Wallet connection support.
- Token list integration.
- Balance fetching.
- Approval mechanism for ERC-20 tokens.
- User-friendly interface with enhanced features.
-
Clone the repository:
git clone https://github.com/piteasio/piteas-api-monorepo.git
-
Navigate to the project directory:
cd piteas-api-monorepo
-
Install dependencies:
npm install
-
Start the development server:
npm start
The application will be available at
http://localhost:3000
.
Upon launching the application, you will see two options: Basic Mode and Advanced Mode. Select the desired mode to begin.
- Enter the input token address.
- Enter the output token address.
- Specify the input amount and slippage.
- (Optional) Provide a receiver address.
- Click Get Quote to fetch a swap quote.
- If satisfied, click Swap to execute the transaction.
- Connect your wallet to enable advanced features.
- Use the token list to select input and output tokens or provide addresses manually.
- Fetch balances for a comprehensive overview.
- Enter the input amount, slippage, and receiver address if applicable.
- Approve ERC-20 tokens for swap if required.
- Click Get Quote to view detailed quote information.
- Execute the swap with the Swap button.
The monorepo contains modular components that developers can easily integrate into their own projects:
- SDK/API Integration: Core logic for interacting with the Piteas API.
- UI Components: Flexible components for user interactions.
- Modes: Dynamically loadable modules for Basic and Advanced functionalities.
The Piteas Monorepo interacts with the following API endpoints:
- Active Chain: Pulsechain
- Quote API:
https://sdk.piteas.io/quote
- Token List:
https://raw.githubusercontent.com/piteasio/app-tokens/main/piteas-tokenlist.json
- RPC Provider:
https://rpc.pulsechain.com
Contributions are welcome! Feel free to open issues or submit pull requests to improve this monorepo.
This project is licensed under the MIT License. See the LICENSE file for details.
Happy Coding!