Record a listing you sent on chain
const url = 'https://foxleague.ai/api/marketplace/list';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"nonce":1,"price":1,"tx_hash":"example","wallet_address":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://foxleague.ai/api/marketplace/list \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "nonce": 1, "price": 1, "tx_hash": "example", "wallet_address": "example" }'Records a fixed-price listing you signed on chain, so the marketplace shows it at once. The server checks the card and the listing rules, then reads the transaction tx_hash: it must be final and successful, sent by you, a marketplaceList of this card to the marketplace contract at price. Then it checks whether the marketplace contract holds the card:
- it holds it: the listing is recorded at
priceand the card shows as listed; - not yet (the chain is still settling): nothing is recorded and the answer is still
success: true. The listing appears once the chain shows it.
A listing transaction the chain feed has already recorded answers success: true and changes nothing. An auction listing is never recorded here: it appears once the chain has recorded it.
Who: a signed-in player, for a card of their own wallet.
Refusals:
Wallet address mismatch:wallet_addressis not the session wallet.Price must be positive:priceis 0 or less.Player not found: no card has thisnonce.You don't own this player: the card belongs to another wallet.Cannot list <card>: player has unsynced training. Sync first so the buyer gets the canonical on-chain version.: the card has training that is not on chain yet.Player needs more competitive matches to be listed: <n> competitive matches (waived matches count, <floor> must be played): the card has not played enough competitive matches; the text ends with the code[needs_competitive_matches].Player is below the competitive match floor: <floor> competitive matches must be really played before it can be listed (waived matches do not count for these): fewer competitive matches than the floor were played; the text ends with the code[below_match_floor].Chain is temporarily unavailable. Please retry shortly.: the server cannot read the chain right now.Chain verification unavailable: the server has no chain connection.Another marketplace transaction of your wallet is being checked: please wait a few seconds and retry: another record of your wallet (a listing, a sale or a cancel) is reading its transaction right now; send this one once it has answered.Transaction verification failed. Try again later: the transaction could not be read.Transaction <status> on chain: cannot confirm marketplace listing: the transaction failed on chain.Your payment isn't confirmed on chain yet, but it may still settle. Please retry the marketplace listing in a moment.: the transaction is not final yet.Transaction was rejected on chain (<reason>) and refunded: marketplace listing not confirmed: the contract refused it.Transaction sender does not match your wallet: another wallet sent it.Transaction was not sent to the marketplace listing contract: it is not a transfer from your wallet.Transaction is not a fixed-price listing of this player on the marketplace: it lists another card, sends it elsewhere or calls another function.Transaction is an auction listing: the auction shows on the marketplace once the chain has recorded it: anauctionList.Transaction lists this player at <tx price> FOXSY, not <price>: the transaction carries another price.Player is already listed: the card already has a listing.
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ”A listing you signed on chain.
object
The NFT nonce of the card you listed.
The listing price in whole FOXSY, above 0.
The hash of your listing transaction, 64 hexadecimal characters.
Your wallet; it must be the session wallet.
Example generated
{ "nonce": 1, "price": 1, "tx_hash": "example", "wallet_address": "example"}Responses
Section titled “ Responses ”Success or a refusal: read success (the refusals are in the description).
The answer of a request that returns no data. POST /api/tournaments/{id}/delete answers its refusals with it: success is false and error says why.
object
A machine-readable reason next to error, set only where the caller must act differently.
Always null on success: the route returns no data.
Why the request was refused, in plain words. Present when success is false.
true when the request did what it asked. false is a refusal: read error.
Example
{ "data": null, "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.
Example
Session expired or invalidThe body does not match the request schema, for example a tx_hash that is not 64 hexadecimal characters. The body is plain text.
A database read or write failed. The body is empty.