Skip to content

feat: expose blockchain id constants#135

Draft
wyf027 wants to merge 1 commit into
web3data:masterfrom
wyf027:hermes-auto/web3data-js-68-blockchain-constants
Draft

feat: expose blockchain id constants#135
wyf027 wants to merge 1 commit into
web3data:masterfrom
wyf027:hermes-auto/web3data-js-68-blockchain-constants

Conversation

@wyf027

@wyf027 wyf027 commented Jun 28, 2026

Copy link
Copy Markdown

Summary

  • Exposes the existing blockchain ID constants as static properties on Web3Data.
  • Updates the built browser bundle so CDN/browser consumers can access the same constants.

Fix/Approach

  • Reuses the constants already defined in src/constants.js.
  • Assigns each blockchain ID constant onto the exported Web3Data class, matching the issue example (Web3Data.BLOCKCHAIN_ID_ETHEREUM_MAINNET).
  • Adds an AVA regression test covering all currently defined blockchain ID constants.

Verification

  • RED: npx ava test/web3data.test.js --match='Web3data exposes blockchain id constants as public class properties' -- --mode replay failed before the implementation with undefined for Web3Data.BLOCKCHAIN_ID_ETHEREUM_MAINNET.
  • GREEN: npx ava test/web3data.test.js --match='Web3data exposes blockchain id constants as public class properties' -- --mode replay passed after the implementation: 1 test passed.
  • npm test passed: 181 tests passed, 52 tests skipped.
  • npm run build passed and regenerated dist/web3data.min.js.
  • git diff --check passed.

Notes

  • CONTRIBUTING.md asks contributors to sign a CLA. I cannot sign legal documents on behalf of anyone, so a CLA check may remain pending until an authorized contributor handles it.

Related issue

Fixes #68

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.

Expose blockchain Id constants in web3data-js as public constants

1 participant