Skip to content

Repair your marketplace records from the chain

POST
/api/marketplace/reconcile
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_address is 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.
Media type application/json

The wallet whose marketplace records to repair.

object
wallet_address
required

Your wallet; it must be the session wallet.

string
Example generated
{
"wallet_address": "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
checked
required

Your cards the repair looked at.

integer
delisted
required

Stale listings removed.

integer
updated
required

Cards whose records were corrected.

integer
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": {
"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.

Media type text/plain
string
Example
Session expired or invalid

Reading your wallet on chain or a database write failed. The body is empty.