Repair your marketplace records from the chain
const url = 'https://foxleague.ai/api/marketplace/reconcile';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"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/reconcile \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "wallet_address": "example" }'Checks your listings and cards against the chain and repairs the game’s records:
- a listing whose card is neither in your wallet nor held by the marketplace is removed;
- a card marked as listed without a listing is marked as not listed;
- an unlisted card that is not in your wallet on chain leaves your roster until the chain shows its owner, unless it had marketplace activity in the last few minutes.
It answers the counts. When the marketplace’s holdings cannot be read it changes nothing and answers zeros. A wallet can run it once every 10 seconds.
Who: a signed-in player, for their own wallet.
Refusals:
Wallet address mismatch:wallet_addressis not the session wallet.Marketplace check: please wait a few seconds (limit: once every <n>s): this wallet ran it less than<n>seconds ago. Nothing was read or changed.Chain is temporarily unavailable. Please retry shortly.: the server cannot read the chain right now.The chain cannot be read right now. Please try again in a moment.: the chain cannot be read right now.
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ”The wallet whose marketplace records to repair.
object
Your wallet; it must be the session wallet.
Example generated
{ "wallet_address": "example"}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
Your cards the repair looked at.
Stale listings removed.
Cards whose records were corrected.
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": { "checked": 24, "delisted": 0, "updated": 1 }, "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 invalidReading your wallet on chain or a database write failed. The body is empty.