dnse-sdk-openapi 1.3.0__tar.gz → 1.4.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. {dnse_sdk_openapi-1.3.0/dnse_sdk_openapi.egg-info → dnse_sdk_openapi-1.4.0}/PKG-INFO +9 -3
  2. dnse_sdk_openapi-1.3.0/PKG-INFO → dnse_sdk_openapi-1.4.0/README.md +8 -8
  3. {dnse_sdk_openapi-1.3.0 → dnse_sdk_openapi-1.4.0}/broker-api/get_list_care_by.py +1 -1
  4. {dnse_sdk_openapi-1.3.0 → dnse_sdk_openapi-1.4.0}/dnse/api/client.py +60 -0
  5. dnse_sdk_openapi-1.3.0/README.md → dnse_sdk_openapi-1.4.0/dnse_sdk_openapi.egg-info/PKG-INFO +14 -2
  6. {dnse_sdk_openapi-1.3.0 → dnse_sdk_openapi-1.4.0}/dnse_sdk_openapi.egg-info/SOURCES.txt +3 -0
  7. {dnse_sdk_openapi-1.3.0 → dnse_sdk_openapi-1.4.0}/marketdata-api/get_instruments.py +1 -1
  8. dnse_sdk_openapi-1.4.0/marketdata-api/get_latest_quote.py +22 -0
  9. {dnse_sdk_openapi-1.3.0 → dnse_sdk_openapi-1.4.0}/marketdata-api/get_latest_trade.py +1 -1
  10. {dnse_sdk_openapi-1.3.0 → dnse_sdk_openapi-1.4.0}/marketdata-api/get_ohlc.py +1 -1
  11. dnse_sdk_openapi-1.4.0/marketdata-api/get_quotes.py +22 -0
  12. {dnse_sdk_openapi-1.3.0 → dnse_sdk_openapi-1.4.0}/marketdata-api/get_security_definition.py +1 -1
  13. {dnse_sdk_openapi-1.3.0 → dnse_sdk_openapi-1.4.0}/marketdata-api/get_trades.py +1 -1
  14. {dnse_sdk_openapi-1.3.0 → dnse_sdk_openapi-1.4.0}/marketdata-api/get_working_dates.py +1 -1
  15. {dnse_sdk_openapi-1.3.0 → dnse_sdk_openapi-1.4.0}/pyproject.toml +1 -1
  16. {dnse_sdk_openapi-1.3.0 → dnse_sdk_openapi-1.4.0}/trading-api/cancel_order.py +1 -1
  17. {dnse_sdk_openapi-1.3.0 → dnse_sdk_openapi-1.4.0}/trading-api/close_position.py +1 -1
  18. {dnse_sdk_openapi-1.3.0 → dnse_sdk_openapi-1.4.0}/trading-api/create_trading_token.py +1 -1
  19. {dnse_sdk_openapi-1.3.0 → dnse_sdk_openapi-1.4.0}/trading-api/get_accounts.py +1 -1
  20. {dnse_sdk_openapi-1.3.0 → dnse_sdk_openapi-1.4.0}/trading-api/get_balances.py +1 -1
  21. {dnse_sdk_openapi-1.3.0 → dnse_sdk_openapi-1.4.0}/trading-api/get_close_price.py +1 -1
  22. dnse_sdk_openapi-1.4.0/trading-api/get_corporate_action_history.py +28 -0
  23. {dnse_sdk_openapi-1.3.0 → dnse_sdk_openapi-1.4.0}/trading-api/get_loan_packages.py +1 -1
  24. {dnse_sdk_openapi-1.3.0 → dnse_sdk_openapi-1.4.0}/trading-api/get_order_detail.py +1 -1
  25. {dnse_sdk_openapi-1.3.0 → dnse_sdk_openapi-1.4.0}/trading-api/get_order_history.py +1 -1
  26. {dnse_sdk_openapi-1.3.0 → dnse_sdk_openapi-1.4.0}/trading-api/get_orders.py +1 -1
  27. {dnse_sdk_openapi-1.3.0 → dnse_sdk_openapi-1.4.0}/trading-api/get_position_by_id.py +1 -1
  28. {dnse_sdk_openapi-1.3.0 → dnse_sdk_openapi-1.4.0}/trading-api/get_positions.py +1 -1
  29. {dnse_sdk_openapi-1.3.0 → dnse_sdk_openapi-1.4.0}/trading-api/get_ppse.py +1 -1
  30. {dnse_sdk_openapi-1.3.0 → dnse_sdk_openapi-1.4.0}/trading-api/post_order.py +1 -1
  31. {dnse_sdk_openapi-1.3.0 → dnse_sdk_openapi-1.4.0}/trading-api/put_order.py +1 -1
  32. {dnse_sdk_openapi-1.3.0 → dnse_sdk_openapi-1.4.0}/trading-api/send_email_otp.py +1 -1
  33. {dnse_sdk_openapi-1.3.0 → dnse_sdk_openapi-1.4.0}/websocket-marketdata/expected_price.py +4 -0
  34. {dnse_sdk_openapi-1.3.0 → dnse_sdk_openapi-1.4.0}/websocket-marketdata/foreign_investor.py +4 -0
  35. {dnse_sdk_openapi-1.3.0 → dnse_sdk_openapi-1.4.0}/websocket-marketdata/market_index.py +4 -0
  36. {dnse_sdk_openapi-1.3.0 → dnse_sdk_openapi-1.4.0}/websocket-marketdata/ohlc.py +4 -0
  37. {dnse_sdk_openapi-1.3.0 → dnse_sdk_openapi-1.4.0}/websocket-marketdata/ohlc_closed.py +4 -0
  38. {dnse_sdk_openapi-1.3.0 → dnse_sdk_openapi-1.4.0}/websocket-marketdata/quote.py +4 -0
  39. {dnse_sdk_openapi-1.3.0 → dnse_sdk_openapi-1.4.0}/websocket-marketdata/sec_def.py +4 -0
  40. {dnse_sdk_openapi-1.3.0 → dnse_sdk_openapi-1.4.0}/websocket-marketdata/trade.py +4 -0
  41. {dnse_sdk_openapi-1.3.0 → dnse_sdk_openapi-1.4.0}/websocket-marketdata/trade_extra.py +4 -0
  42. {dnse_sdk_openapi-1.3.0 → dnse_sdk_openapi-1.4.0}/websocket-trading/order.py +4 -0
  43. {dnse_sdk_openapi-1.3.0 → dnse_sdk_openapi-1.4.0}/websocket-trading/position.py +4 -0
  44. {dnse_sdk_openapi-1.3.0 → dnse_sdk_openapi-1.4.0}/dnse/__init__.py +0 -0
  45. {dnse_sdk_openapi-1.3.0 → dnse_sdk_openapi-1.4.0}/dnse/api/_version.py +0 -0
  46. {dnse_sdk_openapi-1.3.0 → dnse_sdk_openapi-1.4.0}/dnse/api/common.py +0 -0
  47. {dnse_sdk_openapi-1.3.0 → dnse_sdk_openapi-1.4.0}/dnse/websocket/_version.py +0 -0
  48. {dnse_sdk_openapi-1.3.0 → dnse_sdk_openapi-1.4.0}/dnse/websocket/auth.py +0 -0
  49. {dnse_sdk_openapi-1.3.0 → dnse_sdk_openapi-1.4.0}/dnse/websocket/client.py +0 -0
  50. {dnse_sdk_openapi-1.3.0 → dnse_sdk_openapi-1.4.0}/dnse/websocket/connection.py +0 -0
  51. {dnse_sdk_openapi-1.3.0 → dnse_sdk_openapi-1.4.0}/dnse/websocket/encoding.py +0 -0
  52. {dnse_sdk_openapi-1.3.0 → dnse_sdk_openapi-1.4.0}/dnse/websocket/exceptions.py +0 -0
  53. {dnse_sdk_openapi-1.3.0 → dnse_sdk_openapi-1.4.0}/dnse/websocket/models.py +0 -0
  54. {dnse_sdk_openapi-1.3.0 → dnse_sdk_openapi-1.4.0}/dnse/websocket/py.typed +0 -0
  55. {dnse_sdk_openapi-1.3.0 → dnse_sdk_openapi-1.4.0}/dnse_sdk_openapi.egg-info/dependency_links.txt +0 -0
  56. {dnse_sdk_openapi-1.3.0 → dnse_sdk_openapi-1.4.0}/dnse_sdk_openapi.egg-info/top_level.txt +0 -0
  57. {dnse_sdk_openapi-1.3.0 → dnse_sdk_openapi-1.4.0}/setup.cfg +0 -0
  58. {dnse_sdk_openapi-1.3.0 → dnse_sdk_openapi-1.4.0}/trading-api/get_execution_detail.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dnse-sdk-openapi
