• Creates a new credential document as a basis for issuing a credential. This document can be shown to users as a preview or be extended with additional properties before moving on to the second step of credential issuance: Adding a proof to the document using the issue function to make the credential verifiable.

    Parameters

    • arguments: {
          cType: ICType;
          cTypeDefinitions?: ICType[] | CTypeLoader;
          credentialSubject: Record<string, unknown> & {
              id: Did;
          };
          issuer: Did;
          type?: string;
      }

      Object holding all arguments for credential creation.

      • cType: ICType

        CTypes are special credential subtypes that are defined by a schema describing claims that may be made about the subject and are registered on the Kilt blockchain. Each Kilt credential is based on exactly one of these subtypes. This argument is therefore mandatory and expects the schema definition of a CType.

      • Optional cTypeDefinitions?: ICType[] | CTypeLoader

        Some CTypes are themselves composed of definitions taken from other CTypes; in that case, these definitions need to be supplied here. Alternatively, you can set a CTypeLoader function that takes care of fetching all required definitions.

      • credentialSubject: Record<string, unknown> & {
            id: Did;
        }

        An object containing key-value pairs that represent claims made about the subject of the credential.

      • issuer: Did

        The Decentralized Identifier (DID) of the identity acting as the authority issuing this credential.

      • Optional type?: string

        A type string identifying the (sub-)type of Verifiable Credential to be created. This is added to the type field on the credential and determines the credentialSchema as well. Defaults to the type KiltCredentialV1 which, for the time being, is also the only type supported.

    Returns Promise<UnsignedVc>

    A (potentially only partial) credential that is yet to be finalized and made verifiable with a proof.