Function dRepToCredential

Decode a DRep ID (CIP-105 or CIP-129) back to a governance credential.

  • For CIP-105, the credential type is inferred from the HRP (drep vs drep_script).
  • For CIP-129, the credential type is inferred from the header byte.

Error if the payload length is not CIP_105_DREP_ID_LENGTH or CIP_129_DREP_ID_LENGTH, or if a CIP-129 header does not indicate a DRep governance credential.

  • toCip105DRepID
  • toCip129DRepID
  • Parameters

    • drepId: string

      Bech32-encoded DRep ID (drep1... or drep_script1...).

    Returns Credential

    The extracted Credential ({ hash, type }).