3
- Version: 1.3.0
3
+ Version: 1.4.0
4
4
  Summary: DNSE OpenAPI SDK
5
5
  Description-Content-Type: text/markdown
6
6
 
@@ -37,7 +37,11 @@ and investment applications.
37
37
  pip install openapi-sdk
38
38
  ```
39
39
 
40
- Upgrade
40
+ Upgrade:
41
+
42
+ ```console
43
+ pip install --upgrade openapi-sdk
44
+ ```
41
45
 
42
46
  ### Usage
43
47
 
@@ -57,7 +61,8 @@ status, body = client.get_accounts(dry_run=False)
57
61
  print(status, body)
58
62
  ```
59
63
 
60
- The SDK sends the API version in the `version` header. If `api_version` is omitted, it defaults to `2026-01-01`; it can also be set with the `DNSE_API_VERSION` environment variable.
64
+ The SDK sends the API version in the `version` header. If `api_version` is omitted, it defaults to `2026-01-01`; it can also be set
65
+ with the `DNSE_API_VERSION` environment variable.
61
66
 
62
67
  ### Dry Run
63
68
 
@@ -86,6 +91,7 @@ python sdk/python/api/get_accounts.py
86
91
  | `get_orders.py` | Demonstrates how to retrieve intraday order book. |
