getCredential(contract, templateID, credentialID)

Feature

Get information for a specific credential with given credential ID. Note: is_active shows that the credential is valid. If is_active is false, that means the credential is revoked by issuer.

Parameters

string contract Address, string template ID, string credential ID

data of SuccessResponse

object credential information

example

const contractAddress = "0x41EFb6902ADcb1214a7123b01af66b1D13b89864fca";
const templateID = "testTemplate";
const credentialID = "testCredential";

// Note: an asynchronous request.
const credentialInfo = async () => {
  const info = await mitum.credential.getCredential(contractAddress, templateID, credentialID);
  console.log(info.data);
};
credentialInfo();

//output
{
   credential: {
      _hint: "mitum-credential-credential-v0.0.1",
      holder: "0x07469989b2562afF5E5C3B116CD3AA5Ef814e5a1fca",
      template_id: "testTemplate",
      credential_id: "testCredential",
      value: "sefthia200",
      valid_from: 100,
      valid_until: 200,
      did: "sefthia300"
   },
   is_active: false
}

Last updated