-
Notifications
You must be signed in to change notification settings - Fork 50
feat(registry)!: remove legacy registry data #329
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| --- | ||
| '@sei-js/registry': major | ||
| --- | ||
|
|
||
| Remove IBC and gas data from the registry package. `IBC_INFO`, `ChannelInfo`, `GAS_INFO`, `ChainGasInfo`, and `ModuleAdjustments` are no longer exported, and `TOKEN_LIST` no longer contains IBC or ICS-20 assets. | ||
|
|
||
| Refresh the bundled chain registry data with current network endpoints, explorers, and wallets. `WALLETS` is now available from the package root. | ||
|
|
||
| Align token metadata types with the community asset list: `Token.type_asset` replaces the non-runtime `Token.type_token` field, and `DenomUnit.aliases` is optional. |
| +22 −0 | .github/workflows/ai-assist.yml | |
| +26 −0 | .github/workflows/ai-review.yml | |
| +10 −1 | README.md | |
| +0 −735 | assetlist.json | |
| +1 −1 | chain_info.json | |
| +163 −45 | chains.json | |
| +4 −32 | gas.json | |
| +0 −84 | ibc_info.json | |
| + − | images/sei.png | |
| +8 −0 | images/sei.svg | |
| +0 −96 | schema/assetlist.json | |
| +8 −0 | schema/chains.json | |
| +0 −21 | schema/gas.json | |
| +0 −43 | schema/ibc_info.json | |
| +71 −8 | schema/validate.py | |
| +1 −1 | schema/wallets.json | |
| +2 −23 | wallets.json |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,6 @@ | ||
| export * from './chain-info'; | ||
| export * from './gas'; | ||
| export * from './ibc'; | ||
| export * from './networks'; | ||
| export type { Network } from './supported-networks'; | ||
| export { CHAIN_IDS } from './supported-networks'; | ||
| export * from './tokens'; | ||
| export * from './wallets'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,23 +1,36 @@ | ||
| import TokenListJSON from '../../community-assetlist/assetlist.json'; | ||
| import { type Network, pickSupportedNetworks } from '../supported-networks'; | ||
|
|
||
| interface AssetMetadata { | ||
| base: string; | ||
| denom_units: readonly { | ||
| denom: string; | ||
| }[]; | ||
| type_asset?: string; | ||
| } | ||
|
|
||
| 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'; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [nit]
|
||
|
|
||
| /** | ||
| * DenomUnit represents a struct that describes a given | ||
| * denomination unit of the basic token. | ||
| */ | ||
| export interface DenomUnit { | ||
| /** denom represents the string name of the given denom unit (e.g uatom). */ | ||
| /** denom represents the string name of the given denom unit (e.g. usei). */ | ||
| denom: string; | ||
| /** | ||
| * exponent represents power of 10 exponent that one must | ||
| * raise the base_denom to in order to equal the given DenomUnit's denom | ||
| * 1 denom = 10^exponent base_denom | ||
| * (e.g. with a base_denom of uatom, one can create a DenomUnit of 'atom' with | ||
| * exponent = 6, thus: 1 atom = 10^6 uatom). | ||
| * (e.g. with a base_denom of usei, one can create a DenomUnit of 'sei' with | ||
| * exponent = 6, thus: 1 sei = 10^6 usei). | ||
| */ | ||
| exponent: number; | ||
| /** aliases is a list of string aliases for the given denom */ | ||
| aliases: string[]; | ||
| /** aliases is an optional list of string aliases for the given denom */ | ||
| aliases?: string[]; | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -44,7 +57,7 @@ export interface Token { | |
| /** An optional identifier for the token on the CoinGecko platform. */ | ||
| coingecko_id?: string; | ||
| /** The type of the token, if applicable (e.g., "cw20" for CosmWasm tokens). */ | ||
| type_token?: string; | ||
| type_asset?: string; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [nit] The doc comment still describes the old There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [nit] The doc comment above still reads |
||
| } | ||
|
|
||
| /** | ||
|
|
@@ -56,7 +69,7 @@ type SeiTokens = { | |
| }; | ||
|
|
||
| /** | ||
| * A constant that maps each Sei networks to its respective tokens, imported from the community ran [assetlist](https://github.com/Seitrace/sei-assetlist). | ||
| * A constant that maps each Sei network to its respective tokens, imported from the community-run [asset list](https://github.com/Seitrace/sei-assetlist). | ||
| * | ||
| * @remarks | ||
| * **Important**: This token list is community-driven and subject to change. | ||
|
|
@@ -66,7 +79,11 @@ type SeiTokens = { | |
| * ```tsx | ||
| * import { TOKEN_LIST } from '@sei-js/registry'; | ||
| * | ||
| * const uSei = TOKEN_LIST['pacific-1'].find((asset) => asset.symbol === 'sei'); | ||
| * const uSei = TOKEN_LIST['pacific-1'].find((asset) => asset.symbol === 'SEI'); | ||
| * ``` | ||
| */ | ||
| export const TOKEN_LIST: SeiTokens = pickSupportedNetworks(TokenListJSON) as unknown as SeiTokens; | ||
| const supportedTokenList = pickSupportedNetworks(TokenListJSON); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [suggestion] The Move the doc block down so it sits directly above |
||
|
|
||
| export const TOKEN_LIST: SeiTokens = Object.fromEntries( | ||
| Object.entries(supportedTokenList).map(([network, assets]) => [network, assets.filter((asset) => !isIbcAsset(asset))]) | ||
| ) as unknown as SeiTokens; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| import { WALLETS, type Wallet } from '../index'; | ||
| import { WALLETS } from '../../index'; | ||
|
|
||
| describe('Wallet Extensions Configuration Tests', () => { | ||
| it('contains an array of wallet extensions', () => { | ||
|
|
@@ -15,14 +15,19 @@ describe('Wallet Extensions Configuration Tests', () => { | |
| } | ||
| }); | ||
|
|
||
| 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']); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [suggestion] Exact-array const identifiers = WALLETS.map(({ identifier }) => identifier);
expect(identifiers).toEqual(expect.arrayContaining(['metamask', 'keplr', 'coin98']));Same applies to the There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 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 |
||
| }); | ||
|
|
||
| it('contains the Keplr wallet metadata', () => { | ||
| const identifierToCheck = 'keplr'; | ||
| const extension = WALLETS.find((ext) => ext.identifier === identifierToCheck); | ||
| expect(extension).toBeDefined(); | ||
| if (extension) { | ||
| expect(extension.name).toBe('Compass Wallet'); | ||
| expect(extension.url).toBe('https://compasswallet.io/'); | ||
| expect(extension.name).toBe('Keplr Wallet'); | ||
| expect(extension.url).toBe('https://www.keplr.app'); | ||
| expect(extension.capabilities).toContain('native'); | ||
| expect(extension.capabilities).toContain('evm'); | ||
| } | ||
| }); | ||
| }); | ||
There was a problem hiding this comment.
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 — everyrpc/evm_rpcentry has a non-emptyproviderand a parseablehttps://(orwss://)url, andexplorersis non-empty — would catch real regressions without coupling the suite to a specific vendor list.