Replace bs58 with @scure/base for Base58 encoding/decoding #6929
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.
Description
This PR replaces the
bs58dependency with@scure/basefor all Base58 encoding/decoding operations in the@walletconnect/utilspackage. The change standardizes on@scure/basewhich is already present in the dependency list and provides equivalent Base58 functionality.Key changes:
packages/utils/src/signatures.tsandpackages/utils/src/polkadot.tsbs58.encode()calls withbase58.encode()(affects Solana, SUI, and NEAR transaction ID generation)bs58.decode()calls withbase58.decode()(affects Polkadot SS58 address decoding)bs58dependency frompackages/utils/package.jsonsignatures.tsto import bothbase58andbase32from@scure/baseType of change
How has this been tested?
bs58usages exist in the codebasebs58(v6.0.0) and@scure/base(v1.2.6) have compatible APIs for our use casesFunctions tested:
extractSolanaTransactionId)getSuiDigest)getNearTransactionIdFromSignedTransaction)ss58AddressToPublicKey)guessSignatureTypeFromAddress)Fixes/Resolves (Optional)
Resolves Linear ticket CR-658
Checklist
Additional Information (Optional)
Please pay special attention to:
Link to Devin run: https://app.devin.ai/sessions/9988c95fdaeb42f58ad2e348c8c966d3
Requested by: Ben Kremer (@bkrem)