Skip to content

Conversation

@devin-ai-integration
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Sep 15, 2025

Creating a release? Please use the Release PR Template instead.

Description

This PR replaces the bs58 dependency with @scure/base for all Base58 encoding/decoding operations in the @walletconnect/utils package. The change standardizes on @scure/base which is already present in the dependency list and provides equivalent Base58 functionality.

Key changes:

  • Updated imports in packages/utils/src/signatures.ts and packages/utils/src/polkadot.ts
  • Replaced bs58.encode() calls with base58.encode() (affects Solana, SUI, and NEAR transaction ID generation)
  • Replaced bs58.decode() calls with base58.decode() (affects Polkadot SS58 address decoding)
  • Removed bs58 dependency from packages/utils/package.json
  • Consolidated imports in signatures.ts to import both base58 and base32 from @scure/base

Type of change

  • Chore (non-breaking change that addresses non-functional tasks, maintenance, or code quality improvements)

How has this been tested?

  • ✅ All existing unit tests pass for the utils package
  • ✅ Lint and build checks pass
  • ✅ Verified no other bs58 usages exist in the codebase
  • ✅ Both bs58 (v6.0.0) and @scure/base (v1.2.6) have compatible APIs for our use cases

Functions tested:

  • Solana transaction ID extraction (extractSolanaTransactionId)
  • SUI digest generation (getSuiDigest)
  • NEAR transaction ID generation (getNearTransactionIdFromSignedTransaction)
  • Polkadot SS58 address decoding (ss58AddressToPublicKey)
  • Polkadot signature type detection (guessSignatureTypeFromAddress)

Fixes/Resolves (Optional)

Resolves Linear ticket CR-658

Checklist

  • I have performed a self-review of my own code
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules

Additional Information (Optional)

⚠️ Important for Reviewers:

Please pay special attention to:

  1. API Compatibility: While both libraries implement Base58 encoding, please verify that error handling and edge cases behave identically
  2. Blockchain Operations: The affected functions handle critical blockchain operations (transaction IDs, address decoding) - any encoding differences could impact functionality
  3. Test Coverage: Existing tests should provide adequate coverage, but consider if additional edge case testing is needed

Link to Devin run: https://app.devin.ai/sessions/9988c95fdaeb42f58ad2e348c8c966d3

Requested by: Ben Kremer (@bkrem)

@linear
Copy link

linear bot commented Sep 15, 2025

@devin-ai-integration
Copy link
Contributor Author

🤖 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

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR replaces the bs58 dependency with @scure/base for Base58 encoding/decoding operations across the WalletConnect utils package. The change consolidates dependencies by using the already-present @scure/base library instead of maintaining a separate bs58 dependency.

  • Updated Base58 encoding/decoding calls in blockchain transaction processing functions
  • Consolidated imports to use @scure/base for both base58 and base32 operations
  • Removed unused bs58 dependency from package.json

Reviewed Changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated no comments.

File Description
packages/utils/test/signatures.spec.ts Removed unused import buildSignedExtrinsic
packages/utils/src/signatures.ts Updated imports and replaced bs58 calls with base58 for Solana, SUI, and NEAR operations
packages/utils/src/polkadot.ts Updated imports and replaced bs58 calls with base58 for Polkadot address decoding
packages/utils/package.json Removed bs58 dependency

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@bkrem
Copy link
Member

bkrem commented Oct 13, 2025

rebase and resolve conflicts

- Replace bs58 import with @scure/base in signatures.ts and polkadot.ts
- Update all bs58.encode() calls to base58.encode() in Solana, SUI, and NEAR functions
- Update all bs58.decode() calls to base58.decode() in Polkadot address functions
- Remove bs58 dependency from packages/utils/package.json
- Update package-lock.json to reflect dependency removal

Fixes CR-658

Co-Authored-By: Ben Kremer <ben@reown.com>
@devin-ai-integration devin-ai-integration bot force-pushed the devin/CR-658-1757930677 branch from ee28f86 to 613e3c4 Compare October 13, 2025 10:42
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