@bloock/sdk / CredentialCoreBuilder
Class: CredentialCoreBuilder
Helps construct credentials by specifying various attributes.
Table of contents
Constructors
Properties
- booleanAttributes
- configData
- dateAttributes
- dateTimeAttributes
- decimalAttributes
- expiration
- holderDid
- integerAttributes
- issuerDid
- key
- schemaId
- stringAttributes
- version
Methods
- build
- withBooleanAttribute
- withDateAttribute
- withDateTimeAttribute
- withDecimalAttribute
- withIntegerAttribute
- withStringAttribute
Constructors
constructor
• new CredentialCoreBuilder(issuer
, schemaId
, holderDid
, expiration
, version
, configData
): CredentialCoreBuilder
Creates a new CredentialCoreBuilder instance with the specified parameters.
Parameters
Name | Type |
---|---|
issuer | Issuer |
schemaId | string |
holderDid | string |
expiration | number |
version | number |
configData | ConfigData |
Returns
Defined in
entity/identity/credential_core_builder.ts:50
Properties
booleanAttributes
• booleanAttributes: BooleanAttribute
[]
Defined in
entity/identity/credential_core_builder.ts:37
configData
• configData: ConfigData
Defined in
entity/identity/credential_core_builder.ts:32
dateAttributes
• dateAttributes: DateAttribute
[]
Defined in
entity/identity/credential_core_builder.ts:38
dateTimeAttributes
• dateTimeAttributes: DateTimeAttribute
[]
Defined in
entity/identity/credential_core_builder.ts:39
decimalAttributes
• decimalAttributes: DecimalAttribute
[]
Defined in
entity/identity/credential_core_builder.ts:36
expiration
• expiration: number
Defined in
entity/identity/credential_core_builder.ts:29
holderDid
• holderDid: string
Defined in
entity/identity/credential_core_builder.ts:28
integerAttributes
• integerAttributes: IntegerAttribute
[]
Defined in
entity/identity/credential_core_builder.ts:35
issuerDid
• issuerDid: string
Defined in
entity/identity/credential_core_builder.ts:27
key
• Optional
key: Key
Defined in
entity/identity/credential_core_builder.ts:31
schemaId
• schemaId: string
Defined in
entity/identity/credential_core_builder.ts:26
stringAttributes
• stringAttributes: StringAttribute
[]
Defined in
entity/identity/credential_core_builder.ts:34
version
• version: number
Defined in
entity/identity/credential_core_builder.ts:30
Methods
build
▸ build(): Promise
<CredentialReceipt
>
Creates and returns a Credential using the specified attributes.
Returns
Promise
<CredentialReceipt
>
Defined in
entity/identity/credential_core_builder.ts:159
withBooleanAttribute
▸ withBooleanAttribute(key
, value
): CredentialCoreBuilder
Adds a boolean attribute to the CredentialCoreBuilder.
Parameters
Name | Type |
---|---|
key | string |
value | boolean |
Returns
Defined in
entity/identity/credential_core_builder.ts:122
withDateAttribute
▸ withDateAttribute(key
, value
): CredentialCoreBuilder
Adds a date attribute to the CredentialCoreBuilder.
Parameters
Name | Type |
---|---|
key | string |
value | Date |
Returns
Defined in
entity/identity/credential_core_builder.ts:136
withDateTimeAttribute
▸ withDateTimeAttribute(key
, value
): CredentialCoreBuilder
Adds a datetime attribute to the CredentialCoreBuilder.
Parameters
Name | Type |
---|---|
key | string |
value | Date |
Returns
Defined in
entity/identity/credential_core_builder.ts:147
withDecimalAttribute
▸ withDecimalAttribute(key
, value
): CredentialCoreBuilder
Adds a decimal attribute to the CredentialCoreBuilder.
Parameters
Name | Type |
---|---|
key | string |
value | number |
Returns
Defined in
entity/identity/credential_core_builder.ts:108
withIntegerAttribute
▸ withIntegerAttribute(key
, value
): CredentialCoreBuilder
Adds an integer attribute to the CredentialCoreBuilder.
Parameters
Name | Type |
---|---|
key | string |
value | number |
Returns
Defined in
entity/identity/credential_core_builder.ts:94
withStringAttribute
▸ withStringAttribute(key
, value
): CredentialCoreBuilder
Adds a string attribute to the CredentialCoreBuilder.
Parameters
Name | Type |
---|---|
key | string |
value | string |