87
92
  | `get_order_detail.py` | Demonstrates how to retrieve detailed information of a specific order (by ID). |
88
93
  | `get_order_history.py` | Demonstrates how to retrieve historical orders. |
94
+ | `get_corporate_action_history.py` | Demonstrates how to retrieve corporate action history. |
89
95
  | `get_execution_detail.py` | Demonstrates how to retrieve detailed execution information of an order. |
90
96
  | `get_positions.py` | Demonstrates how to retrieve current holding positions. |
91
97
  | `get_positions_by_id.py` | Demonstrates how to retrieve detailed information of a specific position (by ID). |
@@ -1,9 +1,3 @@
1
- Metadata-Version: 2.4
2
- Name: dnse-sdk-openapi
3
- Version: 1.3.0
4
- Summary: DNSE OpenAPI SDK
5
- Description-Content-Type: text/markdown
6
-
7
1
  # DNSE OpenAPI Python SDK
8
2
 
9
3
  Official Python SDK for integrating with DNSE OpenAPI.
@@ -37,7 +31,11 @@ and investment applications.
37
31
  pip install openapi-sdk
38
32
  ```
39
33
 
40
- Upgrade
34
+ Upgrade:
35
+
36
+ ```console
37
+ pip install --upgrade openapi-sdk
38
+ ```
41
39
 
42
40
  ### Usage
43
41
 
@@ -57,7 +55,8 @@ status, body = client.get_accounts(dry_run=False)
57
55
  print(status, body)
58
56
  ```
