Skip to content

Conversation

@0xean
Copy link
Contributor

@0xean 0xean commented Sep 4, 2025

Generated from CI.

Summary by CodeRabbit

  • Chores
    • Refreshed token color mappings across major networks (Ethereum, BNB Chain, Arbitrum, Avalanche, Base) for more consistent icon theming.
    • Updated related-asset data to improve asset suggestions and grouping throughout the app.
    • Introduced a one-time migration to clear cached assets, ensuring your portfolio reflects the latest data.
    • Data-only updates; no changes to app navigation or controls.

@0xean 0xean requested a review from a team as a code owner September 4, 2025 09:08
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 4, 2025

📝 Walkthrough

Walkthrough

Updates token color mappings in scripts/generateAssetData/color-map.json, revises related-asset mappings in src/lib/asset-service/service/encodedRelatedAssetIndex.json (including a new key), and appends a new clearAssets migration at index 177 in src/state/migrations/index.ts. All changes are data/config-only; no executable logic altered.

Changes

Cohort / File(s) Summary
Token color map updates
scripts/generateAssetData/color-map.json
Adds and removes multiple color entries for ERC20/BEP20 assets across eip155 networks (1, 56, 42161, 43114, 8453). Data-only modifications to hex color values; no structural or code changes.
Related asset index refresh
src/lib/asset-service/service/encodedRelatedAssetIndex.json
Replaces/updates many asset-to-related-asset arrays; introduces a new key (e.g., 37). Broad recalibration of numeric relationships; structure remains a single JSON map.
State migration entry
src/state/migrations/index.ts
Adds migration entry at index 177 to clearAssets via clearAssetsMigrations mapping; no other code changes.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant App
  participant Migrations
  participant AssetService

  User->>App: Launch app
  App->>Migrations: Run pending migrations
  note over Migrations: New entry 177<br/>clearAssets
  Migrations-->>AssetService: Invoke clear assets
  AssetService-->>Migrations: Assets cleared
  Migrations-->>App: Migration complete
  App->>AssetService: Load asset data
  note over AssetService: Uses updated color-map.json<br/>and relatedAssetIndex.json
  AssetService-->>App: Asset metadata ready
  App-->>User: Render assets with new colors/relations
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • NeOMakinG
  • 0xApotheosis

Poem

I thump my paw in hues anew,
A palette fresh, a mapping true.
With assets cleared at step one-seven-seven,
The chains align like stars in heaven. ✨
Hop, hop—relations set just right,
Colors bloom; the UI’s bright! 🐇🌈


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 0c6a427 and 9104cf2.

⛔ Files ignored due to path filters (15)
  • packages/caip/src/adapters/coincap/generated/eip155_1/adapter.json is excluded by !**/generated/**
  • packages/caip/src/adapters/coincap/generated/eip155_137/adapter.json is excluded by !**/generated/**
  • packages/caip/src/adapters/coincap/generated/eip155_42161/adapter.json is excluded by !**/generated/**
  • packages/caip/src/adapters/coincap/generated/eip155_43114/adapter.json is excluded by !**/generated/**
  • packages/caip/src/adapters/coincap/generated/eip155_56/adapter.json is excluded by !**/generated/**
  • packages/caip/src/adapters/coincap/generated/eip155_8453/adapter.json is excluded by !**/generated/**
  • packages/caip/src/adapters/coincap/generated/solana_5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/adapter.json is excluded by !**/generated/**
  • packages/caip/src/adapters/coingecko/generated/eip155_1/adapter.json is excluded by !**/generated/**
  • packages/caip/src/adapters/coingecko/generated/eip155_10/adapter.json is excluded by !**/generated/**
  • packages/caip/src/adapters/coingecko/generated/eip155_137/adapter.json is excluded by !**/generated/**
  • packages/caip/src/adapters/coingecko/generated/eip155_42161/adapter.json is excluded by !**/generated/**
  • packages/caip/src/adapters/coingecko/generated/eip155_43114/adapter.json is excluded by !**/generated/**
  • packages/caip/src/adapters/coingecko/generated/eip155_56/adapter.json is excluded by !**/generated/**
  • packages/caip/src/adapters/coingecko/generated/eip155_8453/adapter.json is excluded by !**/generated/**
  • packages/caip/src/adapters/coingecko/generated/solana_5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/adapter.json is excluded by !**/generated/**
📒 Files selected for processing (3)
  • scripts/generateAssetData/color-map.json (36 hunks)
  • src/lib/asset-service/service/encodedRelatedAssetIndex.json (1 hunks)
  • src/state/migrations/index.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/error-handling.mdc)

**/*.{ts,tsx}: ALWAYS use Result<T, E> pattern for error handling in swappers and APIs
ALWAYS use Ok() and Err() from @sniptt/monads for monadic error handling
ALWAYS use custom error classes from @shapeshiftoss/errors
ALWAYS provide meaningful error codes for internationalization
ALWAYS include relevant details in error objects
ALWAYS wrap async operations in try-catch blocks
ALWAYS use AsyncResultOf utility for converting promises to Results
ALWAYS provide fallback error handling
ALWAYS use timeoutMonadic for API calls
ALWAYS provide appropriate timeout values for API calls
ALWAYS handle timeout errors gracefully
ALWAYS validate inputs before processing
ALWAYS provide clear validation error messages
ALWAYS use early returns for validation failures
ALWAYS log errors for debugging
ALWAYS use structured logging for errors
ALWAYS include relevant context in error logs
Throwing errors instead of using monadic patterns is an anti-pattern
Missing try-catch blocks for async operations is an anti-pattern
Generic error messages without context are an anti-pattern
Not handling specific error types is an anti-pattern
Missing timeout handling is an anti-pattern
No input validation is an anti-pattern
Poor error logging is an anti-pattern
Using any for error types is an anti-pattern
Missing error codes for internationalization is an anti-pattern
No fallback error handling is an anti-pattern
Console.error without structured logging is an anti-pattern

