Heya, I believe we absolutely need a wrapper as suggested. Are you guys working on one somewhere? Is this it?
Wouldn’t it make sense to abstract common patterns into recipes?
- Basic initialization in one function:
init
- takes care of basic bootstrapping: initialises, authorises and connects
- Bootstrapping user, with a general
auth
function or more granular control withsetupContainer
andsetupService
:
auth
- checks if user has an account corresponding to a public id and if not create one: checks for access, gets containers (_public
and_publicNames
), encrypts public id, …
- Reading and Updating mutable and immutable data
And so on, and so on. I haven’t gotten that deep into it yet. But it’s really making my head hurt trying to figure out how everything fits together for simple things like bootstrapping and service and reading and writing to the network.
Also I think code needs to be as clean and as readable as possible. Shouldn’t we be taking advantage that the browser has async/await
native and write the wrapper using it’s clean syntax? The way we’ve started organizing our API utils in our project is staring to look pretty clean, check out this genNewAccount.js file. Let me know how I can help out with the wrapper