Whether a card can be listed now
const url = 'https://foxleague.ai/api/marketplace/can-list?nonce=1';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://foxleague.ai/api/marketplace/can-list?nonce=1' \ --header 'Authorization: Bearer <token>'Whether a card of your wallet can be listed on the marketplace now, at a fixed price or at auction. Two checks:
- its competitive matches: as for fusion, the card needs the match gate of its rarity (
rarity_match_gatein/api/config):min_matches_requiredcompetitive matches (waived ones count), of whichmatch_floor_requiredreally played. A failed check answerscan_list: falsewithreasonand the counts. - the relist cooldown after the card’s last purchase, read from the chain. This answer is kept for 30 seconds per card. When the chain cannot be read the answer allows the listing with
advisory: "cooldown_unknown"; the contract checks again when you list.
Who: a signed-in player, for a card of their own wallet.
Refusals:
Not your player: FoxLeague’s records do not have this card in your wallet. Nothing is read from the chain.
If the card cannot be read on our side, the answer is a refusal with a generic message.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Query Parameters
Section titled “Query Parameters ”The card’s NFT nonce.
Responses
Section titled “ Responses ”Success or a refusal: read success (the refusals are in the description).
object
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.
The answer. Present when success is true.
object
cooldown_unknown when the chain could not be read and the listing is allowed anyway; absent otherwise.
true when the card can be listed now.
Unix seconds when the relist cooldown ends; null when the card was never bought. Absent with reason or advisory.
Competitive matches the card has played. Only with reason.
Seconds left in the relist cooldown; null when the card can be listed. Absent with reason or advisory.
Matches waived for the card. Only with reason.
Of those, matches the card must have really played: the floor of its rarity. Only with reason.
Competitive matches the card needs, waived ones included: the gate of its rarity. Only with reason.
below_match_floor or needs_competitive_matches when the match check refuses; absent otherwise.
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": { "can_list": false, "can_relist_at": 1759420800, "cooldown_remaining_seconds": 5400 }, "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 invalid