Skip to content

Add environment constants (sandbox/production, testnet/mainnet) #3

Description

@codebestia

Description:

The SDK targets two environments — sandbox (Stellar testnet, staging backend) and production (Stellar mainnet, live backend). These must be represented as an enum so the HTTP client and Stellar layer automatically resolve the correct API base URL and network passphrase without the user doing the mapping themselves.

Proposed Steps:

  • Define an Environment enum in config.py with values SANDBOX and PRODUCTION.
  • Map each value to its Horizon URL, network passphrase, and Shade backend URL.
  • Accept string shorthands "sandbox" / "production" via a parse_environment() coercer.
  • Default the SDK to SANDBOX so developers don't accidentally hit production.

Acceptance Criteria:

  • shade.environment = "production" resolves to the mainnet Horizon URL and production API base.
  • shade.environment = "sandbox" resolves to the testnet Horizon URL and staging API base.
  • Invalid strings raise ValueError with the list of valid options.
  • The Stellar layer reads Environment without separate configuration.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions