Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .changeset/refresh-reviewed-registry-data.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
'@sei-js/registry': minor
---

Refresh the community asset metadata from a reviewed upstream pin, including current non-IBC mainnet assets and retained image metadata.

`TOKEN_LIST` entries now use `RegistryToken`, which narrows `type_asset` from the general optional string to a required upstream-schema asset type. `Token.pointer_contract` exposes optional, typed native/EVM pointer metadata.

Keep source and bundle validation/filtering in sync, and add deterministic release checks for schema fidelity, generated data, submodule cleanliness, and retained image links.
6 changes: 6 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,15 @@ jobs:
- name: Lint, Format & Type Check
run: bun run check

- name: Verify Registry Submodules
run: bun run --cwd packages/registry check:submodules

- name: Build All Packages
run: bun run build

- name: Verify Registry Artifact
run: bun run --cwd packages/registry check:artifact

- name: Test
run: bun run test

Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,15 @@ jobs:
- name: Lint, Format & Type Check
run: bun run check

- name: Verify Registry Submodules
run: bun run --cwd packages/registry check:submodules

- name: Build Packages
run: bun run build

- name: Verify Registry Artifact
run: bun run --cwd packages/registry check:artifact

- name: Test
run: bun run test

Expand Down
27 changes: 26 additions & 1 deletion packages/registry/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# @sei-js/registry
This package contains TypeScript typed exports for the Sei registry repository as well as the community asset-list repository.
Typed Sei network, wallet, chain, and asset metadata.

## Installation
```bash
Expand All @@ -11,5 +11,30 @@ bun add @sei-js/registry
import { TOKEN_LIST, NETWORKS, WALLETS } from '@sei-js/registry'

const sei = TOKEN_LIST['pacific-1'].find(asset => asset.base === 'usei')
const usdt = TOKEN_LIST['pacific-1'].find(asset => asset.symbol === 'USDT')
const nativePointer = usdt?.pointer_contract
const keplr = WALLETS.find(wallet => wallet.identifier === 'keplr')
```

`Token.pointer_contract` is optional. When present, it contains a typed `address` and a `type_asset` of `cw20` or `erc20`, describing the contract that points to the asset in Sei's other runtime. `TOKEN_LIST` entries use the `RegistryToken` subtype, whose `type_asset` is required and restricted to values from the reviewed upstream schema.

## Asset data policy
The community asset list is pinned to reviewed commit `964ca87f7cff8d8791ad1e994628fa410faae61e` from `Seitrace/sei-assetlist`, committed on 2026-02-01. The package does not follow the upstream `main` branch at build or release time.

Only `pacific-1` and `atlantic-2` are exported. Assets are excluded when their base denomination or any denomination unit starts with `ibc/`, or when `type_asset` is `ics20`. The source module and package build use the same validator and filter implementation.

At this pin:
- The upstream supported-network arrays contain 53 mainnet and 9 testnet entries.
- The package retains 46 mainnet and 7 testnet entries after filtering 7 mainnet and 2 testnet IBC/ICS-20 entries.
- The retained image metadata contains 48 unique HTTPS URLs.

This is a community-maintained list. Asset inclusion is not an endorsement; verify contract addresses and metadata for your application.

## Migration notes
The previous asset-list pin was `831406ba8cbe41f3f620c4e7a8ddca67405b5512`. The reviewed refresh is 186 commits ahead and increases the retained mainnet list from 19 to 46 assets while leaving the retained testnet count at 7.

Newly available mainnet metadata includes WSEI, native USDC, USDT0, Stargate WETH, fastUSD/sfastUSD, Frax assets, Fiamma BTC, and USDY. Existing non-IBC native and EVM assets remain available. IBC assets such as USDC.n, USDC.axl, and kavaUSDT remain intentionally absent from `TOKEN_LIST`.

Pointer metadata is now exposed for assets that provide `pointer_contract` upstream. Consumers should treat it as optional and continue identifying an asset by its network and base denomination. Consumers that model exported list entries can use `RegistryToken` for schema-validated `type_asset` values while the general `Token` wrapper remains compatible. Non-fungible assets can have an empty `denom_units` array; do not assume every retained entry has two fungible denomination units.

The reviewed upstream pin also restores the USDY SVG metadata and other retained image links. See [RUNBOOK.md](./RUNBOOK.md) for repinning, schema, artifact, package, and live image-link verification.
137 changes: 135 additions & 2 deletions packages/registry/RUNBOOK.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,135 @@
### Init submodules
`git submodule update --init --recursive`
# Registry release runbook

