toCerdential static method

StakeCred toCerdential(
  1. AdaStakeCredential credential
)

Convert an AdaStakeCredential to a StakeCred.

credential: The AdaStakeCredential to convert.

Returns a StakeCred object.

Implementation

static StakeCred toCerdential(AdaStakeCredential credential) {
  if (credential.type == AdaStakeCredType.key) {
    return StakeCredKey(credential.hash);
  }
  return StakeCredScript(credential.hash);
}