Closed monaka closed 1 year ago
The purpose of the Online
object was already described here. Let me try to explain in more detail.
rgb-lib provides some offline functionalities: methods that work even without the wallet having already started or checked the online services (stored, rgb-node and the electrum and proxy urls).
In order to distinguish offline and online APIs and also to prevent a user from calling an API which requires to have called go_online
first, we created the Online
object that the lib user will need to provide to every API that requires at least an online service.
This object contains a unique identifier which is also saved in the wallet once it goes online, in order to check the object has not been manually constructed. This should prevent the lib user from ever calling an online API before actually going online.
So no, it’s not for multi-{wallet|user} support and ATM there are no plans to change this (spoiler: soon it will drop the proxy_url
, but its purpose will stay the same)
In my understanding,
Online
provided bygo_online()
is an identifier for many API calls. Is it for multi-{wallet|user} support in the future? I want to know why the wallet client must carry anOnline
instance.