Skip to content

Commit

Permalink
fixes error where bids were not returned from current auction query hook
Browse files Browse the repository at this point in the history
  • Loading branch information
salieflewis committed Jun 27, 2023
1 parent f6cc53a commit 22eae33
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .changeset/short-insects-share.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@public-assembly/builder-utils': patch
---

Return bids from current auction query.
21 changes: 14 additions & 7 deletions apps/router-test/src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
useProposalVotesQuery,
useHistoricalBids,
useProposalDetailsQuery,
useCurrentAuctionQuery,
} from '@public-assembly/builder-utils'
import Link from 'next/link'

Expand All @@ -27,19 +28,25 @@ export default function Page() {

// console.log(tokenName, tokenId, tokenOwner, tokenImage, mintedAt)

const { winningBid, startTime, endTime, bids, winningBidder } =
useHistoricalAuctionQuery({
tokenAddress: '0xd2e7684cf3e2511cc3b4538bb2885dc206583076',
// tokenId: currentTokenId ? BigInt(auctionState.tokenId) : BigInt(false),
tokenId: BigInt(54),
})
// const { winningBid, startTime, endTime, bids, winningBidder } =
// useHistoricalAuctionQuery({
// tokenAddress: '0xd2e7684cf3e2511cc3b4538bb2885dc206583076',
// // tokenId: currentTokenId ? BigInt(auctionState.tokenId) : BigInt(false),
// tokenId: BigInt(54),
// })

// console.log(winningBid, startTime, endTime, bids, winningBidder)
// console.log(bids)

// const { minimumBidIncrement } = useAuctionConfigQuery({
// tokenAddress: '0xd2e7684cf3e2511cc3b4538bb2885dc206583076',
// })

const { bids } = useCurrentAuctionQuery({
tokenAddress: '0xdf9b7d26c8fc806b1ae6273684556761ff02d422',
})

console.log(bids)

// console.log(minimumBidIncrement)

// const { minBidAmount } = useMinBidAmount()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ export function useCurrentAuctionQuery({ tokenAddress }: { tokenAddress: Hex })
? formatEther(BigInt(currentAuction?.dao?.currentAuction?.highestBid?.amount))
: '',
highestBidder: highestBidder,
bids: currentAuction?.dao?.currentAuction?.bids?.map((bid) => {
return {
bidder: bid.bidder,
amount: formatEther(bid.amount),
}
}),
error,
}
}

0 comments on commit 22eae33

Please sign in to comment.