Skip to content

feat: regenerate asset data 08/21/2025#10332

Merged
NeOMakinG merged 1 commit intodevelopfrom
feat_regenerate_asset_data
Aug 21, 2025
Merged

feat: regenerate asset data 08/21/2025#10332
NeOMakinG merged 1 commit intodevelopfrom
feat_regenerate_asset_data

Conversation

@0xean
Copy link
Contributor

@0xean 0xean commented Aug 21, 2025

Generated from CI.

Summary by CodeRabbit

  • New Features
    • Expanded token color coverage for many additional tokens across major networks, improving visual consistency in the UI.
    • Refreshed related-asset recommendations with updated relationships for broader and more accurate suggestions.
  • Chores
    • Performed a background asset data migration to ensure the latest mappings are applied; no user action required.

@0xean 0xean requested a review from a team as a code owner August 21, 2025 09:06
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 21, 2025

📝 Walkthrough

Walkthrough

Updates asset data files: adds/removes ERC20 color mappings in color-map.json; fully regenerates encoded related-asset index; and appends a new clearAssets migration (166) to the state migration manifest.

Changes

Cohort / File(s) Summary
Asset color mappings
scripts/generateAssetData/color-map.json
Expanded and pruned ERC20-to-color entries across multiple networks; data-only updates.
Related asset index
src/lib/asset-service/service/encodedRelatedAssetIndex.json
Replaced entire mapping with newly generated related-asset ID arrays; format unchanged.
State migration manifest
src/state/migrations/index.ts
Added migration entry 166: clearAssets; existing entries retained.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor App as App Startup
  participant MR as MigrationRunner
  participant Store as State Store
  participant AS as AssetService

  App->>MR: Run pending migrations
  MR->>Store: Apply 0..165
  MR->>Store: Apply 166: clearAssets
  Note right of MR: New step added in this PR

  MR-->>App: Migrations complete
  App->>AS: Load asset data
  AS-->>App: color-map + encodedRelatedAssetIndex loaded
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Suggested reviewers

  • 0xApotheosis
  • gomesalexandre

Poem

A hop, a skip, new colors bloom bright,
Indices realigned in moonlit byte-light.
Migration 166 sweeps burrows clean,
Fresh maps await where tokens convene.
Thump-thump! I commit with whiskered pride—
Data fields tidied, onward we glide. 🐇✨

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ 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 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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
src/state/migrations/index.ts (1)

42-210: Optional: generate this monotonous mapping to avoid manual increments.

If desired, replace the literal 0..166 object with a small helper to eliminate off-by-one risks during daily bumps.

Proposed diff within this file:

-export const clearAssetsMigrations = {
-  0: clearAssets,
-  1: clearAssets,
-  2: clearAssets,
-  ...
-  165: clearAssets,
-  166: clearAssets,
-} as unknown as Omit<MigrationManifest, '_persist'>
+export const clearAssetsMigrations = Object.fromEntries(
+  Array.from({ length: 166 + 1 }, (_, i) => [i, clearAssets])
+) as unknown as Omit<MigrationManifest, '_persist'>

If you prefer stronger typing, add this helper above the exports:

const makeClearMigrations = (last: number) =>
  Object.fromEntries(Array.from({ length: last + 1 }, (_, i) => [i, clearAssets])) as unknown as Omit<MigrationManifest, '_persist'>
// usage:
// export const clearAssetsMigrations = makeClearMigrations(166)
scripts/generateAssetData/color-map.json (1)

184-14075: Adjust validation to exempt manually maintained native assets

The current script fails because it treats all /slip44: entries as errors, but per team conventions native assets (CAIP-19 slip44 entries) are manually hardcoded and should not be validated by the CI‐generated asset checks. Update the validation script to:

  • Skip any /slip44: keys (manual native assets) instead of erroring
  • Only run key‐format, address, color, and /bep20 checks against ERC20/BEP20 entries

Locations to update:

  • scripts/generateAssetData/color-map.json validation block in your review comment

Suggested diff for the review comment’s script:

 # 2) Ensure no native slip44 entries are present in this generated map
-if rg -n "/slip44:" "$file" >/dev/null; then
-  echo "ERROR: Found slip44 native assets in color-map.json (should be excluded from generated data)."
-  rg -n "/slip44:" "$file"
-  exit 1
-fi
+# Step 2 is skipped: native assets (slip44) are manually maintained and exempt from CI validation

 # 3) Validate keys follow eip155:<chainId>/(erc20|bep20):0x<40 lowercase hex>

With this change, the script will only enforce format and conventions on generated tokens and leave native slip44 entries untouched.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
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 b4dc92a and f3364fc.

