Skip to content

Commit

Permalink
conclude auction
Browse files Browse the repository at this point in the history
  • Loading branch information
devsisingh committed Oct 27, 2023
1 parent 7b4022d commit 39ac439
Showing 1 changed file with 40 additions and 17 deletions.
57 changes: 40 additions & 17 deletions pages/collections/[signatureseries]/[id]/[nftid].js
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,18 @@ function Token() {
}
};

const handleconclude = async () => {
const tradhubContarct = await etherContract(tradhubAddress, Tradhub.abi)
try {
const transaction = await tradhubContarct.concludeAuction(nftitemid);
console.log(transaction);
await transaction.wait();
} catch (e) {
console.log(e?.data?.message);
console.error(e);
}
};

const itemid = async () => {
if (data) {
const endPoint = `${graphqlAPI}`;
Expand Down Expand Up @@ -647,24 +659,35 @@ function Token() {

{
!personisowner && auctionbuttons && (
<div className="flex">
<div className="w-1/2">
<div class="flex">

<input type="number"
value={bidprice}
onChange={handlebidPriceChange}
id="website-admin" class="rounded-none rounded-l-lg border text-gray-900 focus:ring-blue-500 focus:border-blue-500 block flex-1 min-w-0 w-full text-sm border-gray-300 p-2.5 dark:bg-white dark:border-gray-600 dark:placeholder-gray-400 dark:text-gray-800 dark:focus:ring-blue-500 dark:focus:border-blue-500" placeholder="Enter bid price"/>
<button onClick={handlebidSubmit} className="">
<span class="inline-flex items-center px-3 py-3 text-sm text-gray-900 border border-r-0 border-gray-300 rounded-r-md dark:bg-gray-600 dark:text-gray-400 dark:border-gray-600">
{/* <svg class="w-4 h-4 text-gray-500 dark:text-gray-400" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20">
<path d="M10 0a10 10 0 1 0 10 10A10.011 10.011 0 0 0 10 0Zm0 5a3 3 0 1 1 0 6 3 3 0 0 1 0-6Zm0 13a8.949 8.949 0 0 1-4.951-1.488A3.987 3.987 0 0 1 9 13h2a3.987 3.987 0 0 1 3.951 3.512A8.949 8.949 0 0 1 10 18Z"/>
</svg> */}

<BiWallet className="text-3xl" />

</span>
</button>
</div>
<div class="flex">

<input type="number"
value={bidprice}
onChange={handlebidPriceChange}
id="website-admin" class="rounded-none rounded-l-lg border text-gray-900 focus:ring-blue-500 focus:border-blue-500 block flex-1 min-w-0 w-full text-sm border-gray-300 p-2.5 dark:bg-white dark:border-gray-600 dark:placeholder-gray-400 dark:text-gray-800 dark:focus:ring-blue-500 dark:focus:border-blue-500" placeholder="Enter bid price"/>
<button onClick={handlebidSubmit} className="">
<span class="inline-flex items-center px-3 py-3 text-sm text-gray-900 border border-r-0 border-gray-300 rounded-r-md dark:bg-gray-600 dark:text-gray-400 dark:border-gray-600">
{/* <svg class="w-4 h-4 text-gray-500 dark:text-gray-400" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20">
<path d="M10 0a10 10 0 1 0 10 10A10.011 10.011 0 0 0 10 0Zm0 5a3 3 0 1 1 0 6 3 3 0 0 1 0-6Zm0 13a8.949 8.949 0 0 1-4.951-1.488A3.987 3.987 0 0 1 9 13h2a3.987 3.987 0 0 1 3.951 3.512A8.949 8.949 0 0 1 10 18Z"/>
</svg> */}

<BiWallet className="text-3xl" />

</span>
</button>
</div>

</div>
<div className="w-1/2">
<button
onClick={handleconclude}
className="items-center justify-center lg:px-10 md:px-10 px-3 py-3 lg:ml-4 text-sm font-medium rounded-lg bg-white text-black"
>
<span className="text-lg font-bold">Conclude Auction</span>
</button>
</div>
{/* <div>
<input
type="number"
Expand Down

0 comments on commit 39ac439

Please sign in to comment.