Reclaiming/End Lending
This guide explains how to end lending of an NFT and to delist it from rentals.
1. Retrieve Market Contract:
Firstly you need to access to the Market contract:
const contracts = stash.contracts;
const market = contracts.market;
2. Call EndLend Function:
Call endLend
function on the market contract:
market.endLend(
tokenId,
amount, // 1 for 721-NFTs
standard,
(response) => {
// On success
// response.transactions[0].txn_hash will give the transactoin hash
console.log('endLend success callback triggered', response);
},
(error) => {
// On error
console.log('error triggered', error);
}
)
If any error occurs (e.g. user declines approval request or contract call fails) during the process, the error object error
contains respective information about the reason of the failure. You can find more information about the error structure under Error Handling section in Integration docs.
If lending has been successfully ended, then the success callback is called with the respective response object.
Updated 4 months ago