Skip to content

Record the deposit of a prize from FoxLeague

POST
/api/tournaments/{id}/prize/deposit
curl --request POST \
--url https://foxleague.ai/api/tournaments/1/prize/deposit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "tx_hash": "example" }'

Records the deposit transaction of a League + Knockout prize. The sponsor’s wallet signs the deposit itself: a FOXSY transfer of the prize to the tournaments contract that names the tournament and its 8 recipients. This route then checks that transaction and the prize the contract holds. It answers the prize as the contract shows it. Sending the same hash again answers the same. A failure on our side answers with code: "tx_pending" as well: nothing was decided, so send the same hash again.

Who: the signed-in sponsor wallet of the prize.

Refusals:

  • This tournament has no prize from FoxLeague.
  • Only the wallet that set this prize can record its deposit.
  • Your deposit is not confirmed on chain yet. Please retry in a moment.: the transaction is not final yet; send the same hash again.
  • This deposit did not go through on chain: nothing was deposited.: the transaction failed.
  • This transaction is not a deposit of this tournament's prize.: another wallet, another tournament, another recipient count or another call.
  • The contract does not show the deposit yet. Please retry in a moment.: send the same hash again.
id
required
integer format: int64

The tournament id.

Media type application/json

The deposit transaction of a prize from FoxLeague.

object
tx_hash
required

The hash of the deposit transaction the sponsor’s wallet signed.

string
Example generated
{
"tx_hash": "example"
}

Success or a refusal: read success (the refusals are in the description).

Media type application/json
object
code

A machine-readable reason next to error, set only where the caller must act differently. tx_pending: the payment was not refused but could not be verified yet; keep the transaction hash and confirm again with the same hash, never pay twice.

string | null
data

The answer. Present when success is true.

object
amount_atomic
required

The total deposited in the contract, in atomic FOXSY (18 decimals). It stays after the payout or the refund. 0 before a deposit.

string
can_deposit
required

true for the sponsor’s own wallet while the tournament is open, the terms are set and the contract, read just now for this answer, holds nothing deposited yet.

boolean
deposit_tx

The hash of the deposit transaction. null before it is recorded.

string | null
from_chain
required

true when the state and the amount are a reading of the contract from the last 20 seconds. false when the stored reading answers: the caller has no session or the contract could not be read just now.

boolean
payout_tx

The hash of the payout transaction. null before the payout.

string | null
planned_foxsy
required

The prize the admin set at create, in whole FOXSY.

integer format: int64
read_at

When the state and the amount were read from the contract.

string | null format: date-time
recipients
required

The number of teams that share it: the 8 quarter-finalists.

integer format: int32
refund_tx

The hash of the refund transaction of a cancelled tournament. null otherwise.

string | null
share_atomic

Once paid: what each quarter-finalist received, in atomic FOXSY. null before.

string | null
state
required

The prize as the tournaments contract holds it: none (not deposited), held (locked in the contract), paid (paid to the quarter-finalists), refunded (the tournament was cancelled and the prize went back to its depositor) or reclaimed (returned by the owner 30 days after the completion, never paid).

string
terms_set
required

true once the contract names the sponsor wallet and the 8 recipients: a deposit is possible from then on.

boolean
tournament_id
required

The tournament id.

integer format: int64
error

Why the request was refused, in plain words. Present when success is false.

string | null
success
required

true when the request did what it asked. false is a refusal: read error.

boolean
Example
{
"data": {
"amount_atomic": "100000000000000000000000",
"can_deposit": false,
"deposit_tx": "6f2c90b1aa3e4d17b2a1c0f5e9d8c7b6a5f4e3d2c1b0a9f8e7d6c5b4a3f2e1d0",
"from_chain": true,
"payout_tx": null,
"planned_foxsy": 100000,
"read_at": "2026-11-02T10:00:00Z",
"recipients": 8,
"refund_tx": null,
"share_atomic": null,
"state": "held",
"terms_set": true,
"tournament_id": 602
},
"success": true
}

No valid session. The body is plain text: Missing Authorization header, Invalid Authorization format, Invalid session token or Session expired or invalid. Sign in again.

Media type text/plain
string
Example
Session expired or invalid