Skip to content

fix: update imports for major dependency upgrades (bech32 v2, @noble/hashes v2, bs58 v6, @noble/curves v2, chain-registry v2)#197

Open
pyramation wants to merge 2 commits intomainfrom
devin/1772331619-fix-upgrade-types
Open

fix: update imports for major dependency upgrades (bech32 v2, @noble/hashes v2, bs58 v6, @noble/curves v2, chain-registry v2)#197
pyramation wants to merge 2 commits intomainfrom
devin/1772331619-fix-upgrade-types

Conversation

@pyramation
Copy link
Contributor

Summary

Fixes type and import errors caused by major dependency version bumps on the feat/upgrades branch. No logic changes — only import paths, export styles, and property name casing were updated to match new library APIs.

Dependency Breaking Change Files Affected
bech32 v2 namespace → named export packages/encoding/src/bech32.ts
@noble/hashes v2 sha256/sha512 moved to sha2; ripemd160 moved to legacy packages/crypto/src/sha.ts, pbkdf2.ts, ripemd.ts, packages/auth/src/utils.ts, built-in.ts
bs58 v6 namespace → default export 4 files in networks/solana/
@noble/curves v2 Signature.fromCompact()fromBytes(_, 'compact'); toRawBytes()toBytes() networks/ethereum/src/signers/base-signer.ts
@chain-registry v2 snake_case → camelCase (bech32_prefix, chain_name, chain_1/chain_2, port_id, channel_id) 4 starship test files

Review & Testing Checklist for Human

  • Verify @noble/curves v2 API: The secp256k1.Signature.fromBytes(bytes, 'compact') and point.toBytes(false) calls in networks/ethereum/src/signers/base-signer.ts are the highest-risk change — confirm these match the actual v2 type signatures (runtime failure in ETH signing if wrong)
  • Indentation drift: The diff shows some lines in base-signer.ts (lines 212-213, 268-269) and the IBC test blocks in token.test.ts picked up extra indentation during editing — verify these don't cause linting issues or are acceptable
  • Chain-registry camelCase in test files: The starship test changes (bech32Prefix, chainName, chain1/chain2, portId, channelId) can't be validated without a starship environment — spot-check against @chain-registry/types@2 type definitions
  • Run pnpm build to confirm all packages compile (injective has a pre-existing unrelated error)

Notes

  • Lint is broken repo-wide due to an ESLint / @typescript-eslint version incompatibility — pre-existing, not introduced here
  • The networks/injective build error (src/signers/config.ts type mismatch) also pre-exists on main
  • Requested by: @pyramation
  • Devin Session

- bech32 v2: change import * to named import { bech32 }
- @noble/hashes v2: sha256/sha512 -> sha2, ripemd160 -> legacy
- @noble/curves v2: fromCompact -> fromBytes('compact'), toRawBytes -> toBytes
- bs58 v6: change import * to default import
- @chain-registry/client v2: snake_case -> camelCase (bech32_prefix, chain_name, chain_1/2, port_id, channel_id)
@devin-ai-integration
Copy link

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@pyramation pyramation changed the base branch from feat/upgrades to main March 1, 2026 02:55
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.

1 participant