Skip to content

Record a cancel you sent on chain

POST
/api/marketplace/cancel
curl --request POST \
--url https://foxleague.ai/api/marketplace/cancel \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "nonce": 1, "tx_hash": "example", "wallet_address": "example" }'

Records the cancel of your listing, signed on chain, so the card is back in your roster at once. The server waits for the transaction to be final and checks it: a successful marketplaceCancel from you to the marketplace contract that released this card. It then removes the listing and shows the card as not listed.

A cancel the indexer has already seen answers success: true again and changes nothing. Just after this call recorded it and before the indexer has seen the transaction, a repeat can answer Listing not found: the listing is already gone. A cancel seen on chain is recorded even without this call.

Who: a signed-in player, the seller.

Refusals:

  • Wallet address mismatch: wallet_address is not the session wallet.
  • Chain is temporarily unavailable. Please retry shortly.: the server cannot read the chain right now.
  • Listing not found: no listing for this nonce and no cancel of it the indexer has seen. A repeat of a cancel this call just recorded answers it too until the indexer has seen the transaction.
  • You don't own this listing: the listing belongs to another wallet.
  • 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 <status> on chain: cannot confirm marketplace cancel: the transaction failed on chain.
  • Your payment isn't confirmed on chain yet, but it may still settle. Please retry the marketplace cancel in a moment.: the transaction is not final yet.
  • Transaction was rejected on chain (<reason>) and refunded: marketplace cancel not confirmed: the contract refused it.
  • Transaction sender does not match your wallet: another wallet sent it.
  • Transaction was not sent to the marketplace cancel contract: it is not a call to the marketplace contract.
  • Transaction is not a marketplace cancel call: it calls another function.
  • Transaction does not match this listing: please retry the cancel: the transaction did not release this card or its release is not visible yet: retry in a moment.
  • Transaction verification failed. Try again later: the transaction could not be read.
  • Chain verification unavailable: the server has no chain connection.
Media type application/json

A cancel you signed on chain.

object
nonce
required

The NFT nonce of the card whose listing you cancelled.

integer format: int64
tx_hash
required

The hash of your cancel transaction, 64 hexadecimal characters.

string
wallet_address
required

Your wallet; it must be the session wallet.

string
Example generated
{
"nonce": 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.