Skip to content

Record a listing you sent on chain

POST
/api/marketplace/list
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 price and 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_address is not the session wallet.
  • Price must be positive: price is 0 or less.
  • Player not found: no card has this nonce.
  • 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: an auctionList.
  • 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.
Media type application/json

A listing you signed on chain.

object
nonce
required

The NFT nonce of the card you listed.

integer format: int64
price
required

The listing price in whole FOXSY, above 0.

integer format: int64
tx_hash
required

The hash of your listing transaction, 64 hexadecimal characters.

string
wallet_address
required

Your wallet; it must be the session wallet.

string
Example generated
{
"nonce": 1,
"price": 1,
"tx_hash": "example",
"wallet_address": "example"
}

Success or a refusal: read success (the refusals are in the description).

Media type application/json

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
code

A machine-readable reason next to error, set only where the caller must act differently.

string
data

Always null on success: the route returns no data.

error

Why the request was refused, in plain words. Present when success is false.

string
success
required

true when the request did what it asked. false is a refusal: read error.

boolean
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.

Media type text/plain
string
Example
Session expired or invalid

The 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.