59
57
 
60
- The SDK sends the API version in the `version` header. If `api_version` is omitted, it defaults to `2026-01-01`; it can also be set with the `DNSE_API_VERSION` environment variable.
58
+ The SDK sends the API version in the `version` header. If `api_version` is omitted, it defaults to `2026-01-01`; it can also be set
59
+ with the `DNSE_API_VERSION` environment variable.
61
60
 
62
61
  ### Dry Run
63
62
 
@@ -86,6 +85,7 @@ python sdk/python/api/get_accounts.py
86
85
  | `get_orders.py` | Demonstrates how to retrieve intraday order book. |
87
86
  | `get_order_detail.py` | Demonstrates how to retrieve detailed information of a specific order (by ID). |
88
87
  | `get_order_history.py` | Demonstrates how to retrieve historical orders. |
88
+ | `get_corporate_action_history.py` | Demonstrates how to retrieve corporate action history. |
89
89
  | `get_execution_detail.py` | Demonstrates how to retrieve detailed execution information of an order. |
90
90
  | `get_positions.py` | Demonstrates how to retrieve current holding positions. |
91
91
  | `get_positions_by_id.py` | Demonstrates how to retrieve detailed information of a specific position (by ID). |
@@ -2,7 +2,7 @@
2
2
  import os
3
3
  import sys
4
4
 
5
- sys.path.append(os.path.dirname(os.path.dirname(__file__)))
5
+ sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
6
6
 
7
7
  from dnse import DNSEClient
8
8
 
@@ -127,6 +127,34 @@ class DNSEClient:
127
127
  dry_run=dry_run,
128
128
  )
129
129
 
130
+ def get_corporate_action_history(
131
+ self,
132
+ account_no,
133
+ symbol=None,
134
+ ca_type=None,
135
+ ca_status=None,
136
+ page_index=None,
137
+ page_size=None,
138
+ dry_run=False,
139
+ ):
140
+ query = {}
141
+ if symbol is not None:
142
+ query["symbol"] = symbol
143
+ if ca_type is not None:
144
+ query["caType"] = ca_type
145
+ if ca_status is not None:
146
+ query["caStatus"] = ca_status
147
+ if page_index is not None:
148
+ query["pageIndex"] = page_index
149
+ if page_size is not None:
150
+ query["pageSize"] = page_size
151
+ return self._request(
152
+ "GET",
153
+ f"/accounts/{account_no}/corporate-action-history",
154
+ query=query if query else None,
155
+ dry_run=dry_run,
156
+ )
157
+
130
158
  def get_ppse(self, account_no, market_type, symbol, price, loan_package_id, dry_run=False):
131
159
  return self._request(
132
160
  "GET",
@@ -182,6 +210,27 @@ class DNSEClient:
182
210
  dry_run=dry_run,
183
211
  )
184
212
 
213
+ def get_quotes(self, symbol, board_id=None, from_date=None, to_date=None, limit=None, order = None, next_page_token=None, dry_run=False):
214
+ query = {}
215
+ if board_id is not None:
216
+ query["boardId"] = board_id
217
+ if from_date is not None:
218
+ query["from"] = from_date
219
+ if to_date is not None:
220
+ query["to"] = to_date
221
+ if limit is not None:
222
+ query["limit"] = limit
223
+ if order is not None:
224
+ query["order"] = order
225
+ if next_page_token is not None:
226
+ query["nextPageToken"] = next_page_token
227
+ return self._request(
228
+ "GET",
229
+ f"/price/{symbol}/quotes",
230
+ query=query if query else None,
231
+ dry_run=dry_run,
232
+ )
233
+
185
234
  def get_instruments(self, symbol=None, market_id=None, security_group_id=None, index_name=None, limit=None, page=None, dry_run=False):
186
235
  query = {}
187
236
  if symbol is not None:
