Delete Listing

This endpoint deletes an existing marketplace listing.

This endpoint can be used to delete an ordinal listing from the marketplace. Deleting a listing requires the seller to create a transaction by calling /delist sign the transaction and then need to send the signed transaction by making a call to /confirm-delist , the signed transaction transfers the ordinal to the seller so that the original ordinal UTXO is consumed and not valid anymore. This is to ensure that the old, signed transaction cannot be used anymore to buy the ordinal.

POST Delete Listing

POST https://testnet-api.ordinalsbot.com/marketplace/delist

API Key is required in the header:

headers: { 'x-api-key': '<YOUR_API_KEY>', ...otherHeaders }

Example: Here's an example of executing a delete listing with Xverse wallet

// XVerse Wallet example of delete a listing request
// Create the delete listing PSBT by calling /marketplace/delist API
// This returns a base64 PSBT, sender ordinal and payment inputs which needs to be signed

const { psbtBase64, senderOrdinalInputs, senderPaymentInputs } = await axios({
  method: "post",
  url: "https://api.ordinalsbot.com/marketplace/delist",
  data: {
    ordinalId,    //ordinal id to be deleted from listing
    senderPaymentAddress,
    senderPaymentPublicKey,
  },
  headers: {
    "x-api-key": API_KEY,
  },
});

// input to sign
const inputsToSign = [
  {
    address: ordinalsAddress, // Seller's ordinal wallet address
    signingIndexes: senderOrdinalInputs,
    sigHash: bitcoin.Transaction.SIGHASH_ALL,
  },
  {
    address: senderPaymentAddress, // Seller's ordinal wallet address
    signingIndexes: senderPaymentInputs,
    sigHash: bitcoin.Transaction.SIGHASH_ALL,
  },
];

// Create the payload for signing the seller transaction
const payload = {
  network: { type: "Mainnet" },
  message: "Sign Seller Transaction",
  psbtBase64: psbtBase64, // PSBT returned by the delist API
  broadcast: true,
  inputsToSign: inputsToSign,
};

// Make signing request
await signTransaction({
  payload,
  onFinish: async (response) => {
    try {
      // make a call to /confirm-delist
      await axios({
        method: "post",
        url: "https://api.ordinalsbot.com/marketplace/confirm-delist",
        data: {
          ordinalId,
          sellerPaymentAddress: senderPaymentAddress,
        },
        headers: {
          "x-api-key": API_KEY,
        },
      });
      console.error('Signed transaction id:', {response?.txId})
    } catch (error) {
      console.error('Error delisted ordinal:', error)
    }
  },
  onCancel: () => {
    /* User cancelled signing request */
  },
});

Request Body

NameTypeDescription

ordinalId*

String

Id of the ordinal to buy.

senderPaymentAddress*

String

Sender's payment wallet address. The sender will need to pay the cost of the transaction from UTXOs belonging to this address.

senderPaymentPublicKey*

String

Public Key for sender's payment wallet address.


{
    "psbtBase64": "cHNidP8BA............z730AAAAAAAAAAA==",
    "senderOrdinalInputs": [ 0 ],
    "senderPaymentInputs": [ 1 ]
}

Last updated