-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allows creating multiple watchlists (#144)
- Loading branch information
Showing
23 changed files
with
1,976 additions
and
356 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,8 @@ jobs: | |
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-python@v1 | ||
- uses: pre-commit/[email protected] | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v3 | ||
- uses: pre-commit/[email protected] | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,7 @@ jobs: | |
- name: Run image | ||
uses: abatilo/[email protected] | ||
with: | ||
poetry-version: 1.0.10 | ||
poetry-version: 1.1.12 | ||
- name: Publish python package | ||
run: poetry version ${{ steps.vars.outputs.tag }} && poetry build && poetry publish -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} | ||
- name: Auto commit pyproject.toml | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,87 @@ | ||
from enum import Enum | ||
|
||
|
||
class Url(str, Enum): | ||
"""Contains all the visited stake urls.""" | ||
|
||
account_balance: str = "cma/getAccountBalance" | ||
account_transactions: str = "users/accounts/accountTransactions" | ||
cancel_order: str = "orders/cancelOrder/${orderId}" | ||
cash_available: str = "users/accounts/cashAvailableForWithdrawal" | ||
create_session: str = "sessions/v2/createSession" | ||
equity_positions: str = "users/accounts/v2/equityPositions" | ||
fund_details: str = "fund/details" | ||
market_status: str = "utils/marketStatus" | ||
orders: str = "users/accounts/v2/orders" | ||
products_suggestions: str = "products/getProductSuggestions/${keyword}" | ||
quick_buy: str = "purchaseorders/v2/quickBuy" | ||
quotes: str = "quotes/marketData/${symbols}" | ||
rate: str = "wallet/rate" | ||
ratings: str = "data/calendar/ratings?tickers=${symbols}&pageSize=${limit}" | ||
sell_orders: str = "sellorders" | ||
symbol: str = "products/searchProduct?symbol=${symbol}&page=1&max=1" | ||
transaction_history: str = "users/accounts/transactionHistory" | ||
transaction_details: str = ( | ||
"users/accounts/transactionDetails?" | ||
"reference=${reference}&referenceType=${reference_type}" | ||
) | ||
transactions: str = "users/accounts/transactions" | ||
user: str = "user" | ||
watchlist_modify: str = "instruments/addRemoveInstrumentWatchlist" | ||
watchlist: str = "products/productsWatchlist/${userId}" | ||
|
||
|
||
STAKE_URL = "https://global-prd-api.hellostake.com/api/" | ||
# sourcery skip: use-fstring-for-concatenation | ||
from urllib.parse import urljoin | ||
|
||
from pydantic import BaseModel | ||
|
||
|
||
class BaseUrl(BaseModel): | ||
"""Contains all the visited stake urls for the NYSE.""" | ||
|
||
STAKE_URL: str = "https://global-prd-api.hellostake.com/api/" | ||
account_balance: str = urljoin( | ||
STAKE_URL, "cma/getAccountBalance", allow_fragments=True | ||
) | ||
account_transactions: str = urljoin( | ||
STAKE_URL, "users/accounts/accountTransactions", allow_fragments=True | ||
) | ||
cancel_order: str = urljoin( | ||
STAKE_URL, "orders/cancelOrder/{orderId}", allow_fragments=True | ||
) | ||
cash_available: str = urljoin( | ||
STAKE_URL, "users/accounts/cashAvailableForWithdrawal", allow_fragments=True | ||
) | ||
create_session: str = urljoin( | ||
STAKE_URL, "sessions/v2/createSession", allow_fragments=True | ||
) | ||
equity_positions: str = urljoin( | ||
STAKE_URL, "users/accounts/v2/equityPositions", allow_fragments=True | ||
) | ||
fund_details: str = urljoin(STAKE_URL, "fund/details", allow_fragments=True) | ||
market_status: str = urljoin(STAKE_URL, "utils/marketStatus", allow_fragments=True) | ||
orders: str = urljoin(STAKE_URL, "users/accounts/v2/orders", allow_fragments=True) | ||
products_suggestions: str = urljoin( | ||
STAKE_URL, "products/getProductSuggestions/{keyword}", allow_fragments=True | ||
) | ||
quick_buy: str = urljoin( | ||
STAKE_URL, "purchaseorders/v2/quickBuy", allow_fragments=True | ||
) | ||
quotes: str = urljoin( | ||
STAKE_URL, "quotes/marketData/{symbols}", allow_fragments=True | ||
) | ||
rate: str = urljoin(STAKE_URL, "wallet/rate", allow_fragments=True) | ||
ratings: str = urljoin( | ||
STAKE_URL, | ||
"data/calendar/ratings?tickers={symbols}&pageSize={limit}", | ||
allow_fragments=True, | ||
) | ||
sell_orders: str = urljoin(STAKE_URL, "sellorders", allow_fragments=True) | ||
symbol: str = urljoin( | ||
STAKE_URL, | ||
"products/searchProduct?symbol={symbol}&page=1&max=1", | ||
allow_fragments=True, | ||
) | ||
transaction_history: str = urljoin( | ||
STAKE_URL, "users/accounts/transactionHistory", allow_fragments=True | ||
) | ||
transaction_details: str = urljoin( | ||
STAKE_URL, | ||
( | ||
"users/accounts/transactionDetails?" | ||
"reference={reference}&referenceType={reference_type}" | ||
), | ||
allow_fragments=True, | ||
) | ||
transactions: str = urljoin( | ||
STAKE_URL, "users/accounts/transactions", allow_fragments=True | ||
) | ||
users: str = urljoin(STAKE_URL, "user", allow_fragments=True) | ||
|
||
# deprecated, use update_watchlist instead | ||
watchlist_modify: str = urljoin( | ||
STAKE_URL, "instruments/addRemoveInstrumentWatchlist", allow_fragments=True | ||
) | ||
# deprecated, use read_watchlist instead | ||
watchlist: str = urljoin( | ||
STAKE_URL, "products/productsWatchlist/{userId}", allow_fragments=True | ||
) | ||
|
||
watchlists: str = "https://api.prd.stakeover.io/us/instrument/watchlists" | ||
create_watchlist: str = "https://api.prd.stakeover.io/us/instrument/watchlist" | ||
read_watchlist: str = ( | ||
"https://api.prd.stakeover.io/us/instrument/watchlist/{watchlist_id}" | ||
) | ||
update_watchlist: str = read_watchlist + "/items" | ||
|
||
|
||
# The New York Stock Exchange | ||
NYSE = BaseUrl() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.