Delete Listing
This endpoint deletes an existing marketplace listing.
POST Delete Listing
POST Delete Listing// 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
Name
Type
Description
Last updated