As I was writing tests, I thought of instances where a convenience method would more clearly match a function with its semantics. If a holder were requesting a credential from an issuer, the issuer must execute .getCredentials({state: 'inbound_request'}) to obtain such requests. That could be rewritten as:
function getCredentialRequests() {
return getCredentials({state: 'inbound_request'});
}
This obviously does not save the developer from a lot of implementation, but the functions might more naturally align to the vocabulary /mechanics of SSI, which could facilitate understanding for new users.
Some other candidates (basically anything with a state property):
holder.getVerifications({state: 'inbound_proof_request'});
holder.updateVerification(verification.id, 'proof_generated');
holder.updateVerification(verification.id, 'proof_shared');
As I was writing tests, I thought of instances where a convenience method would more clearly match a function with its semantics. If a holder were requesting a credential from an issuer, the issuer must execute
.getCredentials({state: 'inbound_request'})to obtain such requests. That could be rewritten as:This obviously does not save the developer from a lot of implementation, but the functions might more naturally align to the vocabulary /mechanics of SSI, which could facilitate understanding for new users.
Some other candidates (basically anything with a state property):