Skip to content

Comments

refactor: modularize useWallet#436

Merged
alanrsoares merged 2 commits intomainfrom
refactor/cleanup-usewallet
Nov 4, 2025
Merged

refactor: modularize useWallet#436
alanrsoares merged 2 commits intomainfrom
refactor/cleanup-usewallet

Conversation

@alanrsoares
Copy link
Contributor

@alanrsoares alanrsoares commented Oct 31, 2025

Summary

Refactored wallet integration to improve modularity and maintainability. Key updates include:

  • Introduced a WalletType type alias for safer and clearer wallet references.
  • Extracted wallet-specific logic (connect, sign) into modular adapter files (keplr, leap, cosmostation) under wallet/adapters/.
  • Modularized transaction, sequence, and authentication logic into dedicated files:
    • transactions.ts, sequence.ts, auth.ts, signing.ts, dither.ts
  • Simplified and cleaned up useWallet by delegating responsibilities to these modules.
  • Updated WalletConnectDialog.vue to use WalletType.

@netlify
Copy link

netlify bot commented Oct 31, 2025

Deploy Preview for dither-staging ready!

Name Link
🔨 Latest commit dde3bdf
🔍 Latest deploy log https://app.netlify.com/projects/dither-staging/deploys/69040af63f1b4b000874af09
😎 Deploy Preview https://deploy-preview-436--dither-staging.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@alanrsoares alanrsoares requested a review from salmad3 October 31, 2025 01:07
Copy link
Contributor

@salmad3 salmad3 left a comment

Choose a reason for hiding this comment

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

The refactor is a great improvement.

(Not necessarily for this PR) Noticed the error handling is not consistent. For instance, the auth module catches errors and logs to console, the wallet adapters throw errors, and the transaction module is a mix of throwing and returning error responses.

The modular structure is solid for unit testing, but currently there aren't test files for the new modules.

@alanrsoares alanrsoares merged commit 8100bc7 into main Nov 4, 2025
16 checks passed
@alanrsoares alanrsoares deleted the refactor/cleanup-usewallet branch November 4, 2025 01:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants