Routes are prefixed with /api
Endpoint: GET /auth/:telegramId
Description: Retrieves a JWT token for the user.
telegramId
(path) - The Telegram ID of the user.
Responses:
200 OK
- Returns the JWT token.
400 Bad Request
- If something goes wrong.
Endpoint: POST /wagers
Description: Creates a new wager.
title
description
creatorId
opponentId
isPublic
amount
category
currencyId
expires_on
(date) - The expiry date of the wager.
Responses:
201 Created
- Returns the created wager.
400 Bad Request
- If validation fails.
Endpoint: GET /wagers
Description: Retrieves all wagers.
Responses:
200 OK
- Returns a list of wagers.
400 Bad Request
- If something goes wrong.
Endpoint: GET /wagers/:wagerId
Description: Retrieves a wager by its ID.
wagerId
(path) - The ID of the wager.
Responses:
200 OK
- Returns the wager.
400 Bad Request
- If something goes wrong.
Endpoint: PATCH /wagers/:code/join
Description: Joins a wager using a code.
code
(path) - The code of the wager.
Responses:
200 OK
- Returns the joined wager.
400 Bad Request
- If something goes wrong.
Endpoint: GET /wagers/categories
Description: Retrieves all wager categories.
Responses:
200 OK
- Returns a list of wager categories.
Endpoint: GET /wagers/user
Description: Retrieves all wagers for a user.
Responses:
200 OK
- Returns a list of wagers for the user.
400 Bad Request
- If something goes wrong.
Endpoint: POST /wager-template
Description: Creates a new wager template.
title
description
image
creatorId
wagerData
(object) - The wager data.
Responses:
201 Created
- Returns the created template.
400 Bad Request
- If validation fails.
Endpoint: GET /wager-template
Description: Retrieves all wager templates.
Responses:
200 OK
- Returns a list of wager templates.
400 Bad Request
- If something goes wrong.
Endpoint: POST /payments/deposit
Description: Handles a deposit.
amount
asset
(string) - The asset to deposit.
Responses:
201 Created
- Returns the created invoice.
400 Bad Request
- If validation fails.
Endpoint: POST /payments/crypto-bot-webhook
Description: Handles Crypto Bot webhook events.
Responses:
200 OK
- If the webhook is handled successfully.
400 Bad Request
- If something goes wrong.
Endpoint: POST /wallets
Description: Creates a new wallet.
currencyId
(string) - The currency ID.
Responses:
201 Created
- Returns the created wallet.
400 Bad Request
- If validation fails.
Endpoint: GET /wallets
Description: Retrieves all wallets for a user.
Responses:
200 OK
- Returns a list of wallets for the user.
400 Bad Request
- If something goes wrong.
Endpoint: GET /wallets/:currencyId
Description: Retrieves a wallet for a user by currency ID.
currencyId
(path) - The currency ID.
Responses:
200 OK
- Returns the wallet.
400 Bad Request
- If something goes wrong.
Endpoint: POST /result
Description: Creates a new result.
wagerId
winnerId
creatorConfirmed
joinerConfirmed
status
evidenceFiles
evidenceLinks
disputedBy
disputeReason
adminNotes
(string, optional) - The admin notes.
Responses:
201 Created
- Returns the created result.
400 Bad Request
- If validation fails.