Skip to content

Conversation

@0xean
Copy link
Contributor

@0xean 0xean commented Sep 3, 2025

Generated from CI.

Summary by CodeRabbit

  • Chores
    • Updated token color mappings across multiple networks to improve visual consistency and branding for supported assets.
    • Refreshed the related-asset index to deliver broader and more accurate related asset suggestions.
    • Introduced a migration that clears and rebuilds local asset data to ensure the latest datasets are applied. Users may notice updated token colors, improved related asset recommendations, and a brief re-sync of asset data on first launch after updating.

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

coderabbitai bot commented Sep 3, 2025

📝 Walkthrough

Walkthrough

Data-only updates to asset metadata: expanded and pruned token color mappings in scripts/generateAssetData/color-map.json, a wholesale refresh of related-asset indices in src/lib/asset-service/service/encodedRelatedAssetIndex.json, and a new clearAssets migration entry (version 176) added in src/state/migrations/index.ts.

Changes

Cohort / File(s) Summary
Asset color map data refresh
scripts/generateAssetData/color-map.json
Adds numerous token address-to-hex color mappings across multiple networks and removes several older entries; structure unchanged.
Related asset index regeneration
src/lib/asset-service/service/encodedRelatedAssetIndex.json
Replaces dataset with updated key-to-number[] mappings, introducing new keys and reordered/recomputed relations; JSON shape unchanged.
State migration manifest update
src/state/migrations/index.ts
Adds entry 176: clearAssets to clearAssetsMigrations; no other code or types changed.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant App
  participant StateMigrator as State Migrator
  participant Store as Persisted Store

  User->>App: Launch app
  App->>StateMigrator: Initialize migrations
  StateMigrator->>Store: Read current version
  alt version < 176
    StateMigrator->>Store: Apply migration 176 (clearAssets)
    Note over StateMigrator,Store: Clears asset-related state before loading data
  else version >= 176
    StateMigrator-->>App: No-op for 176
  end
  App->>App: Load refreshed asset data (colors, related indices)
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • NeOMakinG
  • 0xApotheosis

Poem

I hop through hues, a palette wide,
New maps of coins I now provide.
Relations shuffled—indices sing,
Version 176 takes wing.
Cache all cleared, fresh fields to till—
Data sprouts bright on every hill. 🌈🐇


📜 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 10a351f and b0d29e2.

⛔ 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/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_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 (22 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 (3)
src/state/migrations/index.ts (1)

219-220: LGTM: added clearAssets migration 176; consistent with existing pattern

Per retrieved learnings, clearAssetsMigrations runs independently of the root persistConfig version; no additional bumps needed. Keeping this review minimal as this PR is a routine CI asset data regen.

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

1-1: LGTM: data-only refresh; structure unchanged

JSON remains an object of string keys to number[]; schema and semantics preserved. No code paths touched; safe to merge for routine asset data regeneration.

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

511-511: Routine CI asset-color data refresh — LGTM. Script validations ran without errors but didn’t emit the confirmation message; please manually verify shape and values with the script below.

#!/bin/bash
set -euo pipefail
f="scripts/generateAssetData/color-map.json"

# 1) Valid JSON object
jq -e 'type=="object"' "$f"

# 2) All values are 6-digit hex colors
jq -e 'all(.[]; test("^#[0-9A-Fa-f]{6}$"))' "$f"

# 3) Keys match expected schema: eip155:<chainId>/(erc20|bep20):0x<40 lowercase hex>
jq -e 'all(keys[]; test("^eip155:\\d+/(erc20|bep20):0x[0-9a-f]{40}$"))' "$f"

echo "color-map.json: OK"
✨ 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.

Copy link
Member

@0xApotheosis 0xApotheosis left a comment

Choose a reason for hiding this comment

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

Diff sane, runtime check sane

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