i am using Thirdweb package where my Marketplace Contract and Nft Collection is deployed and during Purchase of an Item getting this error i am using Rinkeby Test Network with enough Balance in wallet for purchase the Contract address and Nft Collection addresses are correct
Let me Know if i have to add Gas Details, if yes how.. or some other issue
Thanks in Advance!!
const [selectedMarketNft, setSelectedMarketNft] = useState()
const [enableButton, setEnableButton] = useState(false)
useEffect(() => {
if (!listings || isListed === 'false') return
;(async () => {
setSelectedMarketNft(
listings.find((marketNft) => marketNft.asset?.id === selectedNft.id)
)
})()
}, [selectedNft, listings, isListed])
useEffect(() => {
if (!selectedMarketNft || !selectedNft) return
setEnableButton(true)
}, [selectedMarketNft, selectedNft])
const confirmPurchase = (toastHandler = toast) =>
toastHandler.success(`Purchase successful!`, {
style: {
background: '#04111d',
color: '#fff',
},
})
const buyItem = async (
listingId = selectedMarketNft.id,
quantityDesired = 1,
module = marketPlaceModule
) => {
// console.log(listingId, quantityDesired, module, 'david')
await module
.buyoutDirectListing({ listingId, quantityDesired})
.catch((error) => console.error(error))
confirmPurchase()
}```