hyperledger / anoncreds-rs

anoncreds-rs
https://wiki.hyperledger.org/display/anoncreds
Apache License 2.0
74 stars 55 forks source link

Improve JS Api #103

Open TimoGlastra opened 1 year ago

TimoGlastra commented 1 year ago

As @genaris has highlighted in # the API for parsing objects could be improved.

currently you have to do the following to load a credential definition:

rsCredentialDefinitions[credDefId] = CredentialDefinition.load(JSON.stringify(credentialDefinitions[credDefId]))

It would be nice if load took a json object instead of a string. We also discussed that e.g. Presentation.create could just take json objects as input, and do the loading in the Presentation class so the user doesn't need to care about the object handles etc..

I think we should make the API just json objects wherever we can

genaris commented 1 year ago

I think it will be useful to implement these improvements before https://github.com/hyperledger/aries-framework-javascript/issues/1331, as otherwise users will need to care about freeing a lot object handles that most likely will not be useful other than being inputs as some classes like Presentation.

I'll pick these changes up if nobody is working on that yet.

berendsliedrecht commented 1 year ago

@genaris did #129 and #130 fix this?

genaris commented 1 year ago

Yes, mostly. For some few cases the handle clearing by the app will still be needed (for instance the one of the resulting presentation in the example)