⛔ Files ignored due to path filters (7)
  • packages/caip/src/adapters/coincap/generated/eip155_1/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_137/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 (30 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: 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.
📚 Learning: 2025-08-17T21:53:03.806Z
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.

Applied to files:

  • scripts/generateAssetData/color-map.json
🧬 Code graph analysis (1)
src/state/migrations/index.ts (1)
src/state/migrations/clearAssets.ts (1)
  • clearAssets (6-8)
🔇 Additional comments (33)
src/state/migrations/index.ts (1)

209-210: LGTM: Migration 166 correctly added – contiguity and version sync validated.

  • clearAssetsMigrations contains keys 0 through 166 (167 entries) with no gaps or duplicates.
  • assetsPersistConfig.version computes Math.max(...Object.keys(clearAssetsMigrations).map(Number)), resolving to 166.

This aligns with our routine daily “feat: regenerate asset data” PRs.
If you’d like me to auto-skip future regen PRs via coderabbitai ignore, just let me know.

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

187-187: Routine ERC20 color addition – LGTM.
Key format and hex color look consistent with existing entries.


426-426: Routine ERC20 color addition – LGTM.
Consistent CAIP-19 key and 6-digit uppercase hex color.


993-993: Routine ERC20 color addition – LGTM.
Lowercased address and color format align with file conventions.


1446-1446: Routine ERC20 color addition – LGTM.
No issues spotted with key or color formatting.


1459-1459: Routine ERC20 color addition – LGTM.
CAIP-19 path and color are valid.


2772-2772: Routine ERC20 color addition – LGTM.
Formatting consistent; nothing actionable.


3231-3231: Routine ERC20 color addition – LGTM.
Address casing and color code conform to conventions.


3341-3341: Routine ERC20 color addition – LGTM.
No anomalies detected.


3910-3910: Routine ERC20 color addition – LGTM.
Key namespace and color are well-formed.


4397-4397: Routine ERC20 color addition – LGTM.
Matches established formatting; approve.


4436-4436: Routine ERC20 color addition – LGTM.
Consistent with surrounding entries.


4732-4732: Routine ERC20 color addition – LGTM.
Color hex and key look correct.


5712-5712: Routine ERC20 color addition – LGTM.
Formatting and style consistent.


5716-5716: Note: Same token color reused across chains – confirm intent.
This address also appears on other networks in this PR mapped to the same color (#764CEF). If that’s intentional for brand consistency, all good.


7301-7301: Routine Polygon ERC20 color addition – LGTM.
CAIP-19 path and color are valid.


7545-7545: Routine Arbitrum ERC20 color addition – LGTM.
Nothing concerning; consistent formatting.


7750-7750: Routine Arbitrum ERC20 color addition – LGTM.
Address/color formatting matches conventions.


8970-8970: Note: Cross-chain same address/color – verify consistency is desired.
Same address/color appears on L1 and AVAX. Assuming CREATE2/same-address deploys, this is fine; just confirming it’s intentional.


9410-9410: Routine BSC BEP20 color addition – LGTM.
Key uses /bep20 under eip155:56 as expected.


9515-9515: Routine BSC BEP20 color addition – LGTM.
No issues spotted.


10254-10254: Routine BSC BEP20 color addition – LGTM.
Formatting and casing consistent.


10345-10345: Routine BSC BEP20 color addition – LGTM.
CAIP-19 key and color are valid.


11060-11060: Routine BSC BEP20 color addition – LGTM.
No anomalies detected.


11491-11491: Routine BSC BEP20 color addition – LGTM.
Consistent with surrounding entries.


12539-12539: Routine Base ERC20 color addition – LGTM.
Key and color formatting look correct.


12813-12813: Routine Base ERC20 color addition – LGTM.
Address casing and color are correct.


13330-13330: Routine Base ERC20 color addition – LGTM.
Nothing actionable here.


13366-13366: Routine Base ERC20 color addition – LGTM.
Formatting checks out.


13664-13664: Routine Base ERC20 color addition – LGTM.
CAIP-19 path and color are valid.


13994-13994: Routine Base ERC20 color addition – LGTM.
Address/color formatting consistent.


14002-14002: Routine Base ERC20 color addition – LGTM.
No issues spotted.


14072-14072: Routine Base ERC20 color addition – LGTM.
Same address/color appears on Polygon (Line 7301) as well; assuming intentional brand consistency across chains.

Copy link
Collaborator

@NeOMakinG NeOMakinG left a comment

Choose a reason for hiding this comment

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

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.

3 participants