Skip to content

Environments Reference

Environment configuration for the SDK.

Environment Info

EnvironmentInfo dataclass

EnvironmentInfo(
    backend: str,
    proxy: str,
    helicone_url: str,
    frontend: str = None,
)

Data class to store environment information.

ATTRIBUTE DESCRIPTION
frontend

Frontend URL

TYPE: str

backend

Backend URL

TYPE: str

proxy

Proxy URL

TYPE: str

helicone_url

Helicone URL

TYPE: str

Functions

get_environment

get_environment(name: EnvironmentName) -> EnvironmentInfo

Get the environment configuration by name.

PARAMETER DESCRIPTION
name

The name of the environment.

TYPE: EnvironmentName

RETURNS DESCRIPTION
EnvironmentInfo

The environment configuration.

TYPE: EnvironmentInfo

RAISES DESCRIPTION
ValueError

If the environment name is not defined.

Source code in payments_py/environments.py
def get_environment(name: EnvironmentName) -> EnvironmentInfo:
    """
    Get the environment configuration by name.

    Args:
        name: The name of the environment.

    Returns:
        EnvironmentInfo: The environment configuration.

    Raises:
        ValueError: If the environment name is not defined.
    """
    if name not in Environments:
        raise ValueError(f"Environment '{name}' is not defined.")
    return Environments[name]

Constants

Environments

Environments module-attribute

Environments = {
    "staging_sandbox": EnvironmentInfo(
        frontend="https://nevermined.dev",
        backend="https://api.sandbox.nevermined.dev",
        proxy="https://proxy.sandbox.nevermined.dev",
        helicone_url="https://helicone.nevermined.dev",
    ),
    "staging_live": EnvironmentInfo(
        frontend="https://nevermined.dev",
        backend="https://api.live.nevermined.dev",
        proxy="https://proxy.live.nevermined.dev",
        helicone_url="https://helicone.nevermined.dev",
    ),
    "sandbox": EnvironmentInfo(
        frontend="https://nevermined.app",
        backend="https://api.sandbox.nevermined.app",
        proxy="https://proxy.sandbox.nevermined.app",
        helicone_url="https://helicone.nevermined.dev",
    ),
    "live": EnvironmentInfo(
        frontend="https://nevermined.app",
        backend="https://api.live.nevermined.app",
        proxy="https://proxy.live.nevermined.app",
        helicone_url="https://helicone.nevermined.dev",
    ),
    "custom": EnvironmentInfo(
        frontend=getenv(
            "NVM_FRONTEND_URL", "http://localhost:3000"
        ),
        backend=getenv(
            "NVM_BACKEND_URL", "http://localhost:3001"
        ),
        proxy=getenv(
            "NVM_PROXY_URL", "https://localhost:443"
        ),
        helicone_url=getenv(
            "HELICONE_URL", "http://localhost:8585"
        ),
    ),
}

ZeroAddress

ZeroAddress module-attribute

ZeroAddress = '0x0000000000000000000000000000000000000000'