Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do we need something like 'wallet2_api.h' again? #5

Open
rbrunner7 opened this issue Aug 1, 2022 · 0 comments
Open

Do we need something like 'wallet2_api.h' again? #5

rbrunner7 opened this issue Aug 1, 2022 · 0 comments

Comments

@rbrunner7
Copy link
Member

Part of the Monero core codebase is a folder /source/wallet/api with wallet2_api.h as the most important among 20 files or so.

Technically it implements a somewhat thin wrapper for wallet2. It's not used by monero-wallet-cli or monero-wallet-rpc but by wallets like the GUI wallet, Feather and Cake. The "style" is different compared with other Monero code, using different naming rules, abstract interface classes with everything virtual and then "Impl" classes providing the implementation, and so on. It looks quite complete so maybe it's possible to implement a wallet solely referencing wallet2_api.h but not wallet2.h.

It's a bit hard for me to judge what the "core value proposition" of this extensive second Monero wallet interface is, but it looks to me like the abstraction level is a bit higher, and wallets using it instead of wallet2 don't have to care about a lot of little details like calling some highly specific methods, conversions between binary and text and/or hex, getting some nicer error messages that they can directly show in their UIs, and such things.

I am sceptical it's a good idea to duplicate so many things to merely provide a thin wrapper that is a bit easier to use for wallet writers, and currently do not see a need for something similar in a wallet3 context again if we provide some useful "higher level" methods right in wallet3.

But who knows, maybe some wallet writers will try to stick with wallet2_api.h and re-implement it with wallet3 underneath.

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

No branches or pull requests

1 participant