@@ -214,6 +263,17 @@ class DNSEClient:
214
263
  dry_run=dry_run,
215
264
  )
216
265
 
266
+ def get_latest_quote(self, symbol, board_id=None, dry_run=False):
267
+ query = {}
268
+ if board_id is not None:
269
+ query["boardId"] = board_id
270
+ return self._request(
271
+ "GET",
272
+ f"/price/{symbol}/quotes/latest",
273
+ query=query if query else None,
274
+ dry_run=dry_run,
275
+ )
276
+
217
277
  def get_close_price(self, symbol, board_id=None, dry_run=False):
218
278
  query = {}
219
279
  if board_id is not None:
@@ -1,3 +1,9 @@
1
+ Metadata-Version: 2.4
2
+ Name: dnse-sdk-openapi
3
+ Version: 1.4.0
4
+ Summary: DNSE OpenAPI SDK
5
+ Description-Content-Type: text/markdown
6
+
1
7
  # DNSE OpenAPI Python SDK
2
8
 
3
9
  Official Python SDK for integrating with DNSE OpenAPI.
@@ -31,7 +37,11 @@ and investment applications.
31
37
  pip install openapi-sdk
32
38
  ```
33
39
 
34
- Upgrade
40
+ Upgrade:
41
+
42
+ ```console
43
+ pip install --upgrade openapi-sdk
44
+ ```
35
45
 
36
46
  ### Usage
37
47
 
@@ -51,7 +61,8 @@ status, body = client.get_accounts(dry_run=False)
51
61
  print(status, body)
52
62
  ```
53
63
 
54
- The SDK sends the API version in the `version` header. If `api_version` is omitted, it defaults to `2026-01-01`; it can also be set with the `DNSE_API_VERSION` environment variable.
64
+ The SDK sends the API version in the `version` header. If `api_version` is omitted, it defaults to `2026-01-01`; it can also be set
65
+ with the `DNSE_API_VERSION` environment variable.
55
66
 
56
67
  ### Dry Run
57
68
 
@@ -80,6 +91,7 @@ python sdk/python/api/get_accounts.py
80
91
  | `get_orders.py` | Demonstrates how to retrieve intraday order book. |
81
92
  | `get_order_detail.py` | Demonstrates how to retrieve detailed information of a specific order (by ID). |
82
93
  | `get_order_history.py` | Demonstrates how to retrieve historical orders. |
94
+ | `get_corporate_action_history.py` | Demonstrates how to retrieve corporate action history. |
83
95
  | `get_execution_detail.py` | Demonstrates how to retrieve detailed execution information of an order. |
84
96
  | `get_positions.py` | Demonstrates how to retrieve current holding positions. |
85
97
  | `get_positions_by_id.py` | Demonstrates how to retrieve detailed information of a specific position (by ID). |
@@ -18,8 +18,10 @@ dnse_sdk_openapi.egg-info/SOURCES.txt
18
18
  dnse_sdk_openapi.egg-info/dependency_links.txt
19
19
  dnse_sdk_openapi.egg-info/top_level.txt
20
20
  marketdata-api/get_instruments.py
21
+ marketdata-api/get_latest_quote.py
21
22
  marketdata-api/get_latest_trade.py
22
23
  marketdata-api/get_ohlc.py
24
+ marketdata-api/get_quotes.py
23
25
  marketdata-api/get_security_definition.py
24
26
  marketdata-api/get_trades.py
25
27
  marketdata-api/get_working_dates.py
@@ -29,6 +31,7 @@ trading-api/create_trading_token.py
29
31
  trading-api/get_accounts.py
30
32
  trading-api/get_balances.py
31
33
  trading-api/get_close_price.py
34
+ trading-api/get_corporate_action_history.py
32
35
  trading-api/get_execution_detail.py
33
36
  trading-api/get_loan_packages.py
34
37
  trading-api/get_order_detail.py
@@ -2,7 +2,7 @@
2
2
  import os
