Skip to main content

@bloock/sdk / CredentialBuilder

Class: CredentialBuilder

Helps construct credentials by specifying various attributes.

Table of contents​

Constructors​

Properties​

Methods​

Constructors​

constructor​

• new CredentialBuilder(issuer, schemaId, holderDid, expiration, version, configData): CredentialBuilder

Creates a new CredentialBuilder instance with the specified parameters.

Parameters​

NameType
issuerIssuer
schemaIdstring
holderDidstring
expirationnumber
versionnumber
configDataConfigData

Returns​

CredentialBuilder

Defined in​

entity/identity/credential_builder.ts:49

Properties​

booleanAttributes​

• booleanAttributes: BooleanAttribute[]

Defined in​

entity/identity/credential_builder.ts:36


configData​

• configData: ConfigData

Defined in​

entity/identity/credential_builder.ts:31


dateAttributes​

• dateAttributes: DateAttribute[]

Defined in​

entity/identity/credential_builder.ts:37


dateTimeAttributes​

• dateTimeAttributes: DateTimeAttribute[]

Defined in​

entity/identity/credential_builder.ts:38


decimalAttributes​

• decimalAttributes: DecimalAttribute[]

Defined in​

entity/identity/credential_builder.ts:35


expiration​

• expiration: number

Defined in​

entity/identity/credential_builder.ts:28


holderDid​

• holderDid: string

Defined in​

entity/identity/credential_builder.ts:27


integerAttributes​

• integerAttributes: IntegerAttribute[]

Defined in​

entity/identity/credential_builder.ts:34


key​

• Optional key: Key

Defined in​

entity/identity/credential_builder.ts:30


schemaId​

• schemaId: string

Defined in​

entity/identity/credential_builder.ts:26


stringAttributes​

• stringAttributes: StringAttribute[]

Defined in​

entity/identity/credential_builder.ts:33


version​

• version: number

Defined in​

entity/identity/credential_builder.ts:29

Methods​

build​

▸ build(): Promise<CredentialReceipt>

Creates and returns a Credential using the specified attributes.

Returns​

Promise<CredentialReceipt>

Defined in​

entity/identity/credential_builder.ts:142


withBooleanAttribute​

▸ withBooleanAttribute(key, value): CredentialBuilder

Adds a boolean attribute to the CredentialBuilder.

Parameters​

NameType
keystring
valueboolean

Returns​

CredentialBuilder

Defined in​

entity/identity/credential_builder.ts:111


withDateAttribute​

▸ withDateAttribute(key, value): CredentialBuilder

Adds a date attribute to the CredentialBuilder.

Parameters​

NameType
keystring
valueDate

Returns​

CredentialBuilder

Defined in​

entity/identity/credential_builder.ts:122


withDateTimeAttribute​

▸ withDateTimeAttribute(key, value): CredentialBuilder

Adds a datetime attribute to the CredentialBuilder.

Parameters​

NameType
keystring
valueDate

Returns​

CredentialBuilder

Defined in​

entity/identity/credential_builder.ts:133


withDecimalAttribute​

▸ withDecimalAttribute(key, value): CredentialBuilder

Adds a decimal attribute to the CredentialBuilder.

Parameters​

NameType
keystring
valuenumber

Returns​

CredentialBuilder

Defined in​

entity/identity/credential_builder.ts:100


withIntegerAttribute​

▸ withIntegerAttribute(key, value): CredentialBuilder

Adds an integer attribute to the CredentialBuilder.

Parameters​

NameType
keystring
valuenumber

Returns​

CredentialBuilder

Defined in​

entity/identity/credential_builder.ts:89


withStringAttribute​

▸ withStringAttribute(key, value): CredentialBuilder

Adds a string attribute to the CredentialBuilder.

Parameters​

NameType
keystring
valuestring

Returns​

CredentialBuilder

Defined in​

entity/identity/credential_builder.ts:78