Skip to content
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: custom token import #22

Merged
merged 16 commits into from
Feb 10, 2025
Merged

feat: custom token import #22

merged 16 commits into from
Feb 10, 2025

Conversation

takenagain
Copy link
Collaborator

@takenagain takenagain commented Feb 3, 2025

Changes

  • Migrates the RPCs and related models used in custom token activation from KW to the SDK
  • Adds support for custom token activation with the new activation strategy custom_erc20_activation_strategy.dart
  • Copies over the custom token logic from CoinIcon to AssetIcon
    • The coin icon URL is obtained from CoinGecko API in KW and stored in the protocol JSON config for now. The ideal long-term solution will likely be to have a permanent fallback coin icon resolver with support for more icons than in the coins repository.

add boolean flag to classes rather than creating a new asset manager type that makes the assets interface more cumbersome to use
Significant changes include:
- Updated the commit reference for bundled coins in the build configuration
- Added a new class, CustomAssetHistoryStorage, to manage custom token history
- Enhanced AssetManager to handle custom tokens by adding them to wallet history and activating them
- Extended the Asset class with a method to create an instance from JSON data
@takenagain takenagain self-assigned this Feb 3, 2025
@takenagain takenagain force-pushed the feature/custom-token-import branch from 9489a18 to 75b7d5c Compare February 5, 2025 09:23
the custom token erc20 activation strategy was placed in the factory which had it's reference removed in the latest changes or merge from dev
@takenagain takenagain added the enhancement New feature or request label Feb 5, 2025
@takenagain takenagain requested a review from CharlVS February 6, 2025 17:01
@takenagain takenagain marked this pull request as ready for review February 6, 2025 17:01
Copy link
Member

@CharlVS CharlVS left a comment

Choose a reason for hiding this comment

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

Awesome work! I'm happy with the architectural changes. Everything meets the standard I'm striving for and is consistent with the current architecture.

Thank you for taking the time to fully understand the architecture and the broader context of your changes. The system has many components and is mostly undocumented. When we have some breathing room and a stable release, we'll work together to document everything (mainly me) and on test coverage (mainly you)

};
}

/// [AddressFormat] format field options.
enum AddressFormatFormat {
Copy link
Member

Choose a reason for hiding this comment

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

This enum is confusing/redundant. Can you rename it to something clearer? I suggest AddressFormatType.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Renamed in f91cf60

Copy link
Member

@CharlVS CharlVS left a comment

Choose a reason for hiding this comment

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

Spicy. Some of your best contributions to date.

@CharlVS CharlVS merged commit 0a210cf into dev Feb 10, 2025
1 check failed
@CharlVS CharlVS deleted the feature/custom-token-import branch February 10, 2025 21:45
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.

2 participants