Skip to content

Conversation

@stabacco
Copy link
Owner

@stabacco stabacco commented Jan 17, 2026

updates urls to api2 endpoints

Summary by Sourcery

Update Stake API base URLs to use the new api2 host and align endpoint paths across NYSE and ASX services.

Enhancements:

  • Switch NYSE and ASX Stake base URLs to the api2.prd.hellostake.com host.
  • Prefix NYSE endpoint paths with the unified /api/ prefix and normalise watchlist URLs under the main Stake base URL.

@sourcery-ai
Copy link

sourcery-ai bot commented Jan 17, 2026

Reviewer's Guide

Switches Stake NYSE and ASX API base URLs to the new api2 host and consistently prefixes endpoints with the /api path segment, while also normalizing watchlist URLs to be built from the common base URL and adding a dedicated update_watchlist URL.

Class diagram for updated NYSEUrl and ASXUrl API endpoints

classDiagram
    class NYSEUrl {
        <<BaseModel>>
        STAKE_URL : str = https://api2.prd.hellostake.com/
        account_balance : str
        account_transactions : str
        brokerage : str
        cancel_order : str
        cash_available : str
        create_session : str
        equity_positions : str
        fund_details : str
        market_status : str
        orders : str
        products_suggestions : str
        quick_buy : str
        quotes : str
        rate : str
        ratings : str
        sell_orders : str
        symbol : str
        transaction_history : str
        transaction_details : str
        transactions : str
        users : str
        watchlists : str
        create_watchlist : str
        read_watchlist : str
        update_watchlist : str
        statement : str
    }

    class ASXUrl {
        <<BaseModel>>
        ASX_STAKE_URL : str = https://api2.prd.hellostake.com/api/asx/
        brokerage : str
    }

    NYSEUrl <|-- ASXUrl : shares BaseModel
Loading

File-Level Changes

Change Details Files
Update NYSE base API host and add /api prefix to all NYSE endpoints that previously assumed it in the base URL.
  • Change STAKE_URL from global-prd-api.hellostake.com/api/ to api2.prd.hellostake.com/.
  • Prefix all NYSE endpoint paths (account, orders, products, quotes, wallet, data, sessions) with api/ to compensate for removal of /api from the base URL.
  • Ensure all updated NYSE URLs continue to use urljoin with allow_fragments=True.
stake/constant.py
Normalize watchlist endpoints to use the common Stake base URL instead of a separate stakeover host and add a dedicated update_watchlist URL definition.
  • Replace hard-coded watchlist, create_watchlist, and read_watchlist URLs pointing at api.prd.stakeover.io with urljoin-based URLs using STAKE_URL.
  • Introduce update_watchlist URL as a urljoin-based path ending in /items instead of building it via string concatenation from read_watchlist.
  • Keep path structure for watchlist operations the same (us/instrument/watchlists, watchlist, watchlist/{watchlist_id}, watchlist/{watchlist_id}/items).
stake/constant.py
Update ASX base API host to api2 while preserving existing ASX endpoint paths. stake/constant.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • The watchlist endpoints were previously using the separate api.prd.stakeover.io host and are now derived from STAKE_URL; if those services are still hosted separately, consider keeping a dedicated base URL constant for watchlists instead of reusing STAKE_URL.
  • For consistency and easier future changes, consider aligning the ASX base URL pattern with the NYSE one (e.g., moving /api/ out of ASX_STAKE_URL and into the individual paths, or vice versa) so both markets follow the same structure.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The watchlist endpoints were previously using the separate `api.prd.stakeover.io` host and are now derived from `STAKE_URL`; if those services are still hosted separately, consider keeping a dedicated base URL constant for watchlists instead of reusing `STAKE_URL`.
- For consistency and easier future changes, consider aligning the ASX base URL pattern with the NYSE one (e.g., moving `/api/` out of `ASX_STAKE_URL` and into the individual paths, or vice versa) so both markets follow the same structure.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@stabacco stabacco merged commit fa3cfda into master Jan 17, 2026
17 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants