-
Notifications
You must be signed in to change notification settings - Fork 22
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
feat(ui): #2051: TransactionSummary
#2083
base: main
Are you sure you want to change the base?
Conversation
Visit the preview URL for this PR (updated for commit db3536d): https://penumbra-ui-preview--pr2083-feat-2051-tx-summar-rkethfkg.web.app (expires Fri, 07 Mar 2025 08:22:17 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 709d729610ef7a6369b23f1cb2b820a60cc685b1 |
/** | ||
* Takes a transaction view, finds the most relevant action that defines its type, and returns it. | ||
*/ | ||
export const classifyTransaction = (txv?: TransactionView): ClassificationReturn => { |
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.
a powerful function, it was returning only a classified type of a transaction. I added the return of the most relevant action type given transaction
export interface AddressViewProps { | ||
addressView: AddressView | undefined; | ||
copyable?: boolean; | ||
hideIcon?: boolean; | ||
truncate?: boolean; | ||
/** If true, takes the `altBech32m` field from the address and renders it as-is */ | ||
external?: boolean; |
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.
added support for AddressView component to render addresses from other blockchains like osmo1awefasdf...
export const useClassification = ( | ||
info: TransactionInfo, | ||
getMetadataByAssetId?: GetMetadataByAssetId, | ||
) => { |
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 main data modeling logic is here - the hook prepares a transaction for rendering
Closes #2051
An independent PR but only #2000 will allow applying this component to the DEX or other products.
Preview of the component: https://penumbra-ui-preview--pr2083-feat-2051-tx-summar-rkethfkg.web.app/?path=/docs/ui-library-transactionsummary--docs
Needs a follow up work to support the whole range of transaction types but I'd like to switch to other features. At least this component works well on Send/Receive/Swap transaction types and partially on the rest of them.