Skip to content

feat: regenerate asset data 09/23/2025#10631

Merged
gomesalexandre merged 1 commit intodevelopfrom
feat_regenerate_asset_data
Sep 23, 2025
Merged

feat: regenerate asset data 09/23/2025#10631
gomesalexandre merged 1 commit intodevelopfrom
feat_regenerate_asset_data

Conversation

@0xean
Copy link
Contributor

@0xean 0xean commented Sep 23, 2025

Generated from CI.

Summary by CodeRabbit

  • Style
    • Updated token color palette for many ERC20/BEP20 assets across multiple networks, improving visual consistency in asset displays.
  • Chores
    • Refreshed related-asset mappings, updating relationships and suggestions across a wide range of assets.
    • Added a new state migration entry to align with the updated asset data.

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

coderabbitai bot commented Sep 23, 2025

📝 Walkthrough

Walkthrough

This PR updates two generated data files: token color mappings and the encoded related-asset index. It also adds a new state migration entry mapping index 192 to clearAssets. No code logic or schema changes; only data additions/removals and a migration manifest update.

Changes

Cohort / File(s) Summary
Asset color map updates
scripts/generateAssetData/color-map.json
Added and removed multiple ERC20/BEP20 color mappings across networks (e.g., eip155:1, 56, 42161, 8453, 137). No schema changes; keys/hex values adjusted. Some entries appear duplicated in the diff summary.
Related asset index regeneration
src/lib/asset-service/service/encodedRelatedAssetIndex.json
Regenerated lists of related-asset IDs for many keys. Data reshuffled/updated only; no structural or functional code changes.
State migration manifest
src/state/migrations/index.ts
Added entry 192: clearAssets to clearAssetsMigrations. Existing mappings unchanged.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor App
  participant Store as State Store
  participant Migs as Migrations
  participant Assets as Asset Data

  App->>Migs: Initialize on startup
  Migs->>Store: Get current migration version
  alt version < 192
    Migs->>Store: Apply migration 192 (clearAssets)
    note right of Store: Clears cached assets/indexes
  end
  App->>Assets: Load updated color map and related index
  Assets-->>App: Data ready
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • gomesalexandre
  • 0xApotheosis

Poem

I thump my paws—new hues to see,
Maps refreshed across the chainy sea.
Indices shuffled, neat and spry,
Migration 192 hops right by.
Cache is cleared—hip hop hooray!
Bright tokens bloom for launch today. 🐰🎨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title "feat: regenerate asset data 09/23/2025" concisely and accurately reflects the primary change — regenerated asset data produced by CI. The diff is primarily data updates (color-map.json, encodedRelatedAssetIndex.json, and a migration entry), which matches the title's intent. Including the date is a useful, non-noisy detail for a generated data refresh.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ 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

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • 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 792a20f and e7fe1aa.

⛔ Files ignored due to path filters (11)
  • 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_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 (29 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
  • scripts/generateAssetData/color-map.json
  • src/lib/asset-service/service/encodedRelatedAssetIndex.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 (3)
📓 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.
📚 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
📚 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 ShapeShift web app uses an automated versioning system for Redux Persist migrations. The version is calculated as `Math.max(...Object.keys(clearAssetsMigrations).map(Number))`, which automatically uses the highest migration number as the version. This eliminates the need to manually update persistConfig versions when adding new migrations - the system automatically bumps the version when new migration numbers are added to the migration objects.

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 (31)
src/state/migrations/index.ts (1)

235-235: LGTM: migration 192 added correctly

Adding 192: clearAssets aligns with the auto “max key” versioning pattern; no manual persistConfig bump needed.

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

1-1: LGTM: generated data refresh

JSON structure looks valid; routine asset relationship reindex as expected from CI.

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

1271-1271: LGTM – new mapping added.


1560-1560: LGTM – new mapping added.


2484-2484: LGTM – new mapping added.


3155-3155: LGTM – new mapping added.


3225-3225: LGTM – new mapping added.


4158-4158: LGTM – new mapping added.


4618-4618: LGTM – new mapping added.


5790-5790: LGTM – new mapping added.


7659-7659: LGTM – new mapping added.


8295-8295: LGTM – new mapping added.


8459-8459: LGTM – new mapping added.


8493-8493: LGTM – new mapping added.


8638-8638: LGTM – new mapping added.


9261-9261: LGTM – new mapping added.


9406-9406: LGTM – new mapping added.


9539-9539: LGTM – new mapping added.


9931-9931: LGTM – new mapping added.


10726-10726: LGTM – new mapping added.


11149-11149: LGTM – new mapping added.


11822-11822: LGTM – new mapping added.


12083-12083: LGTM – new mapping added.


12438-12438: LGTM – new mapping added.


12506-12506: LGTM – new mapping added.


12956-12956: LGTM – new mapping added.


13170-13170: LGTM – new mapping added.


13487-13487: LGTM – new mapping added.


13721-13721: LGTM – new mapping added.


14254-14254: LGTM – new mapping added.


237-237: Fix malformed keys in scripts/generateAssetData/color-map.json

JSON parses and has no duplicate keys, but 15 keys do not match the expected asset-id pattern (eip155:/(erc20|bep20):0x<40hex>). Bad keys (15):
bip122:000000000000000000651ef99cb9fcbe/slip44:145
bip122:000000000019d6689c085ae165831e93/slip44:0
bip122:00000000001a91e3dace36e2be3bf030/slip44:3
bip122:12a765e31ffd4059bada1e25190f6e98/slip44:2
cosmos:cosmoshub-4/slip44:118
cosmos:mayachain-mainnet-v1/slip44:931
cosmos:thorchain-1/slip44:931
eip155:1/slip44:60
eip155:10/slip44:60
eip155:100/slip44:60
eip155:137/slip44:60
eip155:42161/slip44:60
eip155:42170/slip44:60
eip155:56/slip44:60
eip155:8453/slip44:60

Action: update the generator to emit canonical asset IDs for token colors (e.g., eip155:/erc20:0x...), or deliberately allow these alternate namespace keys by updating the validator/consumers and documenting the change.

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

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


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

Comment @coderabbitai help to get the list of available commands and usage tips.

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 6364351 into develop Sep 23, 2025
4 checks passed
@gomesalexandre gomesalexandre deleted the feat_regenerate_asset_data branch September 23, 2025 09:24
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