3
3
  import sys
4
4
 
5
- sys.path.append(os.path.dirname(os.path.dirname(__file__)))
5
+ sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
6
6
 
7
7
  from dnse import DNSEClient
8
8
 
@@ -0,0 +1,22 @@
1
+ #!/usr/bin/env python3
2
+ import os
3
+ import sys
4
+
5
+ sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
6
+
7
+ from dnse import DNSEClient
8
+
9
+
10
+ def main():
11
+ client = DNSEClient(
12
+ api_key="replace-with-api-key",
13
+ api_secret="replace-with-api-secret",
14
+ base_url="https://openapi.dnse.com.vn",
15
+ )
16
+
17
+ status, body = client.get_latest_quote(symbol="GAS", board_id="G1", dry_run=False)
18
+ print(status, body)
19
+
20
+
21
+ if __name__ == "__main__":
22
+ main()
@@ -2,7 +2,7 @@
2
2
  import os
3
3
  import sys
4
4
 
5
- sys.path.append(os.path.dirname(os.path.dirname(__file__)))
5
+ sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
6
6
 
7
7
  from dnse import DNSEClient
8
8
 
@@ -2,7 +2,7 @@
2
2
  import os
3
3
  import sys
4
4
 
5
- sys.path.append(os.path.dirname(os.path.dirname(__file__)))
5
+ sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
6
6
 
7
7
  from dnse import DNSEClient
8
8
 
@@ -0,0 +1,22 @@
1
+ #!/usr/bin/env python3
2
+ import os
3
+ import sys
4
+
5
+ sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
6
+
7
+ from dnse import DNSEClient
8
+
9
+
10
+ def main():
11
+ client = DNSEClient(
12
+ api_key="replace-with-api-key",
13
+ api_secret="replace-with-api-secret",
14
+ base_url="https://openapi.dnse.com.vn",
15
+ )
16
+
17
+ status, body = client.get_quotes(symbol="GAS", board_id="G1", from_date=1773282637, to_date=1773289837, limit = 100, order = "DESC", next_page_token=None, dry_run=False)
18
+ print(status, body)
19
+
20
+
21
+ if __name__ == "__main__":
22
+ main()
@@ -2,7 +2,7 @@
2
2
  import os
3
3
  import sys
4
4
 
5
- sys.path.append(os.path.dirname(os.path.dirname(__file__)))
5
+ sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
6
6
 
7
7
  from dnse import DNSEClient
8
8
 
@@ -2,7 +2,7 @@
2
2
  import os
3
3
  import sys
4
4
 
5
- sys.path.append(os.path.dirname(os.path.dirname(__file__)))
5
+ sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
6
6
 
7
7
  from dnse import DNSEClient
8
8
 
@@ -2,7 +2,7 @@
2
2
  import os
3
3
  import sys
4
4
 
5
- sys.path.append(os.path.dirname(os.path.dirname(__file__)))
5
+ sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
6
6
 
7
7
  from dnse import DNSEClient
8
8
 
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "dnse-sdk-openapi"
7
- version = "1.3.0"
7
+ version = "1.4.0"
8
8
  description = "DNSE OpenAPI SDK"
9
9
  readme = "README.md"
10
10
 
@@ -2,7 +2,7 @@
2
2
  import os
3
3
  import sys
4
4
 
5
- sys.path.append(os.path.dirname(os.path.dirname(__file__)))
5
+ sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
6
6
 
7
7
  from dnse import DNSEClient
8
8
 
@@ -2,7 +2,7 @@
2
2
  import os
3
3
  import sys
4
4
 
5
- sys.path.append(os.path.dirname(os.path.dirname(__file__)))
5
+ sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
6
6
 
7
7
  from dnse import DNSEClient
8
8
 
@@ -2,7 +2,7 @@
2
2
  import os
3
3
  import sys
4
4
 
