Skip to main content

Credential

@harmoniclabs/cardano-ledger-tsDocs


@harmoniclabs/cardano-ledger-ts / Credential

Class: Credential<T>

Type Parameters

T extends CredentialType = CredentialType

Implements

Constructors

new Credential()

new Credential<T>(type, hash): Credential<T>

Parameters

type: T

hash: Hash28

Returns

Credential<T>

Defined in

src/credentials/Credential.ts:24

Properties

hash

readonly hash: T extends KeyHash ? PubKeyHash : ValidatorHash

Defined in

src/credentials/Credential.ts:22


type

readonly type: T

Defined in

src/credentials/Credential.ts:21

Accessors

fake

get static fake(): Credential<KeyHash>

Returns

Credential<KeyHash>

Defined in

src/credentials/Credential.ts:58

Methods

clone()

clone(): Credential<T>

Returns

Credential<T>

Implementation of

Cloneable.clone

Defined in

src/credentials/Credential.ts:50


toCbor()

toCbor(): CborString

Returns

CborString

Implementation of

ToCbor.toCbor

Defined in

src/credentials/Credential.ts:100


toCborObj()

toCborObj(): CborObj

Returns

CborObj

Implementation of

ToCbor.toCborObj

Defined in

src/credentials/Credential.ts:104


toData()

toData(_v?): DataConstr

Parameters

_v?: any

Returns

DataConstr

Implementation of

ToData.toData

Defined in

src/credentials/Credential.ts:66


toJson()

toJson(): object

Returns

object

credentialType

credentialType: string

hash

hash: string

Defined in

src/credentials/Credential.ts:131


fromCbor()

static fromCbor(cStr): Credential<CredentialType>

Parameters

cStr: CanBeCborString

Returns

Credential<CredentialType>

Defined in

src/credentials/Credential.ts:112


fromCborObj()

static fromCborObj(cObj): Credential<CredentialType>

Parameters

cObj: CborObj

Returns

Credential<CredentialType>

Defined in

src/credentials/Credential.ts:116


keyHash()

static keyHash(hash): Credential<KeyHash>

Parameters

hash: string | Uint8Array | Hash28

Returns

Credential<KeyHash>

Defined in

src/credentials/Credential.ts:80


pubKey()

static pubKey(hash): Credential<KeyHash>

Parameters

hash: string | Uint8Array | Hash28

Returns

Credential<KeyHash>

Deprecated

use keyHash instead

Defined in

src/credentials/Credential.ts:75


script()

static script(hash): Credential<Script>

Parameters

hash: string | Uint8Array | Hash28

Returns

Credential<Script>

Defined in

src/credentials/Credential.ts:90