Skip to content

Manage Assets Data Flow#96

Merged
Brunonascdev merged 21 commits intomainfrom
bn-manage-assets-data-flow
Apr 23, 2025
Merged

Manage Assets Data Flow#96
Brunonascdev merged 21 commits intomainfrom
bn-manage-assets-data-flow

Conversation

@Brunonascdev
Copy link
Copy Markdown
Contributor

@Brunonascdev Brunonascdev commented Apr 15, 2025

This PR implements the data flow for the Manage Assets feature. It allows the user to add different assets categories (classic and SAC) using the Stellar Expert and Freighter Backend APIs.

closes issue #73

Android

manage-assets-flow-android.webm

iOS

Simulator.Screen.Recording.-.iPhone.15.Pro.-.2025-04-15.at.11.47.24.mp4

Adding Soroban Custom Asset

adding-soroban-asset.webm

@Brunonascdev Brunonascdev added the enhancement New feature or request label Apr 15, 2025
@Brunonascdev Brunonascdev self-assigned this Apr 15, 2025
@Brunonascdev Brunonascdev linked an issue Apr 15, 2025 that may be closed by this pull request
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements the data flow for the Manage Assets feature by introducing new asset management UI components and removing legacy logic. Key changes include the creation of new components (ErrorState, EmptyState, AssetItem, AddAssetRightContent, and AddAssetBottomSheetContent), updates to the SimpleBalancesList to incorporate asset removal features, and various improvements and refactoring in supporting primitives and configurations.

Reviewed Changes

Copilot reviewed 47 out of 47 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/components/screens/HistoryScreen.tsx Removed logout functionality and unused imports to simplify the screen.
src/components/screens/AddAssetScreen/* Introduced new asset-related screens and types to support asset management.
src/components/primitives/Menu.tsx Added MenuGroup and MenuSeparator components utilizing nested menu items.
src/components/SimpleBalancesList.tsx Updated to filter and display balance items with the new ManageAssetRightContent.
src/components/Modal.tsx Created a new Modal component for consistent UI presentation.
src/components/ManageAssetRightContent.tsx Added a component to handle asset actions via a context menu and modal flows.
src/components/ContextMenuButton.tsx Enhanced handling of nested menu actions and added key generation logic.
src/components/BottomSheet.tsx Updated props and styling to increase configurability and align with theme.
eslint.config.mjs Adjusted imports and added a new ESLint rule disable for exports.
tests/* Updated tests to reflect changes in component props and rendering setup.

Comment thread src/components/ContextMenuButton.tsx
Comment thread src/components/Spinner.tsx
Comment thread src/components/screens/AddAssetScreen/AddAssetBottomSheetContent.tsx Outdated
Comment thread src/components/screens/AddAssetScreen/AddAssetBottomSheetContent.tsx Outdated
Copy link
Copy Markdown
Contributor

@danilosilvackl danilosilvackl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looking very neat! left some suggestions

Comment thread src/components/screens/AddAssetScreen/AddAssetRightContent.tsx Outdated
Comment thread src/components/screens/AddAssetScreen/AddAssetScreen.tsx Outdated
Comment thread src/components/screens/AddAssetScreen/AddAssetScreen.tsx Outdated
Comment thread src/components/screens/AddAssetScreen/AddAssetScreen.tsx Outdated
Comment thread src/components/screens/AddAssetScreen/AddAssetScreen.tsx Outdated
Comment thread src/components/screens/AddAssetScreen/AssetItem.tsx
Comment thread src/helpers/soroban.ts
Comment thread src/hooks/useColors.ts
Comment thread src/services/stellar.ts Outdated
Comment thread src/services/stellarExpert.ts
Comment thread src/services/indexer.ts Outdated
Comment thread src/services/stellarExpert.ts Outdated
Comment thread src/services/stellar.ts Outdated
Comment thread src/services/stellar.ts Outdated
Comment thread src/services/stellar.ts Outdated
Comment thread src/components/screens/AddAssetScreen/AddAssetScreen.tsx
* feat: add calculateSpacing function to handle different devices

* refactor: remove unnecessary spacing constant

* refactor: remove unnecessary styled-components component

* feat: pr suggested improvements
Comment thread src/components/AssetIcon.tsx Outdated
Comment thread src/services/backend.ts Outdated
Comment thread src/config/types.ts
Comment thread src/config/constants.ts
Comment thread src/hooks/useManageAssets.ts Outdated
Comment thread src/config/constants.ts
@CassioMG
Copy link
Copy Markdown
Contributor

@Brunonascdev for the Custom Token case I think we should replace "Trustline" with something else as it only makes sense for classic assets. I think we also don't currently support trading Custom Tokens, do we?

How is the copy looking on the extension while adding a custom token?

Screenshot 2025-04-23 at 12 01 43

@CassioMG
Copy link
Copy Markdown
Contributor

@Brunonascdev for the Custom Token case I think we should replace "Trustline" with something else as it only makes sense for classic assets. I think we also don't currently support trading Custom Tokens, do we?

How is the copy looking on the extension while adding a custom token?

@Brunonascdev I think we'll also need to rename some functions like handleAddAssetTrustline to handleAddAsset instead and maybe other functions with same naming issue to avoid confusion. Wdyt?

Comment thread src/helpers/__mocks__/dimensions.ts
Comment thread src/hooks/useAssetLookup.ts Outdated
Comment thread src/services/backend.ts Outdated
Comment thread src/services/stellar.ts Outdated
Comment thread src/services/stellar.ts Outdated
@Brunonascdev
Copy link
Copy Markdown
Contributor Author

@Brunonascdev for the Custom Token case I think we should replace "Trustline" with something else as it only makes sense for classic assets. I think we also don't currently support trading Custom Tokens, do we?

How is the copy looking on the extension while adding a custom token?

Screenshot 2025-04-23 at 12 01 43

it's very different from the mobile version:

adding USDC:
Screenshot 2025-04-23 at 15 10 01

adding a custom soroban token:
Screenshot 2025-04-23 at 15 05 01

@Brunonascdev
Copy link
Copy Markdown
Contributor Author

Brunonascdev commented Apr 23, 2025

For future reference:

We’ve aligned on updating the copy in the Add Asset BottomSheet to remove any mention of “trustlines,” since no ChangeTrust operation is triggered when adding a custom Soroban token.

Here’s the revised copy currently in place:

Copy link
Copy Markdown
Contributor

@CassioMG CassioMG left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - great job on this @Brunonascdev! 🚀 🚀 🚀

@Brunonascdev Brunonascdev merged commit c87f5b7 into main Apr 23, 2025
1 check passed
@Brunonascdev Brunonascdev deleted the bn-manage-assets-data-flow branch April 23, 2025 19:42
@github-actions github-actions Bot mentioned this pull request Nov 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Data flow - Add and manage assets/trustlines

4 participants