svelte-example-blink Svelte Themes

Svelte Example Blink

A simple Solana Blink example built with Svelte

Solana Blink Donation Example

This project allows users to donate SOL to MiladyBuilder via a web interface. It includes two main endpoints: GET and POST, which handle donation actions.

Overview

This project provides a simple way for users to donate SOL to MiladyBuilder using the Solana blockchain. It handles both the creation of donation actions and the proceessing of transactions.

Getting Started

First, run the development server:

npm run dev

Build the project for Vercel:

npm run build

Usage

To use this project, make GET and POST requests to the respective endpoints.

API Endpoints

GET

Description: Returns a JSON payload containing donation action details.

Endpoint: /api/donate

Method: GET

Response:

{
    "icon": "icon_url",
    "title": "Donate to MiladyBuilder",
    "description": "Support MiladyBuilder by donating SOL.",
    "label": "Donate",
    "links": {
        "actions": [
            {
                "label": "Donate 0.1 SOL",
                "href": "http://yourdomain.com/api/donate?amount=0.1"
            }
        ]
    }
}

POST

Description: Processes a donation transaction on the Solana blockchain.

Endpoint: /api/donate

Method: POST

Body:

{
    "account": "public_key"
}

Response:

{
    "fields": {
        "transaction": "SerializedTransaction",
        "message": "Message"
    }
}

Top categories

Loading Svelte Themes