Skip to content

feat(registry)!: remove legacy registry data - #329

Merged
alexander-sei merged 2 commits into
mainfrom
feat/remove-legacy-registry-data
Aug 16, 2026
Merged

feat(registry)!: remove legacy registry data#329
alexander-sei merged 2 commits into
mainfrom
feat/remove-legacy-registry-data

Conversation

@alexander-sei

@alexander-sei alexander-sei commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • update the bundled chain registry to the latest endpoint and wallet metadata
  • remove the deprecated IBC and gas registry APIs, and exclude IBC/ICS-20 assets from the token list
  • align public token, network, and wallet types and exports with the current registry data

Test plan

  • bun run check
  • bun run build
  • bun run test
  • bun run lint:pack:all
  • verify the built registry artifact contains current upstream data with no IBC or gas exports

Align the package with IBC deprecation and the latest upstream chain registry metadata.

Co-authored-by: Cursor <cursoragent@cursor.com>
@codecov-commenter

codecov-commenter commented Aug 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.10%. Comparing base (96d9e1c) to head (c37bf61).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #329      +/-   ##
==========================================
+ Coverage   81.07%   81.10%   +0.02%     
==========================================
  Files          73       72       -1     
  Lines        3752     3757       +5     
==========================================
+ Hits         3042     3047       +5     
  Misses        710      710              
Flag Coverage Δ
mcp-server 77.28% <ø> (ø)
precompiles 100.00% <ø> (ø)
registry 100.00% <100.00%> (ø)
sei-global-wallet 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@seidroid seidroid Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

A clean, well-scoped breaking change: IBC exports and data are removed, the chain-registry submodule is bumped, and WALLETS is added to the package root — all correctly covered by a major changeset, with tsconfig.json and scripts/build-registry.ts updated to match the new import graph. No correctness or security blockers; the notes below are about duplicated filter logic and tests that pin exact upstream submodule values.

Findings: 0 blocking | 10 non-blocking | 5 posted inline

Blockers

  • None at the file/PR level.

Non-blocking

  • The Cursor second-opinion pass produced no output (cursor-review.md is empty); Codex reported no material issues. This review is therefore effectively single-source on the second-opinion axis.
  • I could not verify the new chain-registry submodule contents in this environment (submodules are not checked out and network access was unavailable), so the asserted endpoints, gas prices, and wallet list in the updated tests could not be checked against commit 855440d. Per the repo guidelines on hand-maintained/upstream registry data, worth a maintainer confirming the built artifact matches upstream before merge — the PR test plan says this was done.
  • The IBC-filter predicate (isIbcDenomination / isIbcAsset) and its metadata interface are now duplicated verbatim in packages/registry/src/tokens/index.ts and scripts/build-registry.ts. Both copies are genuinely needed (build-time to shrink the bundled JSON, runtime so bun test src and direct-src consumers see the filtered list), but they must stay in lockstep — a change to one silently diverges dist from src.
  • packages/registry/tsconfig.json now enumerates the chain-registry JSON files by name instead of globbing. That's the right call for excluding ibc_info.json, but it becomes a list that has to be updated by hand whenever a new registry JSON is imported. Low risk since the failure is a loud type error, just worth knowing.
  • The new excludes IBC assets test in src/tokens/__tests__/index.spec.ts re-implements the exact same predicate as isIbcAsset, so it confirms the filter was applied but cannot catch a wrong definition of "IBC asset". Consider asserting against a known-IBC base denom from the asset list instead.
  • 5 suggestion(s)/nit(s) flagged inline on specific lines.

