Skip to content

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

Closed

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.

Activity

  1. 123xiaode456-boop commented on Jun 22, 2026

    @123xiaode456-boop

    /attempt #22

  2. Dannyorji commented on Jun 28, 2026

    @Dannyorji
    Contributor

    HI Maintainer
    I will like to take this on.
    Please assign
    Thanks

  3. grantfox-oss commented on Jun 28, 2026

    @grantfox-oss

    🦊 GrantFox — @Dannyorji has been assigned to this issue as part of the Official Campaign campaign!

    Next steps:

    1. Open a Pull Request referencing this issue (e.g., Closes #3)
    2. Your PR will be reviewed by the ShadeProtocol maintainers

    Good luck! Track your progress on GrantFox.

  4. grantfox-oss commented on Jun 29, 2026

    @grantfox-oss

    🎉 This issue has been marked as completed on GrantFox as part of the Official Campaign campaign!

    @Dannyorji's PR #33 was approved and merged by @codebestia.

    🏆 @Dannyorji: You earned 35 FoxPoints for this contribution! Your current tier: Explorer (118 total points). Track your full progress on GrantFox.

    👏 Great work, @Dannyorji! Keep contributing to ShadeProtocol.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions