A comprehensive list of endpoints exposed by our Tournaments API
Overview
Each Endpoint has a GET and a POST operation, the GET will generate a prepared transaction for the endpoint, complete with signatures from newly created accounts and our API signer. Next, this transaction must be signed by the caller and send back in a POST body. We will validate the transaction received via HTTP POST and forward this along to the Solana network.
// Generic POST, there is one POST one GET per endpoint listed below
curl -X POST -H 'Content-Type: application/json' 'https://$BASE_URL/$ENDPOINT' \
-d '{ "tx": "$BASE64_ENCODED_STRING" }'
AddEntryFeeAsReward
Transfer tokens collected by a Tournaments Entry Fee to the Reward Escrow, this enables the Entry Fee to be redistributed to tournament participants. This endpoint is only callable by a Tournament Authority.
Transfer tokens from the Tournament Authority to the Reward Escrow. It's important to specify the Reward Amount with the correct decimal precision. This endpoint is only callable by a Tournament Authority.
Example: 1 $USDC would be a reward amount of "100000", USDC has 6 decimals of precision.
constreward=awaitauthority.addReward("<tournamentPubkey","<rewardMint>","<rewardAmount>");// Example: create a reward of 1 $USDCconstreward=awaitauthority.addReward("<tournamentPubkey","EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v","100000");
BanCheater
Revoke all tournament points gained by a detected cheater in a tournament. This endpoint is only callable by a Tournament Authority.
Create a new round of matches within a Tournament. For each new round, increment the Round Index by 1, the API uses the Participants per Round to determine the number of matches to create for a round. This endpoint is only callable by a Tournament Authority.
Create a new Tournament, the creator mints a Tournament Authority token granting them full control over Tournament operations.
Specify a Name and a Tournament Size, optionally specify an Entry Fee and/or a Token Gate. The Name cannot be longer than 100 characters. The Size sets a limit on number of participants who can join, but this limit does not need to be reached to start the Tournament.
An Entry Fee requires a Mint and an Amount which each participant must pay to enter into your Tournament.
A Token Gate requires a Mint and an Amount which each participant must have in their Wallet to be eligible to enter into your Tournament.
Update the state of the Tournament to Ended. This endpoint is only callable by a Tournament Authority.
When a Tournament is moved to Ended, no more Matches or Rounds can be created. Cheaters can still be detected and banned at this stage, this is where rewards would be distributed to eligible participants.
Enter a Tournament Participant into a Match. This endpoint is only callable by a Tournament Authority.
The Tournament Authority is in control of which participants enter which Matches so that the Tournament Authority can control bracketing and matchmaking semantics.
A participant uses this endpoint to enter into a tournament of their choice. If the tournament has an Entry Fee or Token Gate configured, the participant must pay or have in their wallet the necessary tokens.
Finalize the results of a Tournament, all rewards have be distributed, cheaters banned and the results of the Tournament become immutable. This endpoint is only callable by a Tournament Authority.
Retrieve all Matches of a particular Round in a tournament. Use the Round Index to select a particular round. Flip the finalized Boolean if you would like to selectively retrieve Matches which are finalized or not.
Determine a Winner of an Ended Match and move the Match into the Finalized State. This endpoint is only callable by a Tournament Authority.
The Winner will receive 1 Point in their points token account. Tournaments uses the points to determine which participants are eligible to play in subsequent tournament rounds and for participants and managers to keep track of Tournament state.
Currently only 1 winner can be selected but we will make this endpoint more flexible to support multiple winners in the future.
Move a Match within a Tournament into the Started State, this signifies that the Match is beginning to be played out on chain, no other participants may enter this Match. This endpoint is only callable by a Tournament Authority.
Move a Tournament into the Started State, no more participants may enter the tournament and now it's possible to begin creating Tournament Rounds. This endpoint is only callable by a Tournament Authority.