it('contains specific wallet extension by identifier', () => {
const identifierToCheck = 'compass'; // Example identifier
it('contains only the current wallet identifiers', () => {
expect(WALLETS.map(({ identifier }) => identifier)).toEqual(['metamask', 'keplr', 'coin98']);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[suggestion] Exact-array toEqual on upstream submodule data pins both the full set and the ordering of wallets.json. Any wallet added, removed, or reordered upstream fails this test on an otherwise-routine submodule bump, in a package whose whole job is to track upstream. Consider asserting the invariant instead:

const identifiers = WALLETS.map(({ identifier }) => identifier);
expect(identifiers).toEqual(expect.arrayContaining(['metamask', 'keplr', 'coin98']));

Same applies to the CHAIN_INFO.supported_wallets toEqual in chain-info/__tests__/index.spec.ts.


it('contains the current RPC, EVM, and explorer metadata', () => {
const mainnet = NETWORKS['pacific-1'];
expect(mainnet.rpc.some(({ provider, url }) => provider === 'Rhino' && url === 'https://rpc.sei-apis.com')).toBeTrue();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[suggestion] These assertions hardcode specific third-party provider names and URLs (Rhino/rpc.sei-apis.com, dRPC/sei.drpc.org, Seistream). If an upstream provider is swapped or an endpoint domain changes, CI breaks on a data refresh rather than on a code defect. A structural check — every rpc/evm_rpc entry has a non-empty provider and a parseable https:// (or wss://) url, and explorers is non-empty — would catch real regressions without coupling the suite to a specific vendor list.

expect(pacific1.min_gas_price).toBeGreaterThanOrEqual(0.01);
expect(pacific1.module_adjustments.dex.sudo_gas_price).toBeLessThanOrEqual(0.02);
expect(pacific1.min_gas_price).toBe(0.02);
expect(GAS_INFO['atlantic-2'].min_gas_price).toBe(0.08);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[nit] Worth a sanity check on the source: atlantic-2 at 0.08 is 4x the pacific-1 value of 0.02, and a testnet minimum gas price above mainnet's is unusual enough to be worth confirming against gas.json at the new submodule commit before this becomes the pinned expectation. I couldn't verify it here (submodules not checked out). If the values are correct, toBeGreaterThan(0) plus a mainnet-specific exact check would survive future upstream tuning.

Comment thread scripts/build-registry.ts

const isIbcDenomination = (denomination: string): boolean => denomination.toLowerCase().startsWith('ibc/');

const isIbcAsset = (asset: RegistryAssetMetadata): boolean =>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[suggestion] This is a byte-for-byte copy of isIbcAsset / isIbcDenomination / the asset-metadata interface in packages/registry/src/tokens/index.ts. The script already imports CHAIN_IDS from ../packages/registry/src/supported-networks, so it can import the predicate the same way — export isIbcAsset from a shared module (e.g. alongside supported-networks.ts) and have both call sites use it. Otherwise a future change to what counts as an IBC asset gets applied in one place and the bundled dist diverges from the src the tests run against.

coingecko_id?: string;
/** The type of the token, if applicable (e.g., "cw20" for CosmWasm tokens). */
type_token?: string;
type_asset?: string;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[nit] The doc comment still describes the old type_token semantics. type_asset in the Cosmos asset-list schema carries a defined set of values (sdk.coin, cw20, erc20, ics20, …), and ics20 in particular is now the value this package filters on — worth saying so here, since it documents the exclusion rule for consumers.

Stop exporting and bundling obsolete chain gas information from the registry package.

Co-authored-by: Cursor <cursoragent@cursor.com>
@cursor

cursor Bot commented Aug 16, 2026

Copy link
Copy Markdown

PR Summary

High Risk
Major semver bump removes public APIs (IBC_INFO, GAS_INFO) and changes token list contents/types, so downstream apps importing those symbols or IBC assets will break at compile or runtime.

Overview
Breaking change for @sei-js/registry: drops IBC and gas modules entirely (IBC_INFO, GAS_INFO, and related types are no longer exported). TOKEN_LIST is filtered at runtime and in the esbuild bundle so IBC-denom and ICS-20 assets never ship.

Refreshes bundled chain registry data (RPC/EVM/explorers, supported wallets) and re-exports WALLETS from the package root. Token types align with the community asset list: type_asset replaces type_token, and DenomUnit.aliases is optional. Docs and tests now assert current endpoints (e.g. Rhino/dRPC) and wallet set (metamask, keplr, coin98).

Reviewed by Cursor Bugbot for commit c37bf61. Bugbot is set up for automated code reviews on this repo. Configure here.

@seidroid seidroid Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

A clean, well-scoped breaking change to @sei-js/registry with a correct major changeset, no orphaned consumers of the removed exports, and a tsconfig include list that still covers every JSON import. No blockers; the notable non-blocking items are a JSDoc block that now documents an internal const instead of TOKEN_LIST, isIbcAsset duplicated between the build script and package source, and new tests that snapshot upstream submodule data by exact value and order.

Findings: 0 blocking | 9 non-blocking | 5 posted inline

Blockers

  • None at the file/PR level.

Non-blocking

  • Wallet-list shrinkage is worth confirming: the new tests pin WALLETS to exactly ['metamask', 'keplr', 'coin98'] and CHAIN_INFO.supported_wallets to ['keplr', 'coin98'], which means the submodule bump drops Compass Wallet (the old test asserted it was present). Compass is a widely used Sei wallet, and any dApp rendering a picker from WALLETS silently loses it on upgrade. The changeset covers this only as a generic "refresh ... wallets". Please confirm this matches sei-protocol/chain-registry HEAD and, if intentional, call the removal out explicitly in the changeset so it lands in the release notes.
  • The chain-registry / community-assetlist submodules are not checked out in the review environment, so I could not independently verify the refreshed data values (RPC/EVM URLs, explorer names, wallet entries) that the new tests assert against. Per the repo guidelines I'm raising these as questions rather than asserting the values are wrong.
  • The Cursor second-opinion pass produced no output (cursor-review.md is empty), so this review reflects only the Codex pass and my own analysis.
  • The OpenAI Codex pass reported "No material issues found in the pull request diff" — no findings to merge from it.
  • 5 suggestion(s)/nit(s) flagged inline on specific lines.

* ```
*/
export const TOKEN_LIST: SeiTokens = pickSupportedNetworks(TokenListJSON) as unknown as SeiTokens;
const supportedTokenList = pickSupportedNetworks(TokenListJSON);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[suggestion] The TOKEN_LIST JSDoc block (lines 71-84, with the @remarks community-data warning and the @example) is now attached to the internal supportedTokenList const rather than to the exported TOKEN_LIST on line 87. IDE hover and generated docs for the public export will show nothing, and the "verify and filter tokens yourself" warning — the one piece of documentation consumers most need — disappears from the published API surface.

Move the doc block down so it sits directly above export const TOKEN_LIST, and put a short internal comment on supportedTokenList if one is wanted.

Comment thread scripts/build-registry.ts

const isIbcDenomination = (denomination: string): boolean => denomination.toLowerCase().startsWith('ibc/');

const isIbcAsset = (asset: RegistryAssetMetadata): boolean =>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[suggestion] isIbcAsset / isIbcDenomination / the asset-metadata interface are byte-for-byte duplicates of packages/registry/src/tokens/index.ts:12-15. Both copies have to agree or the published bundle (pre-filtered here at build time) and source consumers / the test suite (filtered at runtime in tokens/index.ts) will disagree about what counts as an IBC asset — a drift that nothing in CI would catch, since the tests import the source path only.

This script already imports CHAIN_IDS from ../packages/registry/src/supported-networks; the same trick works here. Export isIbcAsset from the package (or a small shared module) and import it, so there is one definition of the filter.

it('contains specific wallet extension by identifier', () => {
const identifierToCheck = 'compass'; // Example identifier
it('contains only the current wallet identifiers', () => {
expect(WALLETS.map(({ identifier }) => identifier)).toEqual(['metamask', 'keplr', 'coin98']);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[suggestion] This asserts exact array equality and ordering against data vendored from the chain-registry submodule. Same pattern at chain-info/__tests__/index.spec.ts:21 (supported_wallets toEqual ['keplr', 'coin98']) and, more loosely, networks/__tests__/index.spec.ts:32-41 (specific provider names and RPC/WS URLs).

The repo guidelines note the submodule JSON is vendored upstream and that review should target the TypeScript wrappers, not the data. These tests invert that: they turn the suite into an upstream-change detector, so a routine registry refresh that adds a wallet, reorders providers, or rotates an endpoint URL breaks CI on an unrelated PR — with a failure message that points at nothing the author changed.

Suggest asserting the wrapper's contract instead: that WALLETS is non-empty, that every entry has the required fields (already covered by the test above), and expect(identifiers).toContain('keplr') for the specific wallets you care about keeping.

const isIbcDenomination = (denomination: string): boolean => denomination.toLowerCase().startsWith('ibc/');

const isIbcAsset = (asset: AssetMetadata): boolean =>
isIbcDenomination(asset.base) || asset.denom_units.some(({ denom }) => isIbcDenomination(denom)) || asset.type_asset?.toLowerCase() === 'ics20';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[nit] asset.base.toLowerCase() and asset.denom_units.some(...) are unguarded. This runs at module-import time over community-maintained upstream data, so a single asset entry missing base or denom_units throws a TypeError that takes down the whole @sei-js/registry import rather than just skipping that asset. The build script hits the same access first, so it would surface at build time — but as a bare TypeError with no indication of which asset or file is at fault.

asset.base?.toLowerCase() / asset.denom_units?.some(...) (or a ?? []) costs nothing and keeps the failure mode contained.

coingecko_id?: string;
/** The type of the token, if applicable (e.g., "cw20" for CosmWasm tokens). */
type_token?: string;
type_asset?: string;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[nit] The doc comment above still reads (e.g., "cw20" for CosmWasm tokens), carried over from type_token. Under the Cosmos asset-list schema type_asset takes values like sdk.coin, ics20, erc20, and cw20 — worth listing a couple of those, especially since ics20 is now the value the new filter keys off.

@alexander-sei
alexander-sei merged commit 39c277f into main Aug 16, 2026
18 of 19 checks passed
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.

2 participants