Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Buy PNG with AVAX - Trigger

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.

What It Does

  • 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

Tech Stack

  • Express.js (API)
  • TypeScript
  • Viem for chain data and transaction signing
  • @sherrylinks/sdk for metadata structure and parameter helpers

How It Works

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

Installation

Prerequisites

  • Node.js 18+
  • pnpm

Setup Steps

  1. Clone and install dependencies:

    git clone https://github.com/SherryLabs/sherry-mini-app-examples.git
    cd swap-with-pangolin
    pnpm install
  2. Configure environment variables:

    cp .env.example .env
  3. Run the development server:

    pnpm dev

Related Links

License

MIT License.