Skip to content

fix(statics): pre-populate static networkFeatureMapForTokens for EVM families - #10147

Merged
nayandas190 merged 1 commit into
masterfrom
nayanjyotidas/cecho-2706-bitgojs-statics-pre-populate-static
Nov 10, 2026
Merged

nayandas190 merged 1 commit into
masterfrom
nayanjyotidas/cecho-2706-bitgojs-statics-pre-populate-static

Conversation

@nayandas190

Copy link
Copy Markdown
Contributor

Description

When the automated AMS token onboarding bot (ams-bot-tokens) adds the first token for an EVM chain into modules/statics/src/coins/botTokens.ts, botTokens.ts calls getTokenFeatures('<family>', [...]) at module load time.

Because coins.ts imports allCoinsAndTokens.ts -> coins/botTokens.ts before calling registerErc20Families(), any SUPPORTS_ERC20 EVM family not statically present in networkFeatureMapForTokens resolves getTokenFeatures(family) without account-model and throws MissingRequiredCoinFeatureError at module load (which previously required manual patches for baseeth, flow, okbxlayer, hoodeth, and chiliz).

This PR:

  • Statically lists all 34 mainnet SUPPORTS_ERC20 EVM families in networkFeatureMapForTokens in modules/statics/src/networkFeatureMapForTokens.ts (EVM_TOKEN_FEATURES for EIP-1559 chains and EVM_TOKEN_FEATURES_NON_EIP1559 for prividiumeth).
  • Exports STATIC_NETWORK_FEATURE_FAMILIES (captured at module load before registerErc20Families() runs) and updates the drift-guard unit test in modules/statics/test/unit/coins.ts so any future SUPPORTS_ERC20 EVM family must also be statically listed.

Issue Number

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • Built @bitgo/statics (yarn build)
  • Ran modules/statics/test/unit/coins.ts (41,941 passing) and modules/statics/test/unit/tokenConfigTests.ts (191 passing)

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • My code compiles correctly for both Node and Browser environments
  • I have commented my code, particularly in hard-to-understand areas
  • My commits follow Conventional Commits and I have properly described any BREAKING CHANGES
  • The ticket or github issue was included in the commit message as a reference
  • I have made corresponding changes to the documentation and on any new/updated functions and/or methods - jsdoc
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@linear-code

linear-code Bot commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

CECHO-2706

@nayandas190 nayandas190 changed the title fix(statics): pre-populate static networkFeatureMapForTokens for EVM families (CECHO-2706) fix(statics): pre-populate static networkFeatureMapForTokens for EVM families Nov 10, 2026
@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Compatibility checks are failing on Node.js 27-nightly (experimental, non-blocking). This does not block merge, but it signals an incompatibility to fix before this release becomes supported.

View run

@nayandas190
nayandas190 force-pushed the nayanjyotidas/cecho-2706-bitgojs-statics-pre-populate-static branch from 84fa704 to e29efe1 Compare November 10, 2026 01:18
@nayandas190
nayandas190 marked this pull request as ready for review November 10, 2026 05:30
@nayandas190
nayandas190 requested a review from a team as a code owner November 10, 2026 05:30

@claude claude 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.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.

Tip: disable this comment in your organization's Code Review settings.

@nayandas190

Copy link
Copy Markdown
Contributor Author

@claude Please review

@nayandas190
nayandas190 merged commit bf88129 into master Nov 10, 2026
41 of 43 checks passed
@nayandas190
nayandas190 deleted the nayanjyotidas/cecho-2706-bitgojs-statics-pre-populate-static branch November 10, 2026 05:38
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