@bloock/sdk / CredentialBuilder
Class: CredentialBuilder
Helps construct credentials by specifying various attributes.
Table of contents
Constructors
Properties
- booleanAttributes
- configData
- dateAttributes
- dateTimeAttributes
- decimalAttributes
- expiration
- holderDid
- integerAttributes
- key
- schemaId
- stringAttributes
- version
Methods
- build
- withBooleanAttribute
- withDateAttribute
- withDateTimeAttribute
- withDecimalAttribute
- withIntegerAttribute
- withStringAttribute
Constructors
constructor
• new CredentialBuilder(issuer
, schemaId
, holderDid
, expiration
, version
, configData
): CredentialBuilder
Creates a new CredentialBuilder 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_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
Name | Type |
---|---|
key | string |
value | boolean |
Returns
Defined in
entity/identity/credential_builder.ts:111
withDateAttribute
▸ withDateAttribute(key
, value
): CredentialBuilder
Adds a date attribute to the CredentialBuilder.
Parameters
Name | Type |
---|---|
key | string |
value | Date |
Returns
Defined in
entity/identity/credential_builder.ts:122
withDateTimeAttribute
▸ withDateTimeAttribute(key
, value
): CredentialBuilder
Adds a datetime attribute to the CredentialBuilder.
Parameters
Name | Type |
---|---|
key | string |
value | Date |
Returns
Defined in
entity/identity/credential_builder.ts:133
withDecimalAttribute
▸ withDecimalAttribute(key
, value
): CredentialBuilder
Adds a decimal attribute to the CredentialBuilder.
Parameters
Name | Type |
---|---|
key | string |
value | number |
Returns
Defined in
entity/identity/credential_builder.ts:100
withIntegerAttribute
▸ withIntegerAttribute(key
, value
): CredentialBuilder
Adds an integer attribute to the CredentialBuilder.
Parameters
Name | Type |
---|---|
key | string |
value | number |
Returns
Defined in
entity/identity/credential_builder.ts:89
withStringAttribute
▸ withStringAttribute(key
, value
): CredentialBuilder
Adds a string attribute to the CredentialBuilder.
Parameters
Name | Type |
---|---|
key | string |
value | string |