diff --git a/stake/asx/common.py b/stake/asx/common.py index 069f789..3d85c8b 100644 --- a/stake/asx/common.py +++ b/stake/asx/common.py @@ -11,3 +11,4 @@ class TradeType(str, Enum): MARKET = "MARKET_TO_LIMIT" LIMIT = "LIMIT" + STOP = "STOP" diff --git a/stake/constant.py b/stake/constant.py index 61cd94c..ac6ecf2 100644 --- a/stake/constant.py +++ b/stake/constant.py @@ -71,15 +71,6 @@ class NYSEUrl(BaseModel): ) 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 = ( diff --git a/stake/watchlist.py b/stake/watchlist.py index 94a8d21..2838f2e 100644 --- a/stake/watchlist.py +++ b/stake/watchlist.py @@ -1,7 +1,6 @@ import uuid from datetime import datetime from typing import List, Optional, Union -from warnings import warn from pydantic import BaseModel, ConfigDict, Field @@ -42,6 +41,7 @@ class CreateWatchlistRequest(BaseModel): """This is used to create a new watchlist.""" name: str + tickers: List[str] | None = None class UpdateWatchlistRequest(BaseModel): @@ -98,59 +98,6 @@ async def _modify_watchlist( return WatchlistResponse(symbol=request.symbol, watching=data["watching"]) - async def add(self, request: AddToWatchlistRequest) -> WatchlistResponse: - """Adds a symbol to the watchlist. - - Args: - request (AddToWatchlistRequest): The request containing the symbol. - - Returns: - WatchlistResponse: The result of the watchlist modification. - """ - warn( - "This method is deprecated, please use `add_to_watchlist` instead.", - DeprecationWarning, - stacklevel=2, - ) - - return await self._modify_watchlist(request) - - async def remove(self, request: RemoveFromWatchlistRequest) -> WatchlistResponse: - """Removes a symbol from the watchlist. - - Args: - request (RemoveFromWatchlistRequest): The request containing the symbol - - Returns: - WatchlistResponse: The result of the watchlist modification. - """ - warn( - "This method is deprecated, please use `remove_from_watchlist` instead.", - DeprecationWarning, - stacklevel=2, - ) - - return await self._modify_watchlist(request) - - async def list(self) -> List[WatchlistProduct]: - """Lists all the contents of your watchlist. - - Returns: - List[WatchlistProduct]: The list of items in your watchlist. - """ - warn( - "This method is deprecated, please use `watchlist` instead.", - DeprecationWarning, - stacklevel=2, - ) - - watchlist = await self._client.get( - self._client.exchange.watchlist.format(userId=self._client.user.id) - ) - return [ - WatchlistProduct(**watched) for watched in watchlist["instrumentsWatchList"] - ] - async def watchlist(self, request: GetWatchlistRequest) -> Watchlist: """Retrieves a watchlist by id. @@ -188,14 +135,11 @@ async def create_watchlist( watchlist_id = response.get("newWatchlistId", None) assert watchlist_id, "Could not get a new watchlist" - return next( - ( - Watchlist(**watchlist_data) - for watchlist_data in response["watchlists"] - if watchlist_data["watchlistId"] == watchlist_id - ), - None, - ) + if request.tickers: + return await self.add_to_watchlist( + request=UpdateWatchlistRequest(id=watchlist_id, tickers=request.tickers) + ) + return await self.watchlist(request=GetWatchlistRequest(id=watchlist_id)) async def add_to_watchlist(self, request: UpdateWatchlistRequest) -> Watchlist: """Updates a watchlist by adding symbols to it.""" diff --git a/tests/cassettes/test_watchlist/test_add_to_watchlist.yaml b/tests/cassettes/test_watchlist/test_add_to_watchlist.yaml index 73ed63c..8ead21a 100644 --- a/tests/cassettes/test_watchlist/test_add_to_watchlist.yaml +++ b/tests/cassettes/test_watchlist/test_add_to_watchlist.yaml @@ -13,26 +13,25 @@ interactions: string: '{"canTradeOnUnsettledFunds": false, "cpfValue": null, "emailVerified": true, "hasFunded": true, "hasTraded": true, "userId": "7c9bbfae-0000-47b7-0000-0e66d868c2cf", - "username": "rita19", "emailAddress": "torresbenjamin@gmail.com", "dw_AccountId": - "1cf93550-8eb4-4c32-a229-826cf8c1be59", "dw_AccountNumber": "w4-1267174s", - "macAccountNumber": "H1-7641957H", "status": null, "macStatus": "BASIC_USER", - "dwStatus": null, "truliooStatus": "APPROVED", "truliooStatusWithWatchlist": - null, "firstName": "Tammy", "lastName": "Alexander", "phoneNumber": "9011530005", - "signUpPhase": 0, "ackSignedWhen": "2021-05-18", "createdDate": 1574303699770, - "stakeApprovedDate": null, "accountType": "INDIVIDUAL", "masterAccountId": - null, "referralCode": "L7-2127933N", "referredByCode": null, "regionIdentifier": + "username": "michael29", "emailAddress": "reevesmegan@gilmore-wright.biz", + "dw_AccountId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "dw_AccountNumber": + "z0-0593879b", "macAccountNumber": "d9-0481457G", "status": null, "macStatus": + "BASIC_USER", "dwStatus": null, "truliooStatus": "APPROVED", "truliooStatusWithWatchlist": + null, "firstName": "Rita", "middleName": null, "lastName": "Jones", "phoneNumber": + "(640)242-4270x965", "signUpPhase": 0, "ackSignedWhen": "2023-10-01", "createdDate": + 1574303699770, "stakeApprovedDate": null, "accountType": "INDIVIDUAL", "masterAccountId": + null, "referralCode": "W2-6612029X", "referredByCode": null, "regionIdentifier": "AUS", "assetSummary": null, "fundingStatistics": null, "tradingStatistics": null, "w8File": [], "rewardJourneyTimestamp": null, "rewardJourneyStatus": null, "userProfile": {"residentialAddress": null, "postalAddress": null}, - "ledgerBalance": 0.0, "investorAccreditations": null, "proscoreStatus": null, - "fxSpeed": "Regular", "facilitaStatus": null, "dateOfBirth": null, "upToDateDetails2021": + "ledgerBalance": 0.0, "fxSpeed": "Regular", "dateOfBirth": null, "upToDateDetails2021": "NO_REQUIREMENTS", "stakeKycStatus": "KYC_APPROVED", "awxMigrationDocsRequired": - null, "documentsStatus": "NO_ACTION", "mfaenabled": false}' + null, "documentsStatus": "NO_ACTION", "accountStatus": "OPEN", "mfaenabled": + false}' headers: {} status: code: 200 message: OK - url: https://global-prd-api.hellostake.com/api/user - request: body: null headers: @@ -45,31 +44,33 @@ interactions: response: body: string: - '{"products": [{"id": "b738ff53-b576-4f09-822e-91128def0560", "instrumentTypeID": - null, "symbol": "SPOT", "description": "Spotify Technology SA a Luxembourg-based - company, which offers digital music-streaming services. The Company enables - users to discover new releases, which includes the latest singles and albums; - playlists, which includes ready-made playlists put together by music fans - and experts, and over millions of songs so that users can play their favorites, - discover new tracks and build a personalized collection. Users can either - select Spotify Free, which includes only shuffle play or Spotify Premium, - which encompasses a range of features, such as shuffle play, advertisement - free, unlimited skips, listen offline, play any track and high quality audio. - The Company operates through a number of subsidiaries, including Spotify LTD - and is present in over 20 countries.", "category": "Stock", "currencyID": - null, "urlImage": "https://drivewealth.imgix.net/symbols/spot.png?fit=fillmax&w=125&h=125&bg=FFFFFF", - "sector": null, "name": "Spotify Technology SA", "dailyReturn": -3.32, "dailyReturnPercentage": - -1.57, "lastTraded": 207.55, "monthlyReturn": 0.0, "yearlyReturnPercentage": - 92.8, "yearlyReturnValue": 131.68, "popularity": 9470.0, "watched": 8075, - "news": 0, "bought": 9479, "viewed": 23400, "productType": "Instrument", "exchange": - null, "status": "ACTIVE", "type": "EQUITY", "encodedName": "spotify-technology-sa-spot", - "period": "YEAR RETURN", "inceptionDate": 1522713600000, "instrumentTags": + '{"products": [{"id": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "stakeInstrumentId": + "732309e2-71df-41c8-89ac-6bdc2b09356a", "instrumentTypeID": null, "symbol": + "SPOT", "description": "Spotify Technology SA a Luxembourg-based company, + which offers digital music-streaming services. The Company enables users to + discover new releases, which includes the latest singles and albums; playlists, + which includes ready-made playlists put together by music fans and experts, + and over millions of songs so that users can play their favorites, discover + new tracks and build a personalized collection. Users can either select Spotify + Free, which includes only shuffle play or Spotify Premium, which encompasses + a range of features, such as shuffle play, advertisement free, unlimited skips, + listen offline, play any track and high quality audio. The Company operates + through a number of subsidiaries, including Spotify LTD and is present in + over 20 countries.", "category": "Stock", "currencyID": null, "urlImage": + "https://drivewealth.imgix.net/symbols/spot.png?fit=fillmax&w=125&h=125&bg=FFFFFF", + "sector": null, "name": "Spotify Technology SA", "prePostMarketDailyReturn": + -0.87, "prePostMarketDailyReturnPercentage": -0.13, "dailyReturn": -5.56, + "dailyReturnPercentage": -0.81, "lastTraded": 682.24, "monthlyReturn": 0.0, + "yearlyReturnPercentage": 92.8, "yearlyReturnValue": 131.68, "popularity": + 9470.0, "watched": 8806, "news": 0, "bought": 14189, "viewed": 26300, "productType": + "Instrument", "exchange": null, "status": "ACTIVE", "type": "EQUITY", "encodedName": + "spotify-technology-sa-spot", "period": "YEAR RETURN", "extendedHoursNotionalStatus": + "ACTIVE", "inceptionDate": 1522713600000, "marketCap": 121400901583, "instrumentTags": [], "childInstruments": []}]}' headers: {} status: code: 200 message: OK - url: https://global-prd-api.hellostake.com/api/products/searchProduct?symbol=SPOT&page=1&max=1 - request: body: null headers: @@ -88,5 +89,4 @@ interactions: status: code: 202 message: Accepted - url: https://global-prd-api.hellostake.com/api/instruments/addRemoveInstrumentWatchlist version: 1 diff --git a/tests/cassettes/test_watchlist/test_create_watchlist[exchange0-symbols0].yaml b/tests/cassettes/test_watchlist/test_create_watchlist[exchange0-symbols0].yaml index 50bd79c..d445e35 100644 --- a/tests/cassettes/test_watchlist/test_create_watchlist[exchange0-symbols0].yaml +++ b/tests/cassettes/test_watchlist/test_create_watchlist[exchange0-symbols0].yaml @@ -18,14 +18,13 @@ interactions: "z0-0593879b", "macAccountNumber": "d9-0481457G", "status": null, "macStatus": "BASIC_USER", "dwStatus": null, "truliooStatus": "APPROVED", "truliooStatusWithWatchlist": null, "firstName": "Rita", "middleName": null, "lastName": "Jones", "phoneNumber": - "(640)242-4270x965", "signUpPhase": 0, "ackSignedWhen": "2021-11-15", "createdDate": + "(640)242-4270x965", "signUpPhase": 0, "ackSignedWhen": "2023-10-01", "createdDate": 1574303699770, "stakeApprovedDate": null, "accountType": "INDIVIDUAL", "masterAccountId": null, "referralCode": "W2-6612029X", "referredByCode": null, "regionIdentifier": "AUS", "assetSummary": null, "fundingStatistics": null, "tradingStatistics": null, "w8File": [], "rewardJourneyTimestamp": null, "rewardJourneyStatus": null, "userProfile": {"residentialAddress": null, "postalAddress": null}, - "ledgerBalance": 0.0, "investorAccreditations": null, "proscoreStatus": null, - "fxSpeed": "Regular", "facilitaStatus": null, "dateOfBirth": null, "upToDateDetails2021": + "ledgerBalance": 0.0, "fxSpeed": "Regular", "dateOfBirth": null, "upToDateDetails2021": "NO_REQUIREMENTS", "stakeKycStatus": "KYC_APPROVED", "awxMigrationDocsRequired": null, "documentsStatus": "NO_ACTION", "accountStatus": "OPEN", "mfaenabled": false}' @@ -33,7 +32,6 @@ interactions: status: code: 200 message: OK - url: https://global-prd-api.hellostake.com/api/user - request: body: null headers: @@ -46,15 +44,27 @@ interactions: response: body: string: - '{"generated": false, "watchlists": [{"watchlistId": "bb0f59b5-2454-451c-8de3-fa3fc7d13a42", - "name": "Not so much test", "timeCreated": "2022-07-14T05:25:44.881769Z", - "count": 1}, {"watchlistId": "e649db6d-71ab-4649-a32e-59d57def4a00", "name": - "stef 2", "timeCreated": "2022-07-14T05:31:06.054443Z", "count": 0}]}' + '{"generated": false, "watchlists": [{"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", + "name": "test-2025-08-13", "timeCreated": "2025-08-12T23:54:17.121422Z", + "count": 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": + "test-2025-08-14", "timeCreated": "2025-08-14T01:58:57.211214Z", "count": + 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-15", + "timeCreated": "2025-08-15T01:35:39.886173Z", "count": 17}, {"watchlistId": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-18", "timeCreated": + "2025-08-18T02:09:51.269589Z", "count": 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", + "name": "test-2025-08-19", "timeCreated": "2025-08-19T05:27:40.000616Z", + "count": 16}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": + "test-2025-08-21", "timeCreated": "2025-08-21T01:32:29.335752Z", "count": + 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-22", + "timeCreated": "2025-08-22T04:34:50.976937Z", "count": 15}, {"watchlistId": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-23", "timeCreated": + "2025-08-22T21:47:06.609169Z", "count": 14}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", + "name": "test-2025-08-26", "timeCreated": "2025-08-26T02:29:35.0685Z", + "count": 15}]}' headers: {} status: code: 200 message: OK - url: https://api.prd.stakeover.io/us/instrument/watchlists - request: body: null headers: @@ -68,17 +78,46 @@ interactions: body: string: '{"newWatchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "watchlists": - [{"watchlistId": "bb0f59b5-2454-451c-8de3-fa3fc7d13a42", "name": "Not so much - test", "timeCreated": "2022-07-14T05:25:44.881769Z", "count": 1}, {"watchlistId": - "e649db6d-71ab-4649-a32e-59d57def4a00", "name": "stef 2", "timeCreated": "2022-07-14T05:31:06.054443Z", - "count": 0}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": - "test_watchlist__NYSEUrl", "timeCreated": "2022-07-24T06:28:54.177475Z", "count": - 0}]}' + [{"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-13", + "timeCreated": "2025-08-12T23:54:17.121422Z", "count": 15}, {"watchlistId": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-14", "timeCreated": + "2025-08-14T01:58:57.211214Z", "count": 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", + "name": "test-2025-08-15", "timeCreated": "2025-08-15T01:35:39.886173Z", + "count": 17}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": + "test-2025-08-18", "timeCreated": "2025-08-18T02:09:51.269589Z", "count": + 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-19", + "timeCreated": "2025-08-19T05:27:40.000616Z", "count": 16}, {"watchlistId": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-21", "timeCreated": + "2025-08-21T01:32:29.335752Z", "count": 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", + "name": "test-2025-08-22", "timeCreated": "2025-08-22T04:34:50.976937Z", + "count": 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": + "test-2025-08-23", "timeCreated": "2025-08-22T21:47:06.609169Z", "count": + 14}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-26", + "timeCreated": "2025-08-26T02:29:35.0685Z", "count": 15}, {"watchlistId": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test_watchlist__NYSEUrl", + "timeCreated": "2025-09-01T13:05:45.299653Z", "count": 0}]}' + headers: {} + status: + code: 200 + message: OK + - request: + body: null + headers: + Accept: + - application/json + Content-Type: + - application/json + method: GET + uri: https://api.prd.stakeover.io/us/instrument/watchlist/1cf93550-8eb4-4c32-a229-826cf8c1be59 + response: + body: + string: + '{"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test_watchlist__NYSEUrl", + "count": 0, "instruments": []}' headers: {} status: code: 200 message: OK - url: https://api.prd.stakeover.io/us/instrument/watchlist - request: body: null headers: @@ -97,7 +136,6 @@ interactions: status: code: 200 message: OK - url: https://api.prd.stakeover.io/us/instrument/watchlist/1cf93550-8eb4-4c32-a229-826cf8c1be59 - request: body: null headers: @@ -111,16 +149,17 @@ interactions: body: string: '{"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test_watchlist__NYSEUrl", - "count": 3, "instruments": [{"instrumentId": "5b85fabb-d57c-44e6-a7f6-a3efc760226c", - "name": "Tesla, Inc.", "symbol": "TSLA"}, {"instrumentId": "68277cc0-6106-4f3c-849b-1298ba964aba", - "name": "Alphabet Inc. - Class C Shares", "symbol": "GOOG"}, {"instrumentId": - "e234cc98-cd08-4b04-a388-fe5c822beea6", "name": "Microsoft Corporation", "symbol": - "MSFT"}]}' + "count": 3, "instruments": [{"instrumentId": "68277cc0-6106-4f3c-849b-1298ba964aba", + "stakeInstrumentId": "9606cf50-41fe-42ea-b489-6da1768bc26e", "name": "Alphabet + Inc. - Class C Shares", "symbol": "GOOG"}, {"instrumentId": "5b85fabb-d57c-44e6-a7f6-a3efc760226c", + "stakeInstrumentId": "b4889388-1f73-46e5-a865-a68e5fd61ca5", "name": "Tesla, + Inc.", "symbol": "TSLA"}, {"instrumentId": "e234cc98-cd08-4b04-a388-fe5c822beea6", + "stakeInstrumentId": "e3769c0b-456d-49dd-bec5-7a750c146d11", "name": "Microsoft + Corporation", "symbol": "MSFT"}]}' headers: {} status: code: 200 message: OK - url: https://api.prd.stakeover.io/us/instrument/watchlist/1cf93550-8eb4-4c32-a229-826cf8c1be59/items - request: body: null headers: @@ -134,16 +173,17 @@ interactions: body: string: '{"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test_watchlist__NYSEUrl", - "count": 3, "instruments": [{"instrumentId": "5b85fabb-d57c-44e6-a7f6-a3efc760226c", - "name": "Tesla, Inc.", "symbol": "TSLA"}, {"instrumentId": "68277cc0-6106-4f3c-849b-1298ba964aba", - "name": "Alphabet Inc. - Class C Shares", "symbol": "GOOG"}, {"instrumentId": - "e234cc98-cd08-4b04-a388-fe5c822beea6", "name": "Microsoft Corporation", "symbol": - "MSFT"}]}' + "count": 3, "instruments": [{"instrumentId": "68277cc0-6106-4f3c-849b-1298ba964aba", + "stakeInstrumentId": "9606cf50-41fe-42ea-b489-6da1768bc26e", "name": "Alphabet + Inc. - Class C Shares", "symbol": "GOOG"}, {"instrumentId": "5b85fabb-d57c-44e6-a7f6-a3efc760226c", + "stakeInstrumentId": "b4889388-1f73-46e5-a865-a68e5fd61ca5", "name": "Tesla, + Inc.", "symbol": "TSLA"}, {"instrumentId": "e234cc98-cd08-4b04-a388-fe5c822beea6", + "stakeInstrumentId": "e3769c0b-456d-49dd-bec5-7a750c146d11", "name": "Microsoft + Corporation", "symbol": "MSFT"}]}' headers: {} status: code: 200 message: OK - url: https://api.prd.stakeover.io/us/instrument/watchlist/1cf93550-8eb4-4c32-a229-826cf8c1be59 - request: body: null headers: @@ -157,16 +197,17 @@ interactions: body: string: '{"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test_watchlist__NYSEUrl", - "count": 3, "instruments": [{"instrumentId": "5b85fabb-d57c-44e6-a7f6-a3efc760226c", - "name": "Tesla, Inc.", "symbol": "TSLA"}, {"instrumentId": "68277cc0-6106-4f3c-849b-1298ba964aba", - "name": "Alphabet Inc. - Class C Shares", "symbol": "GOOG"}, {"instrumentId": - "e234cc98-cd08-4b04-a388-fe5c822beea6", "name": "Microsoft Corporation", "symbol": - "MSFT"}]}' + "count": 3, "instruments": [{"instrumentId": "68277cc0-6106-4f3c-849b-1298ba964aba", + "stakeInstrumentId": "9606cf50-41fe-42ea-b489-6da1768bc26e", "name": "Alphabet + Inc. - Class C Shares", "symbol": "GOOG"}, {"instrumentId": "5b85fabb-d57c-44e6-a7f6-a3efc760226c", + "stakeInstrumentId": "b4889388-1f73-46e5-a865-a68e5fd61ca5", "name": "Tesla, + Inc.", "symbol": "TSLA"}, {"instrumentId": "e234cc98-cd08-4b04-a388-fe5c822beea6", + "stakeInstrumentId": "e3769c0b-456d-49dd-bec5-7a750c146d11", "name": "Microsoft + Corporation", "symbol": "MSFT"}]}' headers: {} status: code: 200 message: OK - url: https://api.prd.stakeover.io/us/instrument/watchlist/1cf93550-8eb4-4c32-a229-826cf8c1be59 - request: body: tickers: @@ -189,7 +230,6 @@ interactions: status: code: 200 message: OK - url: https://api.prd.stakeover.io/us/instrument/watchlist/1cf93550-8eb4-4c32-a229-826cf8c1be59/items - request: body: null headers: @@ -202,13 +242,24 @@ interactions: response: body: string: - '[{"watchlistId": "bb0f59b5-2454-451c-8de3-fa3fc7d13a42", "name": "Not - so much test", "timeCreated": "2022-07-14T05:25:44.881769Z", "count": 1}, - {"watchlistId": "e649db6d-71ab-4649-a32e-59d57def4a00", "name": "stef 2", - "timeCreated": "2022-07-14T05:31:06.054443Z", "count": 0}]' + '[{"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-13", + "timeCreated": "2025-08-12T23:54:17.121422Z", "count": 15}, {"watchlistId": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-14", "timeCreated": + "2025-08-14T01:58:57.211214Z", "count": 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", + "name": "test-2025-08-15", "timeCreated": "2025-08-15T01:35:39.886173Z", + "count": 17}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": + "test-2025-08-18", "timeCreated": "2025-08-18T02:09:51.269589Z", "count": + 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-19", + "timeCreated": "2025-08-19T05:27:40.000616Z", "count": 16}, {"watchlistId": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-21", "timeCreated": + "2025-08-21T01:32:29.335752Z", "count": 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", + "name": "test-2025-08-22", "timeCreated": "2025-08-22T04:34:50.976937Z", + "count": 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": + "test-2025-08-23", "timeCreated": "2025-08-22T21:47:06.609169Z", "count": + 14}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-26", + "timeCreated": "2025-08-26T02:29:35.0685Z", "count": 15}]' headers: {} status: code: 200 message: OK - url: https://api.prd.stakeover.io/us/instrument/watchlist/1cf93550-8eb4-4c32-a229-826cf8c1be59 version: 1 diff --git a/tests/cassettes/test_watchlist/test_create_watchlist[exchange1-symbols1].yaml b/tests/cassettes/test_watchlist/test_create_watchlist[exchange1-symbols1].yaml index dcacd83..c9af90b 100644 --- a/tests/cassettes/test_watchlist/test_create_watchlist[exchange1-symbols1].yaml +++ b/tests/cassettes/test_watchlist/test_create_watchlist[exchange1-symbols1].yaml @@ -18,14 +18,13 @@ interactions: "z0-0593879b", "macAccountNumber": "d9-0481457G", "status": null, "macStatus": "BASIC_USER", "dwStatus": null, "truliooStatus": "APPROVED", "truliooStatusWithWatchlist": null, "firstName": "Rita", "middleName": null, "lastName": "Jones", "phoneNumber": - "(640)242-4270x965", "signUpPhase": 0, "ackSignedWhen": "2021-11-15", "createdDate": + "(640)242-4270x965", "signUpPhase": 0, "ackSignedWhen": "2023-10-01", "createdDate": 1574303699770, "stakeApprovedDate": null, "accountType": "INDIVIDUAL", "masterAccountId": null, "referralCode": "W2-6612029X", "referredByCode": null, "regionIdentifier": "AUS", "assetSummary": null, "fundingStatistics": null, "tradingStatistics": null, "w8File": [], "rewardJourneyTimestamp": null, "rewardJourneyStatus": null, "userProfile": {"residentialAddress": null, "postalAddress": null}, - "ledgerBalance": 0.0, "investorAccreditations": null, "proscoreStatus": null, - "fxSpeed": "Regular", "facilitaStatus": null, "dateOfBirth": null, "upToDateDetails2021": + "ledgerBalance": 0.0, "fxSpeed": "Regular", "dateOfBirth": null, "upToDateDetails2021": "NO_REQUIREMENTS", "stakeKycStatus": "KYC_APPROVED", "awxMigrationDocsRequired": null, "documentsStatus": "NO_ACTION", "accountStatus": "OPEN", "mfaenabled": false}' @@ -33,7 +32,6 @@ interactions: status: code: 200 message: OK - url: https://global-prd-api.hellostake.com/api/user - request: body: null headers: @@ -47,17 +45,25 @@ interactions: body: string: '{"generated": false, "watchlists": [{"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", - "name": "List #1", "count": 7, "timeCreated": "2022-05-27T22:13:19.251101"}, - {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "Minervini", - "count": 1, "timeCreated": "2022-05-30T06:21:48.134924"}, {"watchlistId": - "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "Test List", "count": 0, "timeCreated": - "2022-07-13T04:05:52.149562"}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", - "name": "Stef 3", "count": 3, "timeCreated": "2022-07-14T07:56:40.921637"}]}' + "name": "test-2025-08-05", "count": 13, "timeCreated": "2025-08-05T07:20:15.861472"}, + {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-06", + "count": 14, "timeCreated": "2025-08-06T11:14:12.301944"}, {"watchlistId": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-09", "count": + 15, "timeCreated": "2025-08-09T00:40:14.987686"}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", + "name": "test-2025-08-11", "count": 15, "timeCreated": "2025-08-11T10:47:31.306034"}, + {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-13", + "count": 14, "timeCreated": "2025-08-13T06:34:29.643625"}, {"watchlistId": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-21", "count": + 16, "timeCreated": "2025-08-21T01:40:59.486169"}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", + "name": "test-2025-08-22", "count": 16, "timeCreated": "2025-08-22T05:00:05.327484"}, + {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-23", + "count": 14, "timeCreated": "2025-08-22T21:55:05.81269"}, {"watchlistId": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-26", "count": + 16, "timeCreated": "2025-08-26T02:52:58.934391"}]}' headers: {} status: code: 200 message: OK - url: https://global-prd-api.hellostake.com/api/asx/instrument/v2/watchlists - request: body: null headers: @@ -71,20 +77,27 @@ interactions: body: string: '{"newWatchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "watchlists": - [{"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "List #1", - "count": 7, "timeCreated": "2022-05-27T22:13:19.251101"}, {"watchlistId": - "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "Minervini", "count": 1, "timeCreated": - "2022-05-30T06:21:48.134924"}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", - "name": "Test List", "count": 0, "timeCreated": "2022-07-13T04:05:52.149562"}, - {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "Stef 3", - "count": 3, "timeCreated": "2022-07-14T07:56:40.921637"}, {"watchlistId": - "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test_watchlist__ASXUrl", - "count": 0, "timeCreated": "2022-07-24T06:33:04.897381"}]}' + [{"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-05", + "count": 13, "timeCreated": "2025-08-05T07:20:15.861472"}, {"watchlistId": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-06", "count": + 14, "timeCreated": "2025-08-06T11:14:12.301944"}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", + "name": "test-2025-08-09", "count": 15, "timeCreated": "2025-08-09T00:40:14.987686"}, + {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-11", + "count": 15, "timeCreated": "2025-08-11T10:47:31.306034"}, {"watchlistId": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-13", "count": + 14, "timeCreated": "2025-08-13T06:34:29.643625"}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", + "name": "test-2025-08-21", "count": 16, "timeCreated": "2025-08-21T01:40:59.486169"}, + {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-22", + "count": 16, "timeCreated": "2025-08-22T05:00:05.327484"}, {"watchlistId": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-23", "count": + 14, "timeCreated": "2025-08-22T21:55:05.81269"}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", + "name": "test-2025-08-26", "count": 16, "timeCreated": "2025-08-26T02:52:58.934391"}, + {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test_watchlist__ASXUrl", + "count": 0, "timeCreated": "2025-09-01T13:05:47.428516"}]}' headers: {} status: code: 201 message: Created - url: https://global-prd-api.hellostake.com/api/asx/instrument/v2/watchlist - request: body: null headers: @@ -103,7 +116,24 @@ interactions: status: code: 200 message: OK - url: https://global-prd-api.hellostake.com/api/asx/instrument/v2/watchlist/1cf93550-8eb4-4c32-a229-826cf8c1be59 + - request: + body: null + headers: + Accept: + - application/json + Content-Type: + - application/json + method: GET + uri: https://global-prd-api.hellostake.com/api/asx/instrument/v2/watchlist/1cf93550-8eb4-4c32-a229-826cf8c1be59 + response: + body: + string: + '{"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test_watchlist__ASXUrl", + "count": 0, "instruments": []}' + headers: {} + status: + code: 200 + message: OK - request: body: null headers: @@ -122,12 +152,11 @@ interactions: {"instrumentId": "WDS.XAU", "name": "Woodside Energy Group Ltd", "symbol": "WDS", "recentAnnouncement": false, "sensitive": false}, {"instrumentId": "COL.XAU", "name": "Coles Group Limited", "symbol": "COL", "recentAnnouncement": - false, "sensitive": false}]}' + true, "sensitive": false}]}' headers: {} status: code: 201 message: Created - url: https://global-prd-api.hellostake.com/api/asx/instrument/v2/watchlist/1cf93550-8eb4-4c32-a229-826cf8c1be59/items - request: body: null headers: @@ -146,12 +175,11 @@ interactions: {"instrumentId": "WDS.XAU", "name": "Woodside Energy Group Ltd", "symbol": "WDS", "recentAnnouncement": false, "sensitive": false}, {"instrumentId": "COL.XAU", "name": "Coles Group Limited", "symbol": "COL", "recentAnnouncement": - false, "sensitive": false}]}' + true, "sensitive": false}]}' headers: {} status: code: 200 message: OK - url: https://global-prd-api.hellostake.com/api/asx/instrument/v2/watchlist/1cf93550-8eb4-4c32-a229-826cf8c1be59 - request: body: null headers: @@ -170,12 +198,11 @@ interactions: {"instrumentId": "WDS.XAU", "name": "Woodside Energy Group Ltd", "symbol": "WDS", "recentAnnouncement": false, "sensitive": false}, {"instrumentId": "COL.XAU", "name": "Coles Group Limited", "symbol": "COL", "recentAnnouncement": - false, "sensitive": false}]}' + true, "sensitive": false}]}' headers: {} status: code: 200 message: OK - url: https://global-prd-api.hellostake.com/api/asx/instrument/v2/watchlist/1cf93550-8eb4-4c32-a229-826cf8c1be59 - request: body: tickers: @@ -198,7 +225,6 @@ interactions: status: code: 200 message: OK - url: https://global-prd-api.hellostake.com/api/asx/instrument/v2/watchlist/1cf93550-8eb4-4c32-a229-826cf8c1be59/items - request: body: null headers: @@ -211,16 +237,23 @@ interactions: response: body: string: - '[{"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "List - #1", "count": 7, "timeCreated": "2022-05-27T22:13:19.251101"}, {"watchlistId": - "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "Minervini", "count": 1, "timeCreated": - "2022-05-30T06:21:48.134924"}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", - "name": "Test List", "count": 0, "timeCreated": "2022-07-13T04:05:52.149562"}, - {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "Stef 3", - "count": 3, "timeCreated": "2022-07-14T07:56:40.921637"}]' + '[{"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-05", + "count": 13, "timeCreated": "2025-08-05T07:20:15.861472"}, {"watchlistId": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-06", "count": + 14, "timeCreated": "2025-08-06T11:14:12.301944"}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", + "name": "test-2025-08-09", "count": 15, "timeCreated": "2025-08-09T00:40:14.987686"}, + {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-11", + "count": 15, "timeCreated": "2025-08-11T10:47:31.306034"}, {"watchlistId": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-13", "count": + 14, "timeCreated": "2025-08-13T06:34:29.643625"}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", + "name": "test-2025-08-21", "count": 16, "timeCreated": "2025-08-21T01:40:59.486169"}, + {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-22", + "count": 16, "timeCreated": "2025-08-22T05:00:05.327484"}, {"watchlistId": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-23", "count": + 14, "timeCreated": "2025-08-22T21:55:05.81269"}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", + "name": "test-2025-08-26", "count": 16, "timeCreated": "2025-08-26T02:52:58.934391"}]' headers: {} status: code: 200 message: OK - url: https://global-prd-api.hellostake.com/api/asx/instrument/v2/watchlist/1cf93550-8eb4-4c32-a229-826cf8c1be59 version: 1 diff --git a/tests/cassettes/test_watchlist/test_create_watchlist_with_tickers[exchange0-symbols0].yaml b/tests/cassettes/test_watchlist/test_create_watchlist_with_tickers[exchange0-symbols0].yaml new file mode 100644 index 0000000..1f7b9bc --- /dev/null +++ b/tests/cassettes/test_watchlist/test_create_watchlist_with_tickers[exchange0-symbols0].yaml @@ -0,0 +1,179 @@ +interactions: + - request: + body: null + headers: + Accept: + - application/json + Content-Type: + - application/json + method: GET + uri: https://global-prd-api.hellostake.com/api/user + response: + body: + string: + '{"canTradeOnUnsettledFunds": false, "cpfValue": null, "emailVerified": + true, "hasFunded": true, "hasTraded": true, "userId": "7c9bbfae-0000-47b7-0000-0e66d868c2cf", + "username": "michael29", "emailAddress": "reevesmegan@gilmore-wright.biz", + "dw_AccountId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "dw_AccountNumber": + "z0-0593879b", "macAccountNumber": "d9-0481457G", "status": null, "macStatus": + "BASIC_USER", "dwStatus": null, "truliooStatus": "APPROVED", "truliooStatusWithWatchlist": + null, "firstName": "Rita", "middleName": null, "lastName": "Jones", "phoneNumber": + "(640)242-4270x965", "signUpPhase": 0, "ackSignedWhen": "2023-10-01", "createdDate": + 1574303699770, "stakeApprovedDate": null, "accountType": "INDIVIDUAL", "masterAccountId": + null, "referralCode": "W2-6612029X", "referredByCode": null, "regionIdentifier": + "AUS", "assetSummary": null, "fundingStatistics": null, "tradingStatistics": + null, "w8File": [], "rewardJourneyTimestamp": null, "rewardJourneyStatus": + null, "userProfile": {"residentialAddress": null, "postalAddress": null}, + "ledgerBalance": 0.0, "fxSpeed": "Regular", "dateOfBirth": null, "upToDateDetails2021": + "NO_REQUIREMENTS", "stakeKycStatus": "KYC_APPROVED", "awxMigrationDocsRequired": + null, "documentsStatus": "NO_ACTION", "accountStatus": "OPEN", "mfaenabled": + false}' + headers: {} + status: + code: 200 + message: OK + - request: + body: null + headers: + Accept: + - application/json + Content-Type: + - application/json + method: GET + uri: https://api.prd.stakeover.io/us/instrument/watchlists + response: + body: + string: + '{"generated": false, "watchlists": [{"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", + "name": "test-2025-08-13", "timeCreated": "2025-08-12T23:54:17.121422Z", + "count": 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": + "test-2025-08-14", "timeCreated": "2025-08-14T01:58:57.211214Z", "count": + 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-15", + "timeCreated": "2025-08-15T01:35:39.886173Z", "count": 17}, {"watchlistId": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-18", "timeCreated": + "2025-08-18T02:09:51.269589Z", "count": 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", + "name": "test-2025-08-19", "timeCreated": "2025-08-19T05:27:40.000616Z", + "count": 16}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": + "test-2025-08-21", "timeCreated": "2025-08-21T01:32:29.335752Z", "count": + 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-22", + "timeCreated": "2025-08-22T04:34:50.976937Z", "count": 15}, {"watchlistId": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-23", "timeCreated": + "2025-08-22T21:47:06.609169Z", "count": 14}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", + "name": "test-2025-08-26", "timeCreated": "2025-08-26T02:29:35.0685Z", + "count": 15}]}' + headers: {} + status: + code: 200 + message: OK + - request: + body: null + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.prd.stakeover.io/us/instrument/watchlist + response: + body: + string: + '{"newWatchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "watchlists": + [{"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-13", + "timeCreated": "2025-08-12T23:54:17.121422Z", "count": 15}, {"watchlistId": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-14", "timeCreated": + "2025-08-14T01:58:57.211214Z", "count": 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", + "name": "test-2025-08-15", "timeCreated": "2025-08-15T01:35:39.886173Z", + "count": 17}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": + "test-2025-08-18", "timeCreated": "2025-08-18T02:09:51.269589Z", "count": + 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-19", + "timeCreated": "2025-08-19T05:27:40.000616Z", "count": 16}, {"watchlistId": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-21", "timeCreated": + "2025-08-21T01:32:29.335752Z", "count": 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", + "name": "test-2025-08-22", "timeCreated": "2025-08-22T04:34:50.976937Z", + "count": 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": + "test-2025-08-23", "timeCreated": "2025-08-22T21:47:06.609169Z", "count": + 14}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-26", + "timeCreated": "2025-08-26T02:29:35.0685Z", "count": 15}, {"watchlistId": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test_watchlist__NYSEUrl", + "timeCreated": "2025-09-01T13:05:48.891648Z", "count": 0}]}' + headers: {} + status: + code: 200 + message: OK + - request: + body: null + headers: + Accept: + - application/json + Content-Type: + - application/json + method: GET + uri: https://api.prd.stakeover.io/us/instrument/watchlist/1cf93550-8eb4-4c32-a229-826cf8c1be59 + response: + body: + string: + '{"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test_watchlist__NYSEUrl", + "count": 0, "instruments": []}' + headers: {} + status: + code: 200 + message: OK + - request: + body: null + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.prd.stakeover.io/us/instrument/watchlist/1cf93550-8eb4-4c32-a229-826cf8c1be59/items + response: + body: + string: + '{"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test_watchlist__NYSEUrl", + "count": 4, "instruments": [{"instrumentId": "68277cc0-6106-4f3c-849b-1298ba964aba", + "stakeInstrumentId": "9606cf50-41fe-42ea-b489-6da1768bc26e", "name": "Alphabet + Inc. - Class C Shares", "symbol": "GOOG"}, {"instrumentId": "5772f238-235d-40c2-9053-c13815fee7eb", + "stakeInstrumentId": "b19da77b-0d19-420d-9a63-26b697182773", "name": "Nokia + Corp.", "symbol": "NOK"}, {"instrumentId": "5b85fabb-d57c-44e6-a7f6-a3efc760226c", + "stakeInstrumentId": "b4889388-1f73-46e5-a865-a68e5fd61ca5", "name": "Tesla, + Inc.", "symbol": "TSLA"}, {"instrumentId": "e234cc98-cd08-4b04-a388-fe5c822beea6", + "stakeInstrumentId": "e3769c0b-456d-49dd-bec5-7a750c146d11", "name": "Microsoft + Corporation", "symbol": "MSFT"}]}' + headers: {} + status: + code: 200 + message: OK + - request: + body: null + headers: + Accept: + - application/json + Content-Type: + - application/json + method: DELETE + uri: https://api.prd.stakeover.io/us/instrument/watchlist/1cf93550-8eb4-4c32-a229-826cf8c1be59 + response: + body: + string: + '[{"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-13", + "timeCreated": "2025-08-12T23:54:17.121422Z", "count": 15}, {"watchlistId": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-14", "timeCreated": + "2025-08-14T01:58:57.211214Z", "count": 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", + "name": "test-2025-08-15", "timeCreated": "2025-08-15T01:35:39.886173Z", + "count": 17}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": + "test-2025-08-18", "timeCreated": "2025-08-18T02:09:51.269589Z", "count": + 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-19", + "timeCreated": "2025-08-19T05:27:40.000616Z", "count": 16}, {"watchlistId": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-21", "timeCreated": + "2025-08-21T01:32:29.335752Z", "count": 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", + "name": "test-2025-08-22", "timeCreated": "2025-08-22T04:34:50.976937Z", + "count": 15}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": + "test-2025-08-23", "timeCreated": "2025-08-22T21:47:06.609169Z", "count": + 14}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-26", + "timeCreated": "2025-08-26T02:29:35.0685Z", "count": 15}]' + headers: {} + status: + code: 200 + message: OK +version: 1 diff --git a/tests/cassettes/test_watchlist/test_create_watchlist_with_tickers[exchange1-symbols1].yaml b/tests/cassettes/test_watchlist/test_create_watchlist_with_tickers[exchange1-symbols1].yaml new file mode 100644 index 0000000..6f70849 --- /dev/null +++ b/tests/cassettes/test_watchlist/test_create_watchlist_with_tickers[exchange1-symbols1].yaml @@ -0,0 +1,175 @@ +interactions: + - request: + body: null + headers: + Accept: + - application/json + Content-Type: + - application/json + method: GET + uri: https://global-prd-api.hellostake.com/api/user + response: + body: + string: + '{"canTradeOnUnsettledFunds": false, "cpfValue": null, "emailVerified": + true, "hasFunded": true, "hasTraded": true, "userId": "7c9bbfae-0000-47b7-0000-0e66d868c2cf", + "username": "michael29", "emailAddress": "reevesmegan@gilmore-wright.biz", + "dw_AccountId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "dw_AccountNumber": + "z0-0593879b", "macAccountNumber": "d9-0481457G", "status": null, "macStatus": + "BASIC_USER", "dwStatus": null, "truliooStatus": "APPROVED", "truliooStatusWithWatchlist": + null, "firstName": "Rita", "middleName": null, "lastName": "Jones", "phoneNumber": + "(640)242-4270x965", "signUpPhase": 0, "ackSignedWhen": "2023-10-01", "createdDate": + 1574303699770, "stakeApprovedDate": null, "accountType": "INDIVIDUAL", "masterAccountId": + null, "referralCode": "W2-6612029X", "referredByCode": null, "regionIdentifier": + "AUS", "assetSummary": null, "fundingStatistics": null, "tradingStatistics": + null, "w8File": [], "rewardJourneyTimestamp": null, "rewardJourneyStatus": + null, "userProfile": {"residentialAddress": null, "postalAddress": null}, + "ledgerBalance": 0.0, "fxSpeed": "Regular", "dateOfBirth": null, "upToDateDetails2021": + "NO_REQUIREMENTS", "stakeKycStatus": "KYC_APPROVED", "awxMigrationDocsRequired": + null, "documentsStatus": "NO_ACTION", "accountStatus": "OPEN", "mfaenabled": + false}' + headers: {} + status: + code: 200 + message: OK + - request: + body: null + headers: + Accept: + - application/json + Content-Type: + - application/json + method: GET + uri: https://global-prd-api.hellostake.com/api/asx/instrument/v2/watchlists + response: + body: + string: + '{"generated": false, "watchlists": [{"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", + "name": "test-2025-08-05", "count": 13, "timeCreated": "2025-08-05T07:20:15.861472"}, + {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-06", + "count": 14, "timeCreated": "2025-08-06T11:14:12.301944"}, {"watchlistId": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-09", "count": + 15, "timeCreated": "2025-08-09T00:40:14.987686"}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", + "name": "test-2025-08-11", "count": 15, "timeCreated": "2025-08-11T10:47:31.306034"}, + {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-13", + "count": 14, "timeCreated": "2025-08-13T06:34:29.643625"}, {"watchlistId": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-21", "count": + 16, "timeCreated": "2025-08-21T01:40:59.486169"}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", + "name": "test-2025-08-22", "count": 16, "timeCreated": "2025-08-22T05:00:05.327484"}, + {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-23", + "count": 14, "timeCreated": "2025-08-22T21:55:05.81269"}, {"watchlistId": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-26", "count": + 16, "timeCreated": "2025-08-26T02:52:58.934391"}]}' + headers: {} + status: + code: 200 + message: OK + - request: + body: null + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://global-prd-api.hellostake.com/api/asx/instrument/v2/watchlist + response: + body: + string: + '{"newWatchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "watchlists": + [{"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-05", + "count": 13, "timeCreated": "2025-08-05T07:20:15.861472"}, {"watchlistId": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-06", "count": + 14, "timeCreated": "2025-08-06T11:14:12.301944"}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", + "name": "test-2025-08-09", "count": 15, "timeCreated": "2025-08-09T00:40:14.987686"}, + {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-11", + "count": 15, "timeCreated": "2025-08-11T10:47:31.306034"}, {"watchlistId": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-13", "count": + 14, "timeCreated": "2025-08-13T06:34:29.643625"}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", + "name": "test-2025-08-21", "count": 16, "timeCreated": "2025-08-21T01:40:59.486169"}, + {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-22", + "count": 16, "timeCreated": "2025-08-22T05:00:05.327484"}, {"watchlistId": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-23", "count": + 14, "timeCreated": "2025-08-22T21:55:05.81269"}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", + "name": "test-2025-08-26", "count": 16, "timeCreated": "2025-08-26T02:52:58.934391"}, + {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test_watchlist__ASXUrl", + "count": 0, "timeCreated": "2025-09-01T13:05:50.279057"}]}' + headers: {} + status: + code: 201 + message: Created + - request: + body: null + headers: + Accept: + - application/json + Content-Type: + - application/json + method: GET + uri: https://global-prd-api.hellostake.com/api/asx/instrument/v2/watchlist/1cf93550-8eb4-4c32-a229-826cf8c1be59 + response: + body: + string: + '{"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test_watchlist__ASXUrl", + "count": 0, "instruments": []}' + headers: {} + status: + code: 200 + message: OK + - request: + body: null + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://global-prd-api.hellostake.com/api/asx/instrument/v2/watchlist/1cf93550-8eb4-4c32-a229-826cf8c1be59/items + response: + body: + string: + '{"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test_watchlist__ASXUrl", + "count": 4, "instruments": [{"instrumentId": "OOO.XAU", "name": "BetaShares + Crude Oil Index ETF-Currency Hedged (Synthetic)", "symbol": "OOO", "recentAnnouncement": + false, "sensitive": false}, {"instrumentId": "BHP.XAU", "name": "BHP Group + Limited", "symbol": "BHP", "recentAnnouncement": false, "sensitive": false}, + {"instrumentId": "WDS.XAU", "name": "Woodside Energy Group Ltd", "symbol": + "WDS", "recentAnnouncement": false, "sensitive": false}, {"instrumentId": + "COL.XAU", "name": "Coles Group Limited", "symbol": "COL", "recentAnnouncement": + true, "sensitive": false}]}' + headers: {} + status: + code: 201 + message: Created + - request: + body: null + headers: + Accept: + - application/json + Content-Type: + - application/json + method: DELETE + uri: https://global-prd-api.hellostake.com/api/asx/instrument/v2/watchlist/1cf93550-8eb4-4c32-a229-826cf8c1be59 + response: + body: + string: + '[{"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-05", + "count": 13, "timeCreated": "2025-08-05T07:20:15.861472"}, {"watchlistId": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-06", "count": + 14, "timeCreated": "2025-08-06T11:14:12.301944"}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", + "name": "test-2025-08-09", "count": 15, "timeCreated": "2025-08-09T00:40:14.987686"}, + {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-11", + "count": 15, "timeCreated": "2025-08-11T10:47:31.306034"}, {"watchlistId": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-13", "count": + 14, "timeCreated": "2025-08-13T06:34:29.643625"}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", + "name": "test-2025-08-21", "count": 16, "timeCreated": "2025-08-21T01:40:59.486169"}, + {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-22", + "count": 16, "timeCreated": "2025-08-22T05:00:05.327484"}, {"watchlistId": + "1cf93550-8eb4-4c32-a229-826cf8c1be59", "name": "test-2025-08-23", "count": + 14, "timeCreated": "2025-08-22T21:55:05.81269"}, {"watchlistId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", + "name": "test-2025-08-26", "count": 16, "timeCreated": "2025-08-26T02:52:58.934391"}]' + headers: {} + status: + code: 200 + message: OK +version: 1 diff --git a/tests/cassettes/test_watchlist/test_list_watchlist.yaml b/tests/cassettes/test_watchlist/test_list_watchlist.yaml index adca02b..a7bef29 100644 --- a/tests/cassettes/test_watchlist/test_list_watchlist.yaml +++ b/tests/cassettes/test_watchlist/test_list_watchlist.yaml @@ -13,266 +13,23 @@ interactions: string: '{"canTradeOnUnsettledFunds": false, "cpfValue": null, "emailVerified": true, "hasFunded": true, "hasTraded": true, "userId": "7c9bbfae-0000-47b7-0000-0e66d868c2cf", - "username": "rita19", "emailAddress": "torresbenjamin@gmail.com", "dw_AccountId": - "1cf93550-8eb4-4c32-a229-826cf8c1be59", "dw_AccountNumber": "w4-1267174s", - "macAccountNumber": "H1-7641957H", "status": null, "macStatus": "BASIC_USER", - "dwStatus": null, "truliooStatus": "APPROVED", "truliooStatusWithWatchlist": - null, "firstName": "Tammy", "lastName": "Alexander", "phoneNumber": "9011530005", - "signUpPhase": 0, "ackSignedWhen": "2021-05-18", "createdDate": 1574303699770, - "stakeApprovedDate": null, "accountType": "INDIVIDUAL", "masterAccountId": - null, "referralCode": "L7-2127933N", "referredByCode": null, "regionIdentifier": + "username": "michael29", "emailAddress": "reevesmegan@gilmore-wright.biz", + "dw_AccountId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "dw_AccountNumber": + "z0-0593879b", "macAccountNumber": "d9-0481457G", "status": null, "macStatus": + "BASIC_USER", "dwStatus": null, "truliooStatus": "APPROVED", "truliooStatusWithWatchlist": + null, "firstName": "Rita", "middleName": null, "lastName": "Jones", "phoneNumber": + "(640)242-4270x965", "signUpPhase": 0, "ackSignedWhen": "2023-10-01", "createdDate": + 1574303699770, "stakeApprovedDate": null, "accountType": "INDIVIDUAL", "masterAccountId": + null, "referralCode": "W2-6612029X", "referredByCode": null, "regionIdentifier": "AUS", "assetSummary": null, "fundingStatistics": null, "tradingStatistics": null, "w8File": [], "rewardJourneyTimestamp": null, "rewardJourneyStatus": null, "userProfile": {"residentialAddress": null, "postalAddress": null}, - "ledgerBalance": 0.0, "investorAccreditations": null, "proscoreStatus": null, - "fxSpeed": "Regular", "facilitaStatus": null, "dateOfBirth": null, "upToDateDetails2021": + "ledgerBalance": 0.0, "fxSpeed": "Regular", "dateOfBirth": null, "upToDateDetails2021": "NO_REQUIREMENTS", "stakeKycStatus": "KYC_APPROVED", "awxMigrationDocsRequired": - null, "documentsStatus": "NO_ACTION", "mfaenabled": false}' + null, "documentsStatus": "NO_ACTION", "accountStatus": "OPEN", "mfaenabled": + false}' headers: {} status: code: 200 message: OK - url: https://global-prd-api.hellostake.com/api/user - - request: - body: null - headers: - Accept: - - application/json - Content-Type: - - application/json - method: GET - uri: https://global-prd-api.hellostake.com/api/products/productsWatchlist/7c9bbfae-0000-47b7-0000-0e66d868c2cf - response: - body: - string: - '{"instrumentsWatchList": [{"productWatchlistID": "7c9bbfae-0000-47b7-0000-0e66d868c2cf", - "product": {"id": "6fb39222-3b8d-4b80-933d-3ef7b95148b5", "instrumentTypeID": - null, "symbol": "VMW", "description": "VMware, Inc. is an information technology - (IT) company. The Company is engaged in development and application of virtualization - technologies with x86 server-based computing, separating application software - from the underlying hardware. The Company offers various products, which allow - organizations to manage IT resources across private clouds and multi-cloud, - multi-device environments by leveraging synergies across three product categories: - Software-Defined Data Center (SDDC), Hybrid Cloud Computing and End-User Computing - (EUC). The SDDC is designed to transform and modernize the data center into - an on-demand service that addresses application requirements by abstracting, - pooling and automating the services that are required from the underlying - hardware. The Company provides many storage and availability products to offer - data storage and protection options to all applications running on the vSphere - platform. Its wholly owned subsidiary include Pivotal Software Inc.", "category": - "Stock", "currencyID": "USD", "urlImage": "https://d3an3cesqmrf1x.cloudfront.net/images/symbols/vmw.png", - "sector": "Technology", "name": "VMware, Inc.", "dailyReturn": -0.36, "dailyReturnPercentage": - -0.29, "lastTraded": 124.35, "monthlyReturn": 0.0, "yearlyReturnPercentage": - 31.23, "yearlyReturnValue": 34.18, "popularity": 1500.0, "watched": 868, "news": - 0, "bought": 826, "viewed": 2300, "productType": "Instrument", "exchange": - null, "status": "ACTIVE", "type": "EQUITY", "encodedName": "vmware-inc-vmw", - "period": "YEAR RETURN", "inceptionDate": 1187136000000, "instrumentTags": - ["Cloud Computing", "Applications", "Technology", "Software", "Data Storage"], - "childInstruments": []}, "watchedDate": "2019-11-21 20:04:09.76"}, {"productWatchlistID": - "1cf93550-8eb4-4c32-a229-826cf8c1be59", "product": {"id": "6fb39222-3b8d-4b80-933d-3ef7b95148b5", - "instrumentTypeID": null, "symbol": "TWLO", "description": "Twilio Inc. offers - Cloud Communications Platform, which enables developers to build, scale and - operate real-time communications within software applications. The Company''s - platform consists of Programmable Communications Cloud, Super Network and - Business Model for Innovators. Its Programmable Communications Cloud software - enables developers to embed voice, messaging, video and authentication capabilities - into their applications through its Application Programming Interfaces (APIs). - Its Programmable Communications Cloud offers building blocks that enable its - customers to build what they need. Its Programmable Communications Cloud includes - Programmable Voice, Programmable Messaging, Programmable Video and Use Case - APIs. The Super Network is its software layer that allows its customers'' - software to communicate with connected devices globally. It interconnects - with communications networks around the world.", "category": "Stock", "currencyID": - "USD", "urlImage": "https://d3an3cesqmrf1x.cloudfront.net/images/symbols/twlo.png", - "sector": "Technology", "name": "Twilio", "dailyReturn": -3.54, "dailyReturnPercentage": - -1.71, "lastTraded": 203.7, "monthlyReturn": 0.0, "yearlyReturnPercentage": - 291.28, "yearlyReturnValue": 269.75, "popularity": 14533.0, "watched": 4521, - "news": 0, "bought": 11271, "viewed": 14900, "productType": "Instrument", - "exchange": null, "status": "ACTIVE", "type": "EQUITY", "encodedName": "twilio-twlo", - "period": "YEAR RETURN", "inceptionDate": 1466640000000, "instrumentTags": - ["Cloud Computing", "Applications", "Software", "Internet", "Telecommunications"], - "childInstruments": []}, "watchedDate": "2019-11-21 20:04:09.76"}, {"productWatchlistID": - "1cf93550-8eb4-4c32-a229-826cf8c1be59", "product": {"id": "6fb39222-3b8d-4b80-933d-3ef7b95148b5", - "instrumentTypeID": null, "symbol": "ATVI", "description": "Activision Blizzard, - Inc. is a developer and publisher of interactive entertainment content and - services. The Company develops and distributes content and services on video - game consoles, personal computers (PC) and mobile devices. Its segments include - Activision Publishing, Inc. (Activision), Blizzard Entertainment, Inc. (Blizzard), - King Digital Entertainment (King) and Other. Activision delivers content through - both premium and free-to-play offerings. It also includes the activities of - the Call of Duty League, a global professional esports league with city-based - teams. Blizzard develops and publishes entertainment software for creating - games. Blizzard also maintains an online gaming service, Blizzard Battle.net - , which facilitates digital distribution of Blizzard content and selected - Activision content, online social connectivity, and the creation of user-generated - content. King delivers content on the mobile platform. Kings\u2019 product - franchise is Candy Crush, a match three franchise.", "category": "Stock", - "currencyID": "USD", "urlImage": "https://d3an3cesqmrf1x.cloudfront.net/images/symbols/atvi.png", - "sector": "Technology", "name": "Activision Blizzard, Inc.", "dailyReturn": - -0.18, "dailyReturnPercentage": -0.22, "lastTraded": 82.13, "monthlyReturn": - 0.0, "yearlyReturnPercentage": 53.35, "yearlyReturnValue": 32.18, "popularity": - 1617.0, "watched": 5632, "news": 0, "bought": 7394, "viewed": 18200, "productType": - "Instrument", "exchange": null, "status": "ACTIVE", "type": "EQUITY", "encodedName": - "activision-blizzard-inc-atvi", "period": "YEAR RETURN", "inceptionDate": - 751507200000, "instrumentTags": ["Entertainment", "Digital Media", "Internet", - "Gaming"], "childInstruments": []}, "watchedDate": "2019-11-21 20:04:09.76"}, - {"productWatchlistID": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "product": - {"id": "6fb39222-3b8d-4b80-933d-3ef7b95148b5", "instrumentTypeID": null, "symbol": - "LI", "description": "Li Auto Inc is a China-based holding company engaged - in design, development, manufacturing and sales of smart electric sport utility - vehicles (SUVs). The Company\u2019s primary product is the SUVs under its - brand Li ONE. It also sells peripheral products and provides related services, - such as charging stalls, vehicle internet connection services and extended - lifetime warranties. The Company operates its businesses through its subsidiaries - and variable interest entities (VIEs) in China. ", "category": "Stock", "currencyID": - null, "urlImage": "https://drivewealth.imgix.net/symbols/li.png?fit=fillmax&w=125&h=125&bg=FFFFFF", - "sector": null, "name": "Li Auto Inc", "dailyReturn": -1.18, "dailyReturnPercentage": - -3.87, "lastTraded": 29.29, "monthlyReturn": 0.0, "yearlyReturnPercentage": - null, "yearlyReturnValue": null, "popularity": 14417.0, "watched": 3908, "news": - 0, "bought": 12736, "viewed": 11346, "productType": "Instrument", "exchange": - null, "status": "ACTIVE", "type": "EQUITY", "encodedName": "li-auto-inc-li", - "period": "YEAR RETURN", "inceptionDate": null, "instrumentTags": ["Vehicle", - "China", "Electric", "Renewable Energy", "Electric Cars"], "childInstruments": - []}, "watchedDate": "2019-11-21 20:04:09.76"}, {"productWatchlistID": "1cf93550-8eb4-4c32-a229-826cf8c1be59", - "product": {"id": "6fb39222-3b8d-4b80-933d-3ef7b95148b5", "instrumentTypeID": - null, "symbol": "PEAK", "description": "Healthpeak Properties, Inc., formerly - HCP, Inc., is a diversified real estate investment trust, which invests in - real estate serving the healthcare industry in the United States. The Company - acquires, develops, leases, owns and manages healthcare real estate facilities. - The Company''s segments include senior housing triple-net, senior housing - operating portfolio (SHOP), life science and medical office. Its senior housing - facilities include independent living facilities, assisted living facilities, - memory care facilities, care homes, and continuing care retirement communities. - Its Life science properties contain laboratory and office space for biotechnology, - medical device and pharmaceutical companies, scientific research institutions, - government agencies and other organizations. Its Medical office buildings - include physicians'' offices and examination rooms.", "category": "Stock", - "currencyID": "USD", "urlImage": "https://d3an3cesqmrf1x.cloudfront.net/images/symbols/hcp.png", - "sector": "Real Estate", "name": "Healthpeak Properties, Inc.", "dailyReturn": - -0.34, "dailyReturnPercentage": -0.94, "lastTraded": 35.74, "monthlyReturn": - 0.0, "yearlyReturnPercentage": -0.84, "yearlyReturnValue": -0.26, "popularity": - 0.0, "watched": 157, "news": 0, "bought": 154, "viewed": 416, "productType": - "Instrument", "exchange": null, "status": "ACTIVE", "type": "EQUITY", "encodedName": - "healthpeak-properties-inc-peak", "period": "YEAR RETURN", "inceptionDate": - 563068800000, "instrumentTags": ["Laboratories", "Real Estate", "Healthcare", - "Medical", "Investment"], "childInstruments": []}, "watchedDate": "2019-11-21 - 20:04:09.76"}, {"productWatchlistID": "1cf93550-8eb4-4c32-a229-826cf8c1be59", - "product": {"id": "6fb39222-3b8d-4b80-933d-3ef7b95148b5", "instrumentTypeID": - null, "symbol": "MGNX", "description": "MacroGenics, Inc. is a clinical-stage - biopharmaceutical company focused on discovering and developing monoclonal - antibody-based therapeutics for the treatment of cancer, as well as various - autoimmune disorders and infectious diseases. The Company develops therapeutic - product candidates using its antibody-based technology platforms and also - in collaboration with other biopharmaceutical companies. It has a pipeline - of product candidates in human clinical testing, primarily as treatments for - different types of cancers, which are created using its technology platforms. - Its clinical product candidate, margetuximab, has been enhanced using its - Fc Optimization platform. The Company is also developing several product candidates - targeting B7-H3, a protein in the B7 family of immune regulator proteins. - The Company''s product candidates also include enoblituzumab and MGD009, MGC018, - MGD006 (flotetuzumab), MGD007, MGD011 (duvortuxizumab), PF-06671008 and MGD010.", - "category": "Stock", "currencyID": null, "urlImage": "https://drivewealth.imgix.net/symbols/mgnx.png?fit=fillmax&w=125&h=125&bg=FFFFFF", - "sector": null, "name": "MacroGenics, Inc.", "dailyReturn": -0.1, "dailyReturnPercentage": - -0.75, "lastTraded": 13.28, "monthlyReturn": 0.0, "yearlyReturnPercentage": - 272.93, "yearlyReturnValue": 19.76, "popularity": 25605.0, "watched": 202, - "news": 0, "bought": 342, "viewed": 1398, "productType": "Instrument", "exchange": - null, "status": "ACTIVE", "type": "EQUITY", "encodedName": "macrogenics-inc-mgnx", - "period": "YEAR RETURN", "inceptionDate": 1381449600000, "instrumentTags": - ["Therapeutics", "Research", "Biomedical", "Pharmaceuticals"], "childInstruments": - []}, "watchedDate": "2019-11-21 20:04:09.76"}, {"productWatchlistID": "1cf93550-8eb4-4c32-a229-826cf8c1be59", - "product": {"id": "6fb39222-3b8d-4b80-933d-3ef7b95148b5", "instrumentTypeID": - null, "symbol": "VIXY", "description": "The investment seeks to provide investment - results (before fees and expenses) that match the performance of the S&P 500 - VIX Short-Term Futures Index. The fund intends to obtain exposure to its index - by investing in futures contracts based on the Chicago Board Options Exchange - (\u201cCBOE\u201d) Volatility Index. It also holds cash or cash equivalents - such as U.S. Treasury securities or other high credit quality short-term fixed-income - or similar securities (such as shares of money market funds, bank deposits, - bank money market accounts, certain variable rate-demand notes and collateralized - repurchase agreements) that may be used as margin for the futures contracts.", - "category": "ETF", "currencyID": "USD", "urlImage": "https://d3an3cesqmrf1x.cloudfront.net/images/symbols/vixy.png", - "sector": null, "name": "VIX Short-Term Futures ProShares", "dailyReturn": - 0.24, "dailyReturnPercentage": 1.48, "lastTraded": 16.48, "monthlyReturn": - 0.0, "yearlyReturnPercentage": -59.03, "yearlyReturnValue": -18.3, "popularity": - 11385.0, "watched": 1501, "news": 0, "bought": 3370, "viewed": 12200, "productType": - "Instrument", "exchange": null, "status": "ACTIVE", "type": "ETF", "encodedName": - "vix-shortterm-futures-proshares-vixy", "period": "YEAR RETURN", "inceptionDate": - 1294099200000, "instrumentTags": ["Short Term", "VIX", "Futures", "ETF", "Short"], - "childInstruments": []}, "watchedDate": "2019-11-21 20:04:09.76"}, {"productWatchlistID": - "1cf93550-8eb4-4c32-a229-826cf8c1be59", "product": {"id": "6fb39222-3b8d-4b80-933d-3ef7b95148b5", - "instrumentTypeID": null, "symbol": "DOCU", "description": "DocuSign Inc offers - DocuSign Agreement Cloud, a software suite for automating the agreement process. - It includes DocuSign eSignature, an electronic signature solution that allows - an agreement to be signed electronically on a variety of devices. The Agreement - Cloud also includes several other applications for automating pre- and post-signature - processes, such as automatically generating an agreement from data in other - systems, supporting negotiation workflow, collecting payment after signatures, - and using artificial intelligence (AI) to analyze a collection of agreements - for risks and opportunities. The Agreement Cloud also includes hundreds of - integrations to other systems, so agreement processes can integrate with other - business processes and data. Its key Agreement Cloud products include DocuSign - Contract Lifecycle Management (CLM), Intelligent Insights, Gen for Salesforce, - Negotiate for Salesforce, Guided Forms, Click, Identify, Standards-Based Signatures, - Payments and eNotary.", "category": "Stock", "currencyID": null, "urlImage": - "https://drivewealth.imgix.net/symbols/docu.png?fit=fillmax&w=125&h=125&bg=FFFFFF", - "sector": null, "name": "DocuSign, Inc. ", "dailyReturn": -0.34, "dailyReturnPercentage": - -0.27, "lastTraded": 126.97, "monthlyReturn": 0.0, "yearlyReturnPercentage": - 167.13, "yearlyReturnValue": 133.4, "popularity": 21780.0, "watched": 4311, - "news": 0, "bought": 9711, "viewed": 12500, "productType": "Instrument", "exchange": - null, "status": "ACTIVE", "type": "EQUITY", "encodedName": "docusign-inc-docu", - "period": "YEAR RETURN", "inceptionDate": null, "instrumentTags": ["Cloud - Computing", "Digital Media", "Cloud", "Software"], "childInstruments": []}, - "watchedDate": "2019-11-21 20:04:09.76"}, {"productWatchlistID": "1cf93550-8eb4-4c32-a229-826cf8c1be59", - "product": {"id": "6fb39222-3b8d-4b80-933d-3ef7b95148b5", "instrumentTypeID": - null, "symbol": "TEAM", "description": "Atlassian Corporation Plc is a holding - company. The Company offers a range of team collaboration products. The Company - offers products, including JIRA, Confluence, HipChat, Bitbucket and JIRA Service - Desk, for software developers, information technology (IT) managers and knowledge - workers. The Company offers JIRA for team planning and project management; - Confluence for team content creation and sharing; HipChat for team real-time - messaging and communications; Bitbucket for team code sharing and management, - and JIRA Service Desk for team service and support applications. JIRA allows - teams to organize their work into projects and customize dashboards for those - projects to keep their teams aligned and on track. Confluence provides a system - for organizing, sharing and securing content in spaces arranged by team, project, - department and others. The Company also offers additional tools for software - developers, such as FishEye, Clover, Crowd, Crucible, Bamboo and SourceTree.", - "category": "Stock", "currencyID": "USD", "urlImage": "https://d3an3cesqmrf1x.cloudfront.net/images/symbols/team.png", - "sector": "Technology", "name": "Atlassian Corporation Plc", "dailyReturn": - 0.78, "dailyReturnPercentage": 0.27, "lastTraded": 294.41, "monthlyReturn": - 0.0, "yearlyReturnPercentage": 71.88, "yearlyReturnValue": 97.46, "popularity": - 13430.0, "watched": 7786, "news": 0, "bought": 14188, "viewed": 40600, "productType": - "Instrument", "exchange": null, "status": "ACTIVE", "type": "EQUITY", "encodedName": - "atlassian-corporation-plc-team", "period": "YEAR RETURN", "inceptionDate": - 1449619200000, "instrumentTags": ["Computers", "Disruptors", "Asia Pacific", - "Software", "Australia"], "childInstruments": []}, "watchedDate": "2019-11-21 - 20:04:09.76"}, {"productWatchlistID": "1cf93550-8eb4-4c32-a229-826cf8c1be59", - "product": {"id": "6fb39222-3b8d-4b80-933d-3ef7b95148b5", "instrumentTypeID": - null, "symbol": "MSFT", "description": "Microsoft Corporation is a technology - company. The Company develops, licenses, and supports a range of software - products, services and devices. The Company''s segments include Productivity - and Business Processes, Intelligent Cloud and More Personal Computing. The - Company''s products include operating systems; cross-device productivity applications; - server applications; business solution applications; desktop and server management - tools; software development tools; video games, and training and certification - of computer system integrators and developers. It also designs, manufactures, - and sells devices, including personal computers (PCs), tablets, gaming and - entertainment consoles, phones, other intelligent devices, and related accessories, - that integrate with its cloud-based offerings. It offers an array of services, - including cloud-based solutions that provide customers with software, services, - platforms, and content, and it provides solution support and consulting services.", - "category": "Stock", "currencyID": "USD", "urlImage": "https://d3an3cesqmrf1x.cloudfront.net/images/symbols/msft.png", - "sector": "Technology", "name": "Microsoft Corporation", "dailyReturn": 1.19, - "dailyReturnPercentage": 0.39, "lastTraded": 303.84, "monthlyReturn": 0.0, - "yearlyReturnPercentage": 46.75, "yearlyReturnValue": 74.48, "popularity": - 1717.0, "watched": 31760, "news": 0, "bought": 75929, "viewed": 88100, "productType": - "Instrument", "exchange": null, "status": "ACTIVE", "type": "EQUITY", "encodedName": - "microsoft-corporation-msft", "period": "YEAR RETURN", "inceptionDate": 511056000000, - "instrumentTags": ["Cloud Computing", "Applications", "Technology", "Software", - "Bill Gates"], "childInstruments": []}, "watchedDate": "2019-11-21 20:04:09.76"}]}' - headers: {} - status: - code: 200 - message: OK - url: https://global-prd-api.hellostake.com/api/products/productsWatchlist/7c9bbfae-0000-47b7-0000-0e66d868c2cf version: 1 diff --git a/tests/cassettes/test_watchlist/test_remove_from_watchlist.yaml b/tests/cassettes/test_watchlist/test_remove_from_watchlist.yaml index 620707e..06dd183 100644 --- a/tests/cassettes/test_watchlist/test_remove_from_watchlist.yaml +++ b/tests/cassettes/test_watchlist/test_remove_from_watchlist.yaml @@ -13,26 +13,25 @@ interactions: string: '{"canTradeOnUnsettledFunds": false, "cpfValue": null, "emailVerified": true, "hasFunded": true, "hasTraded": true, "userId": "7c9bbfae-0000-47b7-0000-0e66d868c2cf", - "username": "rita19", "emailAddress": "torresbenjamin@gmail.com", "dw_AccountId": - "1cf93550-8eb4-4c32-a229-826cf8c1be59", "dw_AccountNumber": "w4-1267174s", - "macAccountNumber": "H1-7641957H", "status": null, "macStatus": "BASIC_USER", - "dwStatus": null, "truliooStatus": "APPROVED", "truliooStatusWithWatchlist": - null, "firstName": "Tammy", "lastName": "Alexander", "phoneNumber": "9011530005", - "signUpPhase": 0, "ackSignedWhen": "2021-05-18", "createdDate": 1574303699770, - "stakeApprovedDate": null, "accountType": "INDIVIDUAL", "masterAccountId": - null, "referralCode": "L7-2127933N", "referredByCode": null, "regionIdentifier": + "username": "michael29", "emailAddress": "reevesmegan@gilmore-wright.biz", + "dw_AccountId": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "dw_AccountNumber": + "z0-0593879b", "macAccountNumber": "d9-0481457G", "status": null, "macStatus": + "BASIC_USER", "dwStatus": null, "truliooStatus": "APPROVED", "truliooStatusWithWatchlist": + null, "firstName": "Rita", "middleName": null, "lastName": "Jones", "phoneNumber": + "(640)242-4270x965", "signUpPhase": 0, "ackSignedWhen": "2023-10-01", "createdDate": + 1574303699770, "stakeApprovedDate": null, "accountType": "INDIVIDUAL", "masterAccountId": + null, "referralCode": "W2-6612029X", "referredByCode": null, "regionIdentifier": "AUS", "assetSummary": null, "fundingStatistics": null, "tradingStatistics": null, "w8File": [], "rewardJourneyTimestamp": null, "rewardJourneyStatus": null, "userProfile": {"residentialAddress": null, "postalAddress": null}, - "ledgerBalance": 0.0, "investorAccreditations": null, "proscoreStatus": null, - "fxSpeed": "Regular", "facilitaStatus": null, "dateOfBirth": null, "upToDateDetails2021": + "ledgerBalance": 0.0, "fxSpeed": "Regular", "dateOfBirth": null, "upToDateDetails2021": "NO_REQUIREMENTS", "stakeKycStatus": "KYC_APPROVED", "awxMigrationDocsRequired": - null, "documentsStatus": "NO_ACTION", "mfaenabled": false}' + null, "documentsStatus": "NO_ACTION", "accountStatus": "OPEN", "mfaenabled": + false}' headers: {} status: code: 200 message: OK - url: https://global-prd-api.hellostake.com/api/user - request: body: null headers: @@ -45,31 +44,33 @@ interactions: response: body: string: - '{"products": [{"id": "93b3755d-0e2d-4d83-8f3b-ddd52cefaeee", "instrumentTypeID": - null, "symbol": "SPOT", "description": "Spotify Technology SA a Luxembourg-based - company, which offers digital music-streaming services. The Company enables - users to discover new releases, which includes the latest singles and albums; - playlists, which includes ready-made playlists put together by music fans - and experts, and over millions of songs so that users can play their favorites, - discover new tracks and build a personalized collection. Users can either - select Spotify Free, which includes only shuffle play or Spotify Premium, - which encompasses a range of features, such as shuffle play, advertisement - free, unlimited skips, listen offline, play any track and high quality audio. - The Company operates through a number of subsidiaries, including Spotify LTD - and is present in over 20 countries.", "category": "Stock", "currencyID": - null, "urlImage": "https://drivewealth.imgix.net/symbols/spot.png?fit=fillmax&w=125&h=125&bg=FFFFFF", - "sector": null, "name": "Spotify Technology SA", "dailyReturn": -3.32, "dailyReturnPercentage": - -1.57, "lastTraded": 207.55, "monthlyReturn": 0.0, "yearlyReturnPercentage": - 92.8, "yearlyReturnValue": 131.68, "popularity": 9470.0, "watched": 8075, - "news": 0, "bought": 9479, "viewed": 23400, "productType": "Instrument", "exchange": - null, "status": "ACTIVE", "type": "EQUITY", "encodedName": "spotify-technology-sa-spot", - "period": "YEAR RETURN", "inceptionDate": 1522713600000, "instrumentTags": + '{"products": [{"id": "1cf93550-8eb4-4c32-a229-826cf8c1be59", "stakeInstrumentId": + "732309e2-71df-41c8-89ac-6bdc2b09356a", "instrumentTypeID": null, "symbol": + "SPOT", "description": "Spotify Technology SA a Luxembourg-based company, + which offers digital music-streaming services. The Company enables users to + discover new releases, which includes the latest singles and albums; playlists, + which includes ready-made playlists put together by music fans and experts, + and over millions of songs so that users can play their favorites, discover + new tracks and build a personalized collection. Users can either select Spotify + Free, which includes only shuffle play or Spotify Premium, which encompasses + a range of features, such as shuffle play, advertisement free, unlimited skips, + listen offline, play any track and high quality audio. The Company operates + through a number of subsidiaries, including Spotify LTD and is present in + over 20 countries.", "category": "Stock", "currencyID": null, "urlImage": + "https://drivewealth.imgix.net/symbols/spot.png?fit=fillmax&w=125&h=125&bg=FFFFFF", + "sector": null, "name": "Spotify Technology SA", "prePostMarketDailyReturn": + -0.87, "prePostMarketDailyReturnPercentage": -0.13, "dailyReturn": -5.56, + "dailyReturnPercentage": -0.81, "lastTraded": 682.24, "monthlyReturn": 0.0, + "yearlyReturnPercentage": 92.8, "yearlyReturnValue": 131.68, "popularity": + 9470.0, "watched": 8806, "news": 0, "bought": 14189, "viewed": 26300, "productType": + "Instrument", "exchange": null, "status": "ACTIVE", "type": "EQUITY", "encodedName": + "spotify-technology-sa-spot", "period": "YEAR RETURN", "extendedHoursNotionalStatus": + "ACTIVE", "inceptionDate": 1522713600000, "marketCap": 121400901583, "instrumentTags": [], "childInstruments": []}]}' headers: {} status: code: 200 message: OK - url: https://global-prd-api.hellostake.com/api/products/searchProduct?symbol=SPOT&page=1&max=1 - request: body: null headers: @@ -88,5 +89,4 @@ interactions: status: code: 202 message: Accepted - url: https://global-prd-api.hellostake.com/api/instruments/addRemoveInstrumentWatchlist version: 1 diff --git a/tests/test_watchlist.py b/tests/test_watchlist.py index 286e051..3790942 100644 --- a/tests/test_watchlist.py +++ b/tests/test_watchlist.py @@ -4,40 +4,11 @@ import stake from stake import constant from stake.watchlist import ( - AddToWatchlistRequest, CreateWatchlistRequest, DeleteWatchlistRequest, - RemoveFromWatchlistRequest, UpdateWatchlistRequest, - Watchlist, ) -# flake8: noqa - - -@pytest.mark.vcr() -@pytest.mark.asyncio -async def test_add_to_watchlist(tracing_client: stake.StakeClient): - added = await tracing_client.watchlist.add(AddToWatchlistRequest(symbol="SPOT")) - assert added.watching - - -@pytest.mark.vcr() -@pytest.mark.asyncio -async def test_remove_from_watchlist(tracing_client: stake.StakeClient): - - removed = await tracing_client.watchlist.remove( - RemoveFromWatchlistRequest(symbol="SPOT") - ) - assert not removed.watching - - -@pytest.mark.vcr() -@pytest.mark.asyncio -async def test_list_watchlist(tracing_client: stake.StakeClient): - watched = await tracing_client.watchlist.list() - assert len(watched) == 10 - @pytest.mark.parametrize( "exchange, symbols", @@ -83,3 +54,31 @@ async def test_create_watchlist( request=DeleteWatchlistRequest(id=update_request.id) ) assert result + + +@pytest.mark.parametrize( + "exchange, symbols", + ( + (constant.NYSE, ["TSLA", "GOOG", "MSFT", "NOK"]), + (constant.ASX, ["COL", "WDS", "BHP", "OOO"]), + ), +) +@pytest.mark.vcr() +@pytest.mark.asyncio +async def test_create_watchlist_with_tickers( + tracing_client: stake.StakeClient, exchange: BaseModel, symbols: str +): + name = f"test_watchlist__{exchange.__class__.__name__}" + tracing_client.set_exchange(exchange) + watched = await tracing_client.watchlist.create_watchlist( + CreateWatchlistRequest(name=name, tickers=symbols) + ) + if not watched: + return + + assert watched.count == len(symbols) + + result = await tracing_client.watchlist.delete_watchlist( + request=DeleteWatchlistRequest(id=watched.watchlist_id) + ) + assert result