This project is a Express.js backend that powers a Sherry Trigger for swapping AVAX to PNG tokens on the Avalanche network. It serves as an example of how to integrate with the Pangolin Exchange protocol to create an interactive Web3 experience inside the Sherry ecosystem.
- Renders metadata for the Sherry Trigger to display a simple UI
- Provides pre-configured actions to buy PNG with preset AVAX amounts
- Supports custom AVAX input from the user to define a flexible swap
- Serializes a transaction to interact with the Pangolin protocol v2 via Pangolin SDK
- Enables Sherry to execute swaps through blockchain-compatible actions
- Express.js (API)
- TypeScript
- Viem for chain data and transaction signing
- @sherrylinks/sdk for metadata structure and parameter helpers
The trigger exposes:
GET /api/buy-png: returns metadata with multiple swap actions (0.1, 0.5, 1 AVAX + custom input)POST /api/buy-png: receives parameters and returns a serialized transaction ready for submission
- Node.js 18+
- pnpm
-
Clone and install dependencies:
git clone https://github.com/SherryLabs/sherry-mini-app-examples.git cd swap-with-pangolin pnpm install -
Configure environment variables:
cp .env.example .env
-
Run the development server:
pnpm dev
MIT License.