Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rkmonarch/blinks-example
https://github.com/rkmonarch/blinks-example
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/rkmonarch/blinks-example
- Owner: rkmonarch
- Created: 2024-07-24T17:58:38.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-07-24T20:40:21.000Z (5 months ago)
- Last Synced: 2024-10-12T01:32:53.428Z (2 months ago)
- Language: TypeScript
- Homepage: https://blinks-example.vercel.app
- Size: 101 KB
- Stars: 2
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Solana Blinks Example
This project allows users to donate SOL to a specific account via a web interface. It includes two main endpoints: `GET` and `POST`, which handle donation actions.
## Table of Contents
- [Overview](#overview)
- [Installation](#installation)
- [Usage](#usage)
- [API Endpoints](#api-endpoints)
- [GET](#get)
- [POST](#post)
- [License](#license)## Overview
This project provides a simple way for users to donate SOL to a predefined account using the Solana blockchain. It handles both the creation of donation actions and the processing of transactions.
## Installation
1. Clone the repository:
```bash
git clone https://github.com/rkmonarch/blinks-example.git
cd blinks-example
```2. Install the dependencies:
```bash
pnpm i
```3. Start the development server:
```bash
pnpm run dev
```
## Usage
To use this project, you can 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```tsx
{
"icon": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcS7dPPWr-BRKzBy_Fig0v_snt-_onQj9Pl5xA&s",
"title": "Donate to the Rahul",
"description": "Support rahul 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
##### Request Body:```
{
"account": "SenderPublicKey"
}
```#### Response:
```
{
"fields": {
"transaction": "SerializedTransaction",
"message": "Transaction created"
}
}
```## License
This project is licensed under the MIT License. See the LICENSE file for details.