fix: replace noble/curves by metadata-helpers#180
Merged
chaitanyapotti merged 3 commits intomasterfrom Mar 5, 2026
Merged
Conversation
chaitanyapotti
previously approved these changes
Mar 5, 2026
chaitanyapotti
previously approved these changes
Mar 5, 2026
lwin-kyaw
previously approved these changes
Mar 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Jira Link
N/A
Description
Replaces direct imports from
@noble/curveswith utilities re-exported by@toruslabs/metadata-helpers, consolidating cryptographic utility usage across the codebase.Changes:
package.json— Removed@noble/curvesfrom direct dependencies (it remains a transitive dependency viametadata-helpers).src/helpers/common.ts— ReplacednobleHexToBytes,nobleBytesToHex, andnobleConcatBytes(from@noble/curves/utils.js) withhexToBytes,bytesToHex, andconcatBytesfrom@toruslabs/metadata-helpers. Removed the manualconcatBytesre-export alias.concatBytesis now imported and re-exported directly frommetadata-helpers.src/helpers/keyUtils.ts— Replacedimport { mod } from "@noble/curves/abstract/modular.js"andimport { hexToBytes } from "@noble/curves/utils.js"with imports from@toruslabs/metadata-helpers.src/helpers/metadataUtils.ts— UpdatedconcatBytescall sites from variadic args (concatBytes(a, b)) to the array-based API (concatBytes([a, b])) to match themetadata-helperssignature.src/interfaces.ts— Replacedimport type { AffinePoint as AffinePointCurve } from "@noble/curves/abstract/curve.js"with theAffinePointtype from@toruslabs/metadata-helpers. Removed the local type alias.How has this been tested?
npm test) against sapphire devnet, testnet, and onekey test files.encParamsBufToHex/encParamsHexToBuf) withmetadata-helpers'bytesToHexandhexToBytes.Screenshots (if appropriate)
N/A
Types of changes
Checklist
Note
Medium Risk
Touches cryptographic byte/hex conversion and signature/ECIES serialization paths; behavior should be equivalent but small encoding differences could break interoperability. Test-timeout changes are low risk but may mask new hangs.
Overview
Switches crypto helpers over to
@toruslabs/metadata-helpersand drops direct@noble/curvesusage.common.ts,keyUtils.ts, andinterfaces.tsnow import/re-exporthexToBytes,bytesToHex,concatBytes,mod, andAffinePointfrommetadata-helpers, and ECIES encode/decode helpers use these conversions.Updates metadata signing concatenation and test config.
metadataUtils.tsupdatesconcatBytescalls to the array-based API,.mocharc.yamlis removed, Vitest nodetestTimeoutis increased to 60s and per-test timeouts are removed, and the package version bumps to17.1.1while removing@noble/curvesfromdependencies(lockfile updated).Written by Cursor Bugbot for commit f099ad1. This will update automatically on new commits. Configure here.