**/*.{ts,tsx}: ALWAYS use camelCase for variables, functions, and methods
ALWAYS use descriptive names that explain the purpose for variables and functions
ALWAYS use verb prefixes for functions that perform actions
ALWAYS use PascalCase for types, interfaces, and enums
ALWAYS use descriptive names that indicate the structure for types, interfaces, and enums
ALWAYS use suffixes like Props, State, Config, Type when appropriate for types and interfaces
ALWAYS use UPPER_SNAKE_CASE for constants and configuration values
ALWAYS use d...

Files:

  • src/state/migrations/index.ts
**/*

📄 CodeRabbit inference engine (.cursor/rules/naming-conventions.mdc)

**/*: ALWAYS use appropriate file extensions
Flag files without kebab-case

Files:

  • src/state/migrations/index.ts
  • src/lib/asset-service/service/encodedRelatedAssetIndex.json
  • scripts/generateAssetData/color-map.json
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/react-best-practices.mdc)

USE Redux only for global state shared across multiple places

Files:

  • src/state/migrations/index.ts
🧠 Learnings (2)
📓 Common learnings
Learnt from: NeOMakinG
PR: shapeshift/web#10136
File: src/lib/asset-service/service/encodedRelatedAssetIndex.json:1-1
Timestamp: 2025-07-29T10:22:27.037Z
Learning: PRs with titles starting with "feat: regenerate asset data" are routine daily asset updates that don't need detailed code analysis. Users prefer to skip automated reviews for these maintenance PRs using coderabbitai ignore.
Learnt from: NeOMakinG
PR: shapeshift/web#10375
File: src/state/migrations/index.ts:214-215
Timestamp: 2025-08-27T13:49:48.668Z
Learning: The clearAssetsMigrations system in the ShapeShift web app works independently of the root persistConfig version. Migration numbers (like 171) don't need to match the root persistConfig version field, and the system has been functioning correctly for months/years without manual version bumps.
📚 Learning: 2025-08-27T13:49:48.668Z
Learnt from: NeOMakinG
PR: shapeshift/web#10375
File: src/state/migrations/index.ts:214-215
Timestamp: 2025-08-27T13:49:48.668Z
Learning: The clearAssetsMigrations system in the ShapeShift web app works independently of the root persistConfig version. Migration numbers (like 171) don't need to match the root persistConfig version field, and the system has been functioning correctly for months/years without manual version bumps.

Applied to files:

  • src/state/migrations/index.ts
🧬 Code graph analysis (1)
src/state/migrations/index.ts (1)
src/state/migrations/clearAssets.ts (1)
  • clearAssets (6-8)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Install and Cache
🔇 Additional comments (4)
src/state/migrations/index.ts (1)

220-220: Approve clearAssets migration bump to 177
Sequence is contiguous up to 177 with no missing entries.

src/lib/asset-service/service/encodedRelatedAssetIndex.json (1)

1-1: Data-only update approved
Sanity check confirms all keys are integer strings, all values are integer lists, and no duplicates.

scripts/generateAssetData/color-map.json (2)

136-136: LGTM: data-only additions look consistent.

  • Keys follow expected CAIP-2/CAIP-19-ish patterns; addresses lowercase.
  • Values are 6-digit hex colors.
  • File naming meets kebab-case and extension guidelines.

Also applies to: 833-833, 1084-1084, 1122-1122, 1191-1191, 1246-1246, 1439-1439, 1563-1563, 1614-1614, 2628-2628, 3156-3156, 3580-3580, 3821-3821, 4050-4050, 4489-4489, 5008-5008, 5206-5206, 5549-5549, 7404-7404, 7772-7772, 7889-7889, 7908-7908, 8047-8047, 10163-10163, 10382-10382, 11416-11416, 11486-11486, 12184-12184, 12283-12283, 12305-12305, 12639-12639, 12715-12715, 12731-12731, 12737-12737, 12960-12960, 13510-13510, 13723-13723


136-136: Fix malformed keys in color-map.json
Validation failed: 15 malformed keys found in scripts/generateAssetData/color-map.json (e.g. bip122:000000000000000000651ef99cb9fcbe/slip44:145, cosmos:mayachain-mainnet-v1/slip44:931, eip155:1/slip44:60). Update these entries to match the expected eip155:<chainId>/(erc20|bep20):0x<40-hex> format or extend the validator regex to allow slip44-style native asset keys.

⛔ Skipped due to learnings
Learnt from: 0xApotheosis
PR: shapeshift/web#10290
File: scripts/generateAssetData/color-map.json:41-47
Timestamp: 2025-08-17T21:53:03.806Z
Learning: In the ShapeShift web codebase, native assets (using CAIP-19 slip44 namespace like eip155:1/slip44:60, bip122:.../slip44:..., cosmos:.../slip44:...) are manually hardcoded and not generated via the automated asset generation script. Only ERC20/BEP20 tokens go through the asset generation process. The validation scripts should only validate generated assets, not manually added native assets.
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat_regenerate_asset_data

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@gomesalexandre gomesalexandre self-requested a review September 4, 2025 09:35
Copy link
Contributor

@gomesalexandre gomesalexandre left a comment

Choose a reason for hiding this comment

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

@gomesalexandre gomesalexandre merged commit 4c7acaa into develop Sep 4, 2025
4 checks passed
@gomesalexandre gomesalexandre deleted the feat_regenerate_asset_data branch September 4, 2025 12:19
@coderabbitai coderabbitai bot mentioned this pull request Jan 9, 2026
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants