-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
exclude auctionNft assets from dashboard, send and swap (#1123)
* remove auctionNft assets from dashboard, send and swap * Update apps/minifront/src/components/dashboard/assets-table/index.tsx Co-authored-by: Jesse Pinho <[email protected]> * review fixes --------- Co-authored-by: Jesse Pinho <[email protected]>
- Loading branch information
1 parent
e4c9fce
commit 31b2e92
Showing
5 changed files
with
41 additions
and
4 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
apps/minifront/src/components/dashboard/assets-table/helpers.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { assetPatterns } from '@penumbra-zone/types/assets'; | ||
import { getDisplay } from '@penumbra-zone/getters/metadata'; | ||
import { BalancesResponse } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/view/v1/view_pb'; | ||
import { getMetadata } from '@penumbra-zone/getters/value-view'; | ||
|
||
// We don't have to disclose auctionNft to the user since it is a kind of utility asset needed only | ||
// for the implementation of the Dutch auction | ||
const hiddenAssetPatterns = [assetPatterns.auctionNft]; | ||
|
||
export const isUnknown = (balancesResponse: BalancesResponse) => | ||
balancesResponse.balanceView?.valueView.case === 'unknownAssetId'; | ||
|
||
export const shouldDisplay = (balance: BalancesResponse) => | ||
isUnknown(balance) || | ||
hiddenAssetPatterns.every( | ||
pattern => !pattern.matches(getDisplay(getMetadata(balance.balanceView))), | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters