def METHOD_NAME(
    cls, address_params: messages.CardanoAddressParametersType
) -> "Credential":
    address_type = address_params.address_type  # local_cache_attribute
    CAT = CardanoAddressType  # local_cache_global
    credential = cls(
        type_name=CREDENTIAL_TYPE_PAYMENT,
        address_type=address_type,
        path=address_params.address_n,
        key_hash=None,
        script_hash=address_params.script_payment_hash,
        pointer=None,
    )
    if address_type in (
        CAT.BASE,
        CAT.BASE_KEY_SCRIPT,
        CAT.POINTER,
        CAT.ENTERPRISE,
        CAT.BYRON,
    ):
        if not SCHEMA_PAYMENT.match(address_params.address_n):
            credential.is_unusual_path = True
    elif address_type in (
        CAT.BASE_SCRIPT_KEY,
        CAT.BASE_SCRIPT_SCRIPT,
        CAT.POINTER_SCRIPT,
        CAT.ENTERPRISE_SCRIPT,
    ):
        credential.is_other_warning = True
    elif address_type in (
        CAT.REWARD,
        CAT.REWARD_SCRIPT,
    ):
        credential.is_reward = True
    else:
        raise RuntimeError  # we didn't cover all address types
    return credential