Skip to content

Latest commit

 

History

History
110 lines (91 loc) · 1.32 KB

File metadata and controls

110 lines (91 loc) · 1.32 KB

API Specification

Base URL

https://api.stellartip.com

Authentication

JWT Bearer token required for protected endpoints.

Endpoints

Authentication

POST /auth/register

Register a new user.

Request:

{
  "username": "string",
  "email": "string",
  "walletAddress": "string"
}

Response:

{
  "token": "string",
  "user": {
    "id": "string",
    "username": "string",
    "walletAddress": "string"
  }
}

POST /auth/login

Login user.

Request:

{
  "email": "string",
  "password": "string"
}

Users

GET /users/:id

Get user profile.

Response:

{
  "id": "string",
  "username": "string",
  "bio": "string",
  "walletAddress": "string"
}

PUT /users/:id

Update user profile.

Tips

POST /tips

Create a tip.

Request:

{
  "receiverId": "string",
  "amount": "string",
  "currency": "XLM" | "USDC"
}

Response:

{
  "id": "string",
  "transactionHash": "string",
  "status": "pending" | "confirmed"
}

GET /tips?user=:id

Get tips for user.

Response:

{
  "tips": [
    {
      "id": "string",
      "amount": "string",
      "sender": "string",
      "timestamp": "string",
      "transactionHash": "string"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 10,
    "total": 100
  }
}