Skip to content

feat: Unified facades for the Wallet Lib#100

Merged
tuliomir merged 8 commits intomasterfrom
docs/lib-shared-facades
Mar 10, 2026
Merged

feat: Unified facades for the Wallet Lib#100
tuliomir merged 8 commits intomasterfrom
docs/lib-shared-facades

Conversation

@tuliomir
Copy link
Contributor

@tuliomir tuliomir commented Jan 22, 2026

The Wallet Lib facades for the Fullnode and the Wallet Service should share a subset of the most important methods, with the same parameters and output data format.

This will cause breaking changes that will require a major version update on the lib.

See rendered.

@tuliomir tuliomir self-assigned this Jan 22, 2026
@tuliomir tuliomir moved this from Todo to In Progress (WIP) in Hathor Network Jan 22, 2026
@tuliomir tuliomir moved this from In Progress (WIP) to In Progress (Done) in Hathor Network Feb 9, 2026
Comment on lines +272 to +273
We should consider keeping a `v2` version with minor and patch updates for
critical issues, but going forward we would fully migrate to `v3`.
Copy link
Member

Choose a reason for hiding this comment

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

No need to keep a v2 going if we release a v3

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed the mention of keeping the v2 on 4e9f712

Comment on lines +20 to +21
Why are we doing this? What use cases does it support? What is the expected
outcome?
Copy link
Member

Choose a reason for hiding this comment

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

remove?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, removed on 5bb3d2c

# Rationale and alternatives
[rationale-and-alternatives]: #rationale-and-alternatives

The facades could be kept separate and a wrapper `WalletWrapper` could be
Copy link
Member

Choose a reason for hiding this comment

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

Since we are introducing a new major version we can add more breaking changes, maybe even change how we think of facades to make managing the connections better, what do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's a good idea! My main question is how to organize the rollout of those breaking changes.

The first thing to come to mind is to have a beta branch where we could test only in our own clients ( Desktop/Mobile/Headless/Web Wallets ) in increasingly breaking changes with no major version upgrades for a few months.

After the changes stabilize, we make the stable version available for external clients as well.

Do you have other ideas on how to make those multiple changes gradually and incrementally?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added a section to discuss a beta branch on 055f648 .

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added the suggestion of re-think the facades as a Future Improvement on 4e9f712

Copy link
Contributor

@andreabadesso andreabadesso left a comment

Choose a reason for hiding this comment

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

I don't disagree with anything on the design, but I miss an analysis of impact on all of our wallet-lib clients that use the wallet-service -- wallet-mobile, wallet-desktop, wallet-headless, wallet-service, etc...

@tuliomir tuliomir moved this from In Progress (Done) to In Review (Done) in Hathor Network Feb 24, 2026
@tuliomir tuliomir moved this from In Review (Done) to In Review (WIP) in Hathor Network Feb 24, 2026
@tuliomir
Copy link
Contributor Author

All client wallets will have to adapt to the breaking changes proposed here and implemented in the beta branch.

When we close the beta version we should have a very clear guide on how any external client could adapt to those changes.

andreabadesso
andreabadesso previously approved these changes Mar 3, 2026
pedroferreira1
pedroferreira1 previously approved these changes Mar 10, 2026
Copy link
Member

@pedroferreira1 pedroferreira1 left a comment

Choose a reason for hiding this comment

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

For me this is approved and it's important to be done. It shouldn't be complicated to execute the most important part of this design.

  • 3 methods have inconsistent async/sync signatures (critical)
  • Return types differ significantly for several shared methods
  • The IHathorWallet interface has incomplete type annotations

These are the most important ones, they must be addressed in different PRs and then we must release a new version of the wallet lib. It shouldn't take much time to fix these in the clients.

  • 4 methods throw "Not implemented" in WalletServiceWallet
  • ~20 methods exist only in HathorWallet

I don't think this should be addressed now. This difference may be for many reasons, and most of them is that we didn't want to make this development a priority back then. Only the HathorWallet facade is used by the headless wallet, which has support for multisig sending, tx template, and other features that we don't have in the other wallets. We don't want to add this support right now, so I believe we shouldn't consider this a part of this project. In the tests, we can have tests for the whole interface and some specific tests for methods that are specific of the HathorWallet class.

What do you think?

@tuliomir tuliomir moved this from In Review (WIP) to In Progress (WIP) in Hathor Network Mar 10, 2026
@tuliomir tuliomir moved this from In Progress (WIP) to In Review (WIP) in Hathor Network Mar 10, 2026
@tuliomir tuliomir merged commit c8180bf into master Mar 10, 2026
@tuliomir tuliomir deleted the docs/lib-shared-facades branch March 10, 2026 22:30
@github-project-automation github-project-automation bot moved this from In Review (WIP) to Waiting to be deployed in Hathor Network Mar 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Waiting to be deployed

Development

Successfully merging this pull request may close these issues.

4 participants