Run commands from the repository root unless a step says otherwise.

## Initialize and inspect submodules
```bash
git submodule update --init --recursive
bun run --cwd packages/registry check:submodules
```

The current reviewed community asset-list values are:
- Remote: `https://github.com/Seitrace/sei-assetlist.git`
- Commit: `964ca87f7cff8d8791ad1e994628fa410faae61e`
- Author and commit date: VuTran1902, 2026-02-01T10:49:02+07:00
- Relationship to the previous `831406ba8cbe41f3f620c4e7a8ddca67405b5512` pin: descendant, 186 commits ahead

`check:submodules` parses each stage-0 gitlink OID from the index and requires the initialized checkout to be at that exact OID with a clean worktree and the expected configured/origin remote. The community gitlink and checkout must also equal the reviewed revision above. A release must not bundle an unstaged gitlink update or local submodule edits.

Registry package and root unit tests are hermetic and do not inspect live git state. The Checks and Release workflows enforce this repository check explicitly before building; both workflows must continue using `actions/checkout` with `submodules: recursive`. They also run `check:artifact` immediately after the build.

## Review and repin the community asset list
Never update the gitlink by blindly checking out a moving branch. Review a candidate commit and then check out its full SHA.

```bash
assetlist=packages/registry/community-assetlist
previous=$(git -C "$assetlist" rev-parse HEAD)

git config --file .gitmodules --get submodule.packages/registry/community-assetlist.url
git -C "$assetlist" remote -v
git ls-remote --symref https://github.com/Seitrace/sei-assetlist.git HEAD refs/heads/main
git -C "$assetlist" fetch origin main

candidate=<full-reviewed-sha>
git -C "$assetlist" show -s --format='%H%n%aI%n%cI%n%an <%ae>%n%s' "$candidate"
git -C "$assetlist" merge-base --is-ancestor "$previous" "$candidate"
git -C "$assetlist" rev-list --count "$previous..$candidate"
git -C "$assetlist" log --reverse --format='%h %cs %s' "$previous..$candidate"
git -C "$assetlist" diff --stat "$previous..$candidate"
git -C "$assetlist" diff "$previous..$candidate" -- assetlist.json schema/assetlist.json
```

Review all supported-network additions, removals, contract addresses, `type_asset` values, `pointer_contract` objects, denomination units, and image URL changes. Record the candidate's exact SHA and commit date in the release change. Only after review:

```bash
git -C "$assetlist" checkout --detach "$candidate"
```

At this point the checkout has moved but the index gitlink has not. `check:submodules` must fail with both OIDs until the reviewed gitlink is staged. For the current remediation, the expected pre-stage mismatch is recorded `831406ba8cbe41f3f620c4e7a8ddca67405b5512` versus checkout/reviewed `964ca87f7cff8d8791ad1e994628fa410faae61e`.

After review, stage only the intended gitlink and verify the exact recorded value before running release checks:

```bash
git add packages/registry/community-assetlist
git ls-files --stage -- packages/registry/community-assetlist packages/registry/chain-registry
git diff --cached --submodule=short -- packages/registry/community-assetlist
bun run --cwd packages/registry check:submodules
```

The community index entry must be mode `160000`, stage `0`, and OID `964ca87f7cff8d8791ad1e994628fa410faae61e`. The chain-registry index OID and checkout must remain `855440d90df49246498d0870c6be5de5af56dada`. Update `REVIEWED_ASSETLIST_REVISION`, deterministic counts and canonical fixtures, every documented source/retained/filtered/pointer/image count in the README and runbook, and the changeset in the same change.

## Validate schema and filtering
The package validator checks every upstream network entry for the public token shape, allowed asset types, denomination field types, image metadata, and pointer metadata. The deterministic tests then verify supported networks, source and retained counts, canonical assets, IBC/ICS-20 removal, and source/runtime parity.

```bash
bun run --cwd packages/registry test
bun run typecheck
```

Also review the upstream Draft-07 schema itself. At the current pin, that schema requires exactly two denomination units for every token, but upstream's `ForU AI Genesis` ERC-721 intentionally has an empty `denom_units` array. The package retains this non-IBC asset and validates its fields while allowing the non-fungible exception. Do not rewrite pinned upstream metadata during packaging, and do not generalize this exception to malformed fungible assets without a separate review.

Unknown fields, unknown enum values, and missing current required fields intentionally fail at import and build time. A reviewed pin should never silently discard or broaden newly introduced metadata: update the public types, validator, tests, and documentation as one reviewed change. Runtime validation is deliberately retained so source execution and the generated bundle enforce the same schema.

The source and esbuild plugin share `filterTokenList`; both reject malformed fields and remove an asset if:
- `base` starts with `ibc/`, case-insensitively;
- any denomination-unit `denom` starts with `ibc/`; or
- `type_asset` is `ics20`, case-insensitively.

The current reviewed source has 53 `pacific-1` and 9 `atlantic-2` entries. The package must retain 46 and 7 respectively, filtering 7 and 2 IBC/ICS-20 entries. No other network key may appear at runtime.

## Build and compare the generated artifact
```bash
bun run --cwd packages/registry build
bun run --cwd packages/registry check:artifact
bun test --isolate scripts/registry-release.test.ts
```

`check:artifact` imports the generated ESM bundle and deep-compares `TOKEN_LIST` with a fresh validation and filtering pass over the pinned submodule source.

The release-script tests use simulated git command results for exact gitlinks, wrong recorded OIDs, mismatched checkouts, dirty worktrees, missing/uninitialized worktrees, and remote mismatches. They also test image retry behavior with injected responses. They do not inspect current git state, build packages, mutate `dist`, or make network requests:

```bash
bun test --isolate scripts/registry-release.test.ts
```

## Verify retained image links
Ordinary unit tests validate URL shape and deterministic URL collection without contacting external hosts. Run the live check explicitly for every release:

```bash
bun run --cwd packages/registry check:images
```

The checker probes every unique retained PNG/SVG URL with bounded concurrency and a timeout. A 429 or 5xx response receives one bounded retry after a short backoff; a second failure remains a hard error. It reports each final HTTP status or network failure and exits nonzero if any URL fails. Record the number of URLs checked and the result in the release evidence. The current reviewed pin has 48 unique retained image URLs.

Remediation verification on 2026-08-22: all 48 retained image URLs returned successful HTTP responses.

## Verify package quality
```bash
bun run --cwd packages/registry build
(cd packages/registry && bun run publint --pack npm --strict --level warning)
(cd packages/registry && bun run attw --pack . --profile esm-only)
node --input-type=module -e "import('./packages/registry/dist/index.js').then(({ TOKEN_LIST }) => console.log(Object.fromEntries(Object.entries(TOKEN_LIST).map(([network, assets]) => [network, assets.length]))))"
(cd packages/registry && npm pack --dry-run --json)
```

The dry run should contain only package metadata and `dist`; it must not contain either submodule, source data, tests, or operational scripts. `package.json` must not add `prepare`, `prepack`, `postinstall`, or other install/submodule lifecycle hooks.

## Full repository verification
```bash
bun run check
bun run --cwd packages/registry check:submodules
bun run build
bun run --cwd packages/registry check:artifact
bun run test
git -C packages/registry/community-assetlist status --short
git -C packages/registry/chain-registry status --short
git status --short
```

The full manual release-data gate runs the submodule check once, then build, hermetic unit tests, artifact comparison, and live image verification:

```bash
bun run --cwd packages/registry verify:release-data
```

Before release, confirm the only registry changes are the reviewed gitlink, intended source/tests/docs/scripts, workflows, and changeset. Re-run the live image check close to publication because external URL health can change independently of the pinned JSON.
2 changes: 1 addition & 1 deletion packages/registry/community-assetlist
6 changes: 5 additions & 1 deletion packages/registry/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@
"build": "rm -rf dist && bun run build:types && bun run build:esm",
"build:types": "tsc --project ./tsconfig.json && printf \"export * from './src/index.js';\\n\" > dist/index.d.ts && bun ../../scripts/fix-dts-extensions.ts dist",
"build:esm": "bun ../../scripts/build-registry.ts",
"test": "bun test --isolate src"
"check:artifact": "bun ../../scripts/check-registry-artifact.ts",
"check:images": "bun ../../scripts/check-registry-images.ts",
"check:submodules": "bun ../../scripts/check-registry-submodules.ts",
"test": "bun test --isolate src",
"verify:release-data": "bun run check:submodules && bun run build && bun run test && bun run check:artifact && bun run check:images"
},
"exports": {
".": {
Expand Down
Loading
Loading