5
- sys.path.append(os.path.dirname(os.path.dirname(__file__)))
5
+ sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
6
6
 
7
7
  from dnse import DNSEClient
8
8
 
@@ -2,7 +2,7 @@
2
2
  import os
3
3
  import sys
4
4
 
5
- sys.path.append(os.path.dirname(os.path.dirname(__file__)))
5
+ sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
6
6
 
7
7
  from dnse import DNSEClient
8
8
 
@@ -2,7 +2,7 @@
2
2
  import os
3
3
  import sys
4
4
 
5
- sys.path.append(os.path.dirname(os.path.dirname(__file__)))
5
+ sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
6
6
 
7
7
  from dnse import DNSEClient
8
8
 
@@ -2,7 +2,7 @@
2
2
  import os
3
3
  import sys
4
4
 
5
- sys.path.append(os.path.dirname(os.path.dirname(__file__)))
5
+ sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
6
6
 
7
7
  from dnse import DNSEClient
8
8
 
@@ -0,0 +1,28 @@
1
+ #!/usr/bin/env python3
2
+ import os
3
+ import sys
4
+
5
+ sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
6
+ from dnse import DNSEClient
7
+
8
+ def main():
9
+ client = DNSEClient(
10
+ api_key="replace-with-api-key",
11
+ api_secret="replace-with-api-secret",
12
+ base_url="https://openapi.dnse.com.vn",
13
+ )
14
+
15
+ status, body = client.get_corporate_action_history(
16
+ account_no="0001000115",
17
+ symbol="SSI",
18
+ ca_type="all",
19
+ ca_status="pending",
20
+ page_index=0,
21
+ page_size=20,
22
+ dry_run=False,
23
+ )
24
+ print(status, body)
25
+
26
+
27
+ if __name__ == "__main__":
28
+ main()
@@ -2,7 +2,7 @@
2
2
  import os
3
3
  import sys
4
4
 
5
- sys.path.append(os.path.dirname(os.path.dirname(__file__)))
5
+ sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
6
6
 
7
7
  from dnse import DNSEClient
8
8
 
@@ -2,7 +2,7 @@
2
2
  import os
3
3
  import sys
4
4
 
5
- sys.path.append(os.path.dirname(os.path.dirname(__file__)))
5
+ sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
6
6
 
7
7
  from dnse import DNSEClient
8
8
 
@@ -2,7 +2,7 @@
2
2
  import os
3
3
  import sys
4
4
 
5
- sys.path.append(os.path.dirname(os.path.dirname(__file__)))
5
+ sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
6
6
 
7
7
  from dnse import DNSEClient
8
8
 
@@ -2,7 +2,7 @@
2
2
  import os
3
3
  import sys
4
4
 
5
- sys.path.append(os.path.dirname(os.path.dirname(__file__)))
5
+ sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
6
6
 
7
7
  from dnse import DNSEClient
8
8
 
@@ -2,7 +2,7 @@
2
2
  import os
3
3
  import sys
4
4
 
5
- sys.path.append(os.path.dirname(os.path.dirname(__file__)))
5
+ sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
6
6
 
7
7
  from dnse import DNSEClient
8
8
 
@@ -2,7 +2,7 @@
2
2
  import os
3
3
  import sys
4
4
 
5
- sys.path.append(os.path.dirname(os.path.dirname(__file__)))
5
+ sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
6
6
 
7
7
  from dnse import DNSEClient
8
8
 
@@ -2,7 +2,7 @@
2
2
  import os
3
3
  import sys
4
4
 
5
- sys.path.append(os.path.dirname(os.path.dirname(__file__)))
5
+ sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
6
6
 
7
7
  from dnse import DNSEClient
8
8
 
@@ -2,7 +2,7 @@
2
2
  import os
3
3
  import sys
4
4
 
5
- sys.path.append(os.path.dirname(os.path.dirname(__file__)))
5
+ sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
6
6
 
