Skip to content

Convenience methods #5

Description

@van-ibm

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');

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions