-
Notifications
You must be signed in to change notification settings - Fork 0
feat: enhance FallbackPurchaseUI with WaaS fee options integration #549
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
base: trails
Are you sure you want to change the base?
Conversation
- Added support for WaaS fee options in the FallbackPurchaseUI component. - Integrated `useSelectWaasFeeOptions` and `selectWaasFeeOptionsStore` for managing fee visibility and selection. - Updated the buy button label dynamically based on the selected fee option. - Improved transaction handling by showing fee options when applicable, particularly for non-testnet environments. - Refactored conditional rendering for the buy button and fee options to enhance user experience.
sdk/src/react/ui/modals/BuyModal/components/FallbackPurchaseUI.tsx
Outdated
Show resolved
Hide resolved
…label handling - Removed unused imports related to network type checks. - Simplified the logic for determining button labels for approval and purchase actions. - Enhanced conditional rendering for action buttons based on transaction states and WaaS integration. - Improved user feedback by dynamically updating button labels during transaction processing.
sdk/src/react/ui/modals/BuyModal/components/FallbackPurchaseUI.tsx
Outdated
Show resolved
Hide resolved
sdk/src/react/ui/modals/BuyModal/components/FallbackPurchaseUI.tsx
Outdated
Show resolved
Hide resolved
…actNode elements
… state from `useWaasFeeOptions` of `sequence-connect` package
…. Refactor FallbackPurchaseUI accordingly
nuqs: ^2.6.0 | ||
react: ^19.1.1 | ||
react-day-picker: ^9.9.0 | ||
0xtrails: ^0.1.6 |
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.
I temporarily removed it to work in peace. I will take it back when PR is done.
It auto selects an available fee option. If WaaS account doesn't have balance to afford any of the fee options, it fails executing the transaction 👇🏼 (the log in console shows native balance and usdc balance in Polygon respectively) Screen.Recording.2025-09-19.at.12.23.56.mov |
- Modified the `onSuccessCallback` type to accept both `Hash` and `string` for the `hash` parameter. - Updated the `handleTransactionSuccess` function to handle the new hash type. - Adjusted type annotations in `BuyModalContent` to ensure compatibility with the updated hash handling. These changes enhance the flexibility of the BuyModal component in handling transaction success scenarios.
…lity with onSuccess callbacks - Updated the `onSuccess` handler in `useGenerateCancelTransaction`, `useGenerateListingTransaction`, and `useGenerateSellTransaction` to ensure that only the data (steps) is passed to the user's callback. - Removed unnecessary parameters from test cases in the corresponding test files to streamline assertions.
Tests of some of the transaction hooks (createListing, sell, cancel) were failing (https://github.com/0xsequence/marketplace-sdk/actions/runs/17854875009/job/50771510783) and I made changes to both their test files and |
sdk/src/react/ui/modals/BuyModal/components/FallbackPurchaseUI.tsx
Outdated
Show resolved
Hide resolved
sdk/src/react/ui/modals/BuyModal/components/useWaasFeeOptions.tsx
Outdated
Show resolved
Hide resolved
…chaseUI - Introduced a new `ErrorLogBox` component to display error messages with an option to view full error details. - Updated `FallbackPurchaseUI` to manage error states, replacing toast notifications with the `ErrorLogBox` for better user experience. - Implemented error handling for invalid steps and transaction failures, providing detailed error information to users. - Ensured that previous errors are cleared before new actions are executed, maintaining a clean error state.
sdk/src/react/ui/modals/BuyModal/components/BuyModalContent.tsx
Outdated
Show resolved
Hide resolved
.../ui/modals/_internal/components/selectWaasFeeOptions/__tests__/SelectWaasFeeOptions.test.tsx
Outdated
Show resolved
Hide resolved
sdk/src/react/ui/modals/BuyModal/components/FallbackPurchaseUI.tsx
Outdated
Show resolved
Hide resolved
…uteBuy` to execute a transaction or a bundled transactions whether it's shop or market
…approach with waasFeeOptionsStore
useSelectWaasFeeOptions
andselectWaasFeeOptionsStore
for managing fee visibility and selection.Market Purchase (testnet + mainnet) - WAAS
mainnet.-.market.-waas.mov
testnet.-.market.-.waas.mov
Shop Purchase (testnet + mainnet) - WAAS
shop.-.waas.mov