7
7
  from dnse import DNSEClient
8
8
 
@@ -2,7 +2,7 @@
2
2
  import os
3
3
  import sys
4
4
 
5
- sys.path.append(os.path.dirname(os.path.dirname(__file__)))
5
+ sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
6
6
 
7
7
  from dnse import DNSEClient
8
8
 
@@ -2,7 +2,7 @@
2
2
  import os
3
3
  import sys
4
4
 
5
- sys.path.append(os.path.dirname(os.path.dirname(__file__)))
5
+ sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
6
6
 
7
7
  from dnse import DNSEClient
8
8
 
@@ -6,6 +6,10 @@ Demonstrates:
6
6
 
7
7
  This example shows how to receive real-time market data for multiple symbols.
8
8
  """
9
+ import os
10
+ import sys
11
+
12
+ sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
9
13
 
10
14
  import asyncio
11
15
  from datetime import datetime
@@ -4,6 +4,10 @@ Demonstrates:
4
4
 
5
5
  This example shows how to receive real-time foreigner trading data
6
6
  """
7
+ import os
8
+ import sys
9
+
10
+ sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
7
11
 
8
12
  import asyncio
9
13
  from datetime import datetime
@@ -6,6 +6,10 @@ Demonstrates:
6
6
 
7
7
  This example shows how to receive real-time market index
8
8
  """
9
+ import os
10
+ import sys
11
+
12
+ sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
9
13
 
10
14
  import asyncio
11
15
 
@@ -6,6 +6,10 @@ Demonstrates:
6
6
 
7
7
  This example shows how to receive real-time market data for multiple symbols.
8
8
  """
9
+ import os
10
+ import sys
11
+
12
+ sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
9
13
 
10
14
  import asyncio
11
15
  from datetime import datetime
@@ -6,6 +6,10 @@ Demonstrates:
6
6
 
7
7
  This example shows how to receive real-time market data for multiple symbols.
8
8
  """
9
+ import os
10
+ import sys
11
+
12
+ sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
9
13
 
10
14
  import asyncio
11
15
  from datetime import datetime
@@ -4,6 +4,10 @@ Demonstrates:
4
4
 
5
5
  This example shows how to receive real-time quote data for multiple symbols.
6
6
  """
7
+ import os
8
+ import sys
9
+
10
+ sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
7
11
 
8
12
  import asyncio
9
13
  from datetime import datetime
@@ -6,6 +6,10 @@ Demonstrates:
6
6
 
7
7
  This example shows how to receive real-time market data for multiple symbols.
8
8
  """
9
+ import os
10
+ import sys
11
+
12
+ sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
9
13
 
10
14
  import asyncio
11
15
  from datetime import datetime
@@ -6,6 +6,10 @@ Demonstrates:
6
6
 
7
7
  This example shows how to receive real-time market data for multiple symbols.
8
8
  """
9
+ import os
10
+ import sys
11
+
12
+ sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
9
13
 
10
14
  import asyncio
11
15
  from datetime import datetime
@@ -6,6 +6,10 @@ Demonstrates:
6
6
 
7
7
  This example shows how to receive real-time market data for multiple symbols.
8
8
  """
9
+ import os
10
+ import sys
11
+
12
+ sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
9
13
 
10
14
  import asyncio
11
15
  from datetime import datetime
@@ -3,6 +3,10 @@ Order event subscription example.
3
3
 
4
4
  This example shows how to receive real-time order event for stock and derivative orders
5
5
  """
6
+ import os
7
+ import sys
8
+
9
+ sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
6
10
 
7
11
  import asyncio
8
12
  from datetime import datetime
@@ -3,6 +3,10 @@ Position event subscription example.
3
3
 
4
4
  This example shows how to receive real-time position event for stock and derivative
5
5
  """
6
+ import os
7
+ import sys
8
+
9
+ sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
6
10
 
7
11
  import asyncio
8
12
  from datetime import datetime