Skip to content

feat: regenerate asset data 09/20/2025#10613

Merged
0xApotheosis merged 1 commit intodevelopfrom
feat_regenerate_asset_data
Sep 21, 2025
Merged

feat: regenerate asset data 09/20/2025#10613
0xApotheosis merged 1 commit intodevelopfrom
feat_regenerate_asset_data

Conversation

@0xean
Copy link
Contributor

@0xean 0xean commented Sep 20, 2025

Generated from CI.

Summary by CodeRabbit

  • Chores
    • Updated token color mappings across multiple networks for improved visual consistency.
    • Refreshed related-asset index to update associations and improve suggestion/grouping accuracy.
    • Added a new state migration entry to clear cached asset data on upgrade so users see the latest mappings and relationships.

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

coderabbitai bot commented Sep 20, 2025

📝 Walkthrough

Walkthrough

Data-only regeneration: updated token color mappings in the color-map, replaced large portions of the related-asset index JSON, and added migration entry 190 -> clearAssets. No API, types, or exported signatures changed.

Changes

Cohort / File(s) Summary
Asset color map updates
scripts/generateAssetData/color-map.json
Removed many existing ERC20-specific color entries and added numerous new ERC20 address color mappings across multiple chains; new hex color values (e.g., #C0CBF3) introduced for many addresses.
Related-asset index regeneration
src/lib/asset-service/service/encodedRelatedAssetIndex.json
Replaced large portions of mapping payloads: arrays of related asset IDs were extensively re-sequenced, added, and removed across many keys; JSON structure unchanged.
State migration bump
src/state/migrations/index.ts
Extended clearAssetsMigrations by adding 190: clearAssets.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor App as App Startup
  participant MM as MigrationManager
  participant Store as LocalStore
  participant AS as AssetService

  App->>MM: initialize()
  MM->>Store: getMigrationVersion()
  alt version < 190
    MM->>Store: clearAssets()        %% new migration 190 triggers clear
    Note right of Store: assets cleared and refreshed
    Store-->>MM: ok
    MM->>Store: setMigrationVersion(190)
  else version ≥ 190
    MM-->>App: no-op
  end

  App->>AS: loadAssets()
  AS-->>App: assets (from regenerated data)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • 0xApotheosis
  • NeOMakinG

Poem

I hop through JSON, nibble keys,
Paint tokens bright with pastel ease.
I bump the version, sweep the nest,
New maps in place — now let them rest.
Thump-thump, I merge — a rabbit's best. 🥕🐰

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/20/2025" clearly and succinctly describes the primary change (regenerating asset data) and aligns with the diff summaries showing updates to color-map.json, encodedRelatedAssetIndex.json, and a migration entry; it is specific, concise, and readable for history scanning. The inclusion of the date is informational and does not make the title misleading or unrelated to the changeset.
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 e3039ca and 48d8385.

⛔ Files ignored due to path filters (12)
  • 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_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 (34 hunks)
  • src/lib/asset-service/service/encodedRelatedAssetIndex.json (1 hunks)
  • src/state/migrations/index.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/state/migrations/index.ts
🧰 Additional context used
📓 Path-based instructions (1)
**/*

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

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

Files:

  • scripts/generateAssetData/color-map.json
  • src/lib/asset-service/service/encodedRelatedAssetIndex.json
🧠 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.
📚 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
🔇 Additional comments (4)
src/lib/asset-service/service/encodedRelatedAssetIndex.json (3)

1-1: Routine asset index refresh — LGTM

Data-only regeneration; JSON is well‑formed and structure unchanged. Based on prior learnings for “feat: regenerate asset data” PRs, keeping review light. Consider adding “coderabbitai ignore” next time to skip automated reviews for these daily updates.


1-1: Rename file to kebab-case — encoded-related-asset-index.json

Repo guideline requires kebab-case; rename this file and update all imports/consumers, or skip if generator/tooling requires the exact path. ripgrep search for "encodedRelatedAssetIndex.json" returned "No files were searched" (rg skipped files); unable to verify blast radius — manual confirmation of consumers required.


1-1: Schema sanity check — OK
src/lib/asset-service/service/encodedRelatedAssetIndex.json is valid JSON; top-level keys are numeric strings and every value is a non-empty array of integers. Stats: Keys: 1364; Total relations: 3654; Largest array length: 8.

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

1700-1700: Routine asset-data regen: LGTM. Please run the quick validator.

Mappings look consistent (ERC20/BEP20 only; kebab-case filename OK). As usual for these CI-generated updates, just sanity-check JSON integrity, duplicates, key format, and hex colors.

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

# 1) Basic JSON validity
jq type "$f" >/dev/null

# 2) Validate keys (eip155 only; erc20/bep20), colors, and detect duplicate keys
python - <<'PY'
import json, re, sys
from collections import Counter

path = "scripts/generateAssetData/color-map.json"
key_re = re.compile(r'^eip155:\d+/(erc20|bep20):0x[0-9a-f]{40}$')
col_re = re.compile(r'^#[0-9A-Fa-f]{6}$')

dups = []
errors = []

def hook(pairs):
  keys = [k for k,_ in pairs]
  c = Counter(keys)
  for k, n in c.items():
    if n > 1:
      dups.append(k)
  return dict(pairs)

with open(path, "r", encoding="utf-8") as fh:
  data = json.load(fh, object_pairs_hook=hook)

for k, v in data.items():
  if not key_re.match(k):
    errors.append(f"Bad key format: {k}")
  if not isinstance(v, str) or not col_re.match(v):
    errors.append(f"Bad color value for {k}: {v}")

if dups:
  print("Duplicate keys detected:", *dups, sep="\n- ")
if errors:
  print("Validation errors:", *errors, sep="\n- ")

if dups or errors:
  sys.exit(1)
print("color-map.json validation OK")
PY

Optional: since these are daily CI diffs, consider tagging these PRs with an auto-skip label to bypass deep review.

Also applies to: 1794-1794, 2303-2303, 2925-2925, 2945-2945, 3133-3133, 3984-3984, 4207-4207, 4635-4635, 4835-4835, 5073-5073, 5948-5948, 5954-5954, 7605-7605, 7705-7705, 8245-8245, 8533-8533, 8853-8853, 9606-9606, 9848-9848, 9866-9866, 11049-11049, 11544-11544, 12256-12256, 12479-12479, 12955-12955, 13244-13244, 13291-13291, 13522-13522, 13632-13632, 13637-13637, 13726-13726, 13981-13981, 14308-14308, 14354-14354, 14370-14370


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

@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

📜 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 93074c5 and e3039ca.

⛔ Files ignored due to path filters (12)
  • packages/caip/src/adapters/coincap/generated/eip155_1/adapter.json is excluded by !**/generated/**
  • packages/caip/src/adapters/coincap/generated/eip155_10/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/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_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
  • 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 (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 (25)
src/state/migrations/index.ts (1)

233-233: Migration 190 added to clearAssetsMigrations — LGTM

Matches the established pattern; no persistConfig bump needed per the clearAssetsMigrations system.

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

1-1: Asset relation index regenerated — LGTM

Data-only update; structure unchanged.

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

1798-1798: LGTM.

Consistent address casing and hex color format.


2307-2307: LGTM.

New ERC-20 mapping follows existing conventions.


2702-2702: LGTM.

Key format and color are valid.


2949-2949: LGTM.

No structural or formatting issues.


3137-3137: LGTM.

Addition matches chain:1 ERC-20 schema.


3988-3988: LGTM.

Color value is valid 6‑digit hex.


4639-4639: LGTM.

Arbitrum/ETH consistency unaffected.


4839-4839: LGTM.

No duplication nearby; value format OK.


5953-5953: LGTM.

Valid hex color; retains JSON ordering.


5959-5959: LGTM.

New entry aligns with neighboring entries.


7710-7710: LGTM.

Arbitrum address + color look correct.


8536-8536: LGTM.

No issues spotted for chain 42161 mapping.


8856-8856: LGTM.

Avalanche C‑Chain mapping conforms.


9609-9609: LGTM.

BEP‑20 entry and color format valid.


9851-9851: LGTM.

No conflicts; value within palette norms.


11052-11052: LGTM.

Lowercase address and 6‑digit color checked.


13244-13244: LGTM.

Base chain key format and color OK.


13521-13521: LGTM.

Addition follows existing Base entries.


13631-13631: LGTM.

No schema or style issues.


13636-13636: LGTM.

Color code valid; no adjacent duplicates.


13725-13725: LGTM.

Entry consistent with chain 8453 conventions.


13980-13980: LGTM.

Key/value formatting looks correct.


14352-14352: LGTM.

No concerns; safe to merge with data regen.

@github-actions github-actions bot force-pushed the feat_regenerate_asset_data branch from e3039ca to 48d8385 Compare September 21, 2025 09:08
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.

@0xApotheosis 0xApotheosis merged commit 9d29465 into develop Sep 21, 2025
1 check passed
@0xApotheosis 0xApotheosis deleted the feat_regenerate_asset_data branch September 21, 2025 22:49
@coderabbitai coderabbitai bot mentioned this pull request Jan 21, 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.

3 participants