-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added end/withdraw all auctions button #1630
Added end/withdraw all auctions button #1630
Conversation
🦋 Changeset detectedLatest commit: d21513b The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
// Chain has a transaction size limit, so we can add at most a batch of 48 auctions in a single transaction | ||
// see https://github.com/penumbra-zone/web/issues/1166#issuecomment-2263550249 | ||
filterWithLimit(data, a => a.localSeqNum === 0n, 48), | ||
// TODO Should use the index of the selected account after the account selector for the auction is implemented |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, we can end/withdraw all only for Account 0
see #1166 (comment)
I will open a separate issue for this to add an account selector to the auction list
UPD: I've changed the approach a bit, now users can end and withdraw auctions for all accounts, but auctions from different accounts will end or withdraw with different batches
export const assembleAuctionBatch = ( | ||
auctions: AuctionInfo[], | ||
filteredSeqNumber: bigint, | ||
batchLimit: number, | ||
): AuctionsBatch => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a temporary solution that allows you to close all auctions on accounts with different batches
If a user has auctions on account 0 and account 1, the first transaction will end all auctions on account 0, and the second transaction will end all auctions on account 1
see: #1166 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic looks good to me, and could be merged as-is. However, there is a lot of repetition in the ClaimAllButton
(which I'd also rename to EndOrWithdrawAllButton
). If you could DRY that up, that'd be great — but feel free to merge this first to get this in ASAP.
apps/minifront/src/components/swap/auction-list/claim-all-button.tsx
Outdated
Show resolved
Hide resolved
apps/minifront/src/components/swap/auction-list/claim-all-button.tsx
Outdated
Show resolved
Hide resolved
Co-authored-by: Jesse Pinho <[email protected]>
…on.tsx Co-authored-by: Jesse Pinho <[email protected]>
…on.tsx Co-authored-by: Jesse Pinho <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only watched UI video but looks good to me
Demo:
Screen.Recording.2024-08-02.at.21.51.44.mov
The limit of max 48 auctions in one transaction is set, but I still have the bug prax-wallet/prax#130 , reviewers, please let me know if you have the same.