API Reference

Understand the API

  • Base URL: https://api.emojimarket.xyz
  • GET /ping — health
  • GET /posts — posts list
  • GET /leaderboard — leaderboard
  • GET /settlements/recent — recent settlements
  • GET /settlements/all — all settlement shares
  • GET /settlements/user/:userId — user settlements
  • GET /account — profile (JWT required)
  • POST /api/create-payment-tx — create USDC TX
  • POST /api/verify-payment — verify payment

Authentication ✍🏼

JWT via wallet signature (Phantom / Solflare / Backpack).

Header: Authorization: Bearer <JWT>

Quick testing 🔍

Ping:

curl https://api.emojimarket.xyz/ping

Recent settlements:

curl "https://api.emojimarket.xyz/settlements/recent?limit=10"

Profile (JWT required):

curl -H "Authorization: Bearer <JWT>" https://api.emojimarket.xyz/account

Code examples 💻

fetch (public):

fetch(backend + '/posts').then(r => r.json())

fetch (auth):

fetch(backend + '/account', { headers: { Authorization: 'Bearer ' + JWT } })