diff --git a/curvesim/constants.py b/curvesim/constants.py index e9911949b..a7471ab95 100644 --- a/curvesim/constants.py +++ b/curvesim/constants.py @@ -1,7 +1,15 @@ +""" +Constants and Enum types used in Curvesim. +""" from enum import Enum class StrEnum(str, Enum): + """ + Custom string enum type since the builtin `StrEnum` is not available + until Python 3.11. + """ + def __str__(self): """ Regular Enum's __str__ is the name, rather than the value, @@ -12,13 +20,14 @@ def __str__(self): so we need to explicit use the value. - This is not necessary in Python 3.11 or above, where the - builtin `StrEnum` has this behavior. + This behaves like the builtin `StrEnum` (available in 3.11). """ return str.__str__(self) class Chain(StrEnum): + """Identifiers for chains & layer 2s.""" + MAINNET = "mainnet" ARBITRUM = "arbitrum" OPTIMISM = "optimism" @@ -29,5 +38,7 @@ class Chain(StrEnum): class Env(StrEnum): + """Names for different API environments.""" + PROD = "prod" STAGING = "staging"