Update Listing
Update an existing marketplace listing
POST Update a Listing
POST Update a ListingUpdate a marketplace listing
// XVerse Wallet example of creating a signing request
// updating an ordinal by calling relist
// Create the relist PSBT by calling /marketplace/relist API
// This returns a base64 PSBT in string format which needs to be signed
const { data } = await axios({
method: 'post',
url: 'https://api.ordinalsbot.com/marketplace/relist',
data: {
ordinalId,
price:1200, // updated price
sellerPaymentAddress,
sellerOrdinalPublicKey
},
headers: {
'x-api-key': API_KEY,
}
});
// When using XVerse Wallet
// Create the payload for signing the seller transaction
const sellerInput = {
address: ordinalsAddress, // Seller's ordinal wallet address
signingIndexes: [0], // always [0] when listing/relisting
// Specify sigHash type as SIGHASH_SINGLE | SIGHASH_ANYONECANPAY
sigHash: bitcoin.Transaction.SIGHASH_SINGLE | bitcoin.Transaction.SIGHASH_ANYONECANPAY,
};
const payload = {
network: { type: "Mainnet" },
message: "Sign Seller Transaction",
psbtBase64: data.psbt, // PSBT returned by the clear-listing API
broadcast: false,
inputsToSign: [sellerInput],
};
// Make signing request
await signTransaction({
payload,
onFinish: async (response) => {
try {
// signed succesffully
// Save the relist PSBT by calling /marketplace/confirm-relist API
// This saves the signed PSBT
const saveResponse= await axios({
method: 'post'
url: 'https://api.ordinalsbot.com/marketplace/confirm-relist',
data: {
ordinalId,
signedListingPSBT: response.psbtBase64
},
headers: {
'x-api-key': API_KEY,
}
});
} catch (Error) {
// error handling
}
},
onCancel: () => { /* User cancelled signing request */}
});Request Body
Name
Type
Description
Last updated