typed-aster 0.1.0__py3-none-any.whl

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 (336) hide show
  1. typed_aster/__init__.py +14 -0
  2. typed_aster/__init__.pyi +23 -0
  3. typed_aster/chain/__init__.py +71 -0
  4. typed_aster/chain/account/__init__.py +12 -0
  5. typed_aster/chain/account/modify_status.py +44 -0
  6. typed_aster/chain/account/status.py +36 -0
  7. typed_aster/chain/account/transfer.py +74 -0
  8. typed_aster/chain/perp/__init__.py +16 -0
  9. typed_aster/chain/perp/deposit_withdraw_history.py +68 -0
  10. typed_aster/chain/perp/solana_withdraw.py +55 -0
  11. typed_aster/chain/perp/transfer.py +56 -0
  12. typed_aster/chain/perp/withdraw.py +64 -0
  13. typed_aster/chain/perp/withdraw_info.py +75 -0
  14. typed_aster/chain/rpc/__init__.py +14 -0
  15. typed_aster/chain/rpc/get_balance.py +131 -0
  16. typed_aster/chain/rpc/open_orders.py +50 -0
  17. typed_aster/chain/rpc/schemas.py +73 -0
  18. typed_aster/chain/rpc/spot_open_orders.py +50 -0
  19. typed_aster/chain/rpc/spot_user_fills.py +67 -0
  20. typed_aster/chain/rpc/user_fills.py +67 -0
  21. typed_aster/chain/spot/__init__.py +13 -0
  22. typed_aster/chain/spot/deposit_address.py +41 -0
  23. typed_aster/chain/spot/solana_withdraw.py +55 -0
  24. typed_aster/chain/spot/transfer.py +56 -0
  25. typed_aster/chain/spot/withdraw.py +70 -0
  26. typed_aster/chain/staking/__init__.py +26 -0
  27. typed_aster/chain/staking/claim_rewards.py +45 -0
  28. typed_aster/chain/staking/claimable_rewards.py +46 -0
  29. typed_aster/chain/staking/create.py +60 -0
  30. typed_aster/chain/staking/deposit.py +52 -0
  31. typed_aster/chain/staking/locked_aster.py +38 -0
  32. typed_aster/chain/staking/my_staking.py +48 -0
  33. typed_aster/chain/staking/stake_account_status.py +40 -0
  34. typed_aster/chain/staking/update_lock_period.py +44 -0
  35. typed_aster/chain/wallet/__init__.py +10 -0
  36. typed_aster/chain/wallet/estimate_withdraw_fee.py +58 -0
  37. typed_aster/core/__init__.py +5 -0
  38. typed_aster/core/__init__.pyi +37 -0
  39. typed_aster/core/auth.py +329 -0
  40. typed_aster/core/base.py +208 -0
  41. typed_aster/core/endpoint/__init__.py +0 -0
  42. typed_aster/core/endpoint/jsonrpc.py +100 -0
  43. typed_aster/core/endpoint/rpc.py +141 -0
  44. typed_aster/core/endpoint/stream.py +72 -0
  45. typed_aster/core/endpoint/user_stream.py +68 -0
  46. typed_aster/core/endpoint/wire.py +20 -0
  47. typed_aster/core/envelope.py +102 -0
  48. typed_aster/core/exc.py +49 -0
  49. typed_aster/core/transport/__init__.py +0 -0
  50. typed_aster/core/transport/http.py +303 -0
  51. typed_aster/core/transport/jsonrpc.py +117 -0
  52. typed_aster/core/transport/ws/__init__.py +0 -0
  53. typed_aster/core/transport/ws/streams.py +131 -0
  54. typed_aster/core/transport/ws/user_stream.py +76 -0
  55. typed_aster/core/types.py +36 -0
  56. typed_aster/core/urls.py +47 -0
  57. typed_aster/futures/__init__.py +161 -0
  58. typed_aster/futures/account/__init__.py +40 -0
  59. typed_aster/futures/account/asset_exchange.py +47 -0
  60. typed_aster/futures/account/balance.py +57 -0
  61. typed_aster/futures/account/commission_rate.py +38 -0
  62. typed_aster/futures/account/income.py +241 -0
  63. typed_aster/futures/account/info.py +30 -0
  64. typed_aster/futures/account/info_with_join_margin.py +32 -0
  65. typed_aster/futures/account/leverage_brackets.py +70 -0
  66. typed_aster/futures/account/multi_assets_margin.py +38 -0
  67. typed_aster/futures/account/position_mode.py +36 -0
  68. typed_aster/futures/account/schemas.py +115 -0
  69. typed_aster/futures/account/set_leverage.py +53 -0
  70. typed_aster/futures/account/set_margin_type.py +42 -0
  71. typed_aster/futures/account/set_multi_assets_margin.py +38 -0
  72. typed_aster/futures/account/set_position_mode.py +38 -0
  73. typed_aster/futures/account/set_stp_mode.py +38 -0
  74. typed_aster/futures/account/stp_mode.py +36 -0
  75. typed_aster/futures/agents/__init__.py +14 -0
  76. typed_aster/futures/agents/approve.py +106 -0
  77. typed_aster/futures/agents/delete.py +40 -0
  78. typed_aster/futures/agents/list.py +57 -0
  79. typed_aster/futures/agents/register.py +100 -0
  80. typed_aster/futures/agents/update.py +64 -0
  81. typed_aster/futures/announcement/__init__.py +11 -0
  82. typed_aster/futures/announcement/direct.py +90 -0
  83. typed_aster/futures/announcement/direct_by_id.py +38 -0
  84. typed_aster/futures/announcement/schemas.py +33 -0
  85. typed_aster/futures/builder_users/__init__.py +26 -0
  86. typed_aster/futures/builder_users/accounts.py +161 -0
  87. typed_aster/futures/builder_users/all_orders.py +212 -0
  88. typed_aster/futures/builder_users/approved.py +132 -0
  89. typed_aster/futures/builder_users/balances.py +123 -0
  90. typed_aster/futures/builder_users/commission_rates.py +131 -0
  91. typed_aster/futures/builder_users/open_orders.py +170 -0
  92. typed_aster/futures/builder_users/position_risk.py +158 -0
  93. typed_aster/futures/builder_users/schemas.py +13 -0
  94. typed_aster/futures/builder_users/trades.py +173 -0
  95. typed_aster/futures/builders/__init__.py +13 -0
  96. typed_aster/futures/builders/approve.py +45 -0
  97. typed_aster/futures/builders/delete.py +37 -0
  98. typed_aster/futures/builders/list.py +46 -0
  99. typed_aster/futures/builders/update.py +45 -0
  100. typed_aster/futures/listen_key/__init__.py +12 -0
  101. typed_aster/futures/listen_key/close.py +33 -0
  102. typed_aster/futures/listen_key/keepalive.py +33 -0
  103. typed_aster/futures/listen_key/start.py +36 -0
  104. typed_aster/futures/market/__init__.py +50 -0
  105. typed_aster/futures/market/agg_trades.py +168 -0
  106. typed_aster/futures/market/asset_logos.py +41 -0
  107. typed_aster/futures/market/book_ticker.py +44 -0
  108. typed_aster/futures/market/depth.py +61 -0
  109. typed_aster/futures/market/exchange_info.py +206 -0
  110. typed_aster/futures/market/funding_info.py +62 -0
  111. typed_aster/futures/market/funding_rate.py +168 -0
  112. typed_aster/futures/market/historical_trades.py +121 -0
  113. typed_aster/futures/market/index_price_klines.py +327 -0
  114. typed_aster/futures/market/index_references.py +61 -0
  115. typed_aster/futures/market/klines.py +327 -0
  116. typed_aster/futures/market/mark_price_klines.py +327 -0
  117. typed_aster/futures/market/market_klines.py +327 -0
  118. typed_aster/futures/market/ping.py +33 -0
  119. typed_aster/futures/market/premium_index.py +44 -0
  120. typed_aster/futures/market/remaining_openable_notional_value.py +49 -0
  121. typed_aster/futures/market/schemas.py +111 -0
  122. typed_aster/futures/market/ticker_24hr.py +44 -0
  123. typed_aster/futures/market/ticker_price.py +44 -0
  124. typed_aster/futures/market/time.py +37 -0
  125. typed_aster/futures/market/trades.py +48 -0
  126. typed_aster/futures/mmp/__init__.py +13 -0
  127. typed_aster/futures/mmp/delete.py +37 -0
  128. typed_aster/futures/mmp/get.py +59 -0
  129. typed_aster/futures/mmp/reset.py +37 -0
  130. typed_aster/futures/mmp/set.py +73 -0
  131. typed_aster/futures/position/__init__.py +13 -0
  132. typed_aster/futures/position/adl_quantile.py +48 -0
  133. typed_aster/futures/position/margin_history.py +193 -0
  134. typed_aster/futures/position/risk.py +80 -0
  135. typed_aster/futures/position/schemas.py +25 -0
  136. typed_aster/futures/position/set_margin.py +72 -0
  137. typed_aster/futures/strategy/__init__.py +13 -0
  138. typed_aster/futures/strategy/history.py +67 -0
  139. typed_aster/futures/strategy/open_orders.py +54 -0
  140. typed_aster/futures/strategy/place.py +428 -0
  141. typed_aster/futures/strategy/schemas.py +100 -0
  142. typed_aster/futures/strategy/update.py +122 -0
  143. typed_aster/futures/streams/__init__.py +48 -0
  144. typed_aster/futures/streams/agg_trade.py +56 -0
  145. typed_aster/futures/streams/all_book_tickers.py +28 -0
  146. typed_aster/futures/streams/all_force_orders.py +28 -0
  147. typed_aster/futures/streams/all_mark_price.py +31 -0
  148. typed_aster/futures/streams/all_mark_price_1s.py +31 -0
  149. typed_aster/futures/streams/all_mini_tickers.py +31 -0
  150. typed_aster/futures/streams/all_tickers.py +31 -0
  151. typed_aster/futures/streams/book_ticker.py +30 -0
  152. typed_aster/futures/streams/diff_depth.py +30 -0
  153. typed_aster/futures/streams/diff_depth_speed.py +32 -0
  154. typed_aster/futures/streams/force_order.py +30 -0
  155. typed_aster/futures/streams/kline.py +116 -0
  156. typed_aster/futures/streams/mark_price.py +30 -0
  157. typed_aster/futures/streams/mark_price_1s.py +30 -0
  158. typed_aster/futures/streams/mini_ticker.py +30 -0
  159. typed_aster/futures/streams/partial_depth.py +32 -0
  160. typed_aster/futures/streams/partial_depth_speed.py +34 -0
  161. typed_aster/futures/streams/schemas.py +95 -0
  162. typed_aster/futures/streams/ticker.py +30 -0
  163. typed_aster/futures/streams/trade_pro.py +30 -0
  164. typed_aster/futures/sub_accounts/__init__.py +14 -0
  165. typed_aster/futures/sub_accounts/bind.py +57 -0
  166. typed_aster/futures/sub_accounts/create.py +64 -0
  167. typed_aster/futures/sub_accounts/list.py +58 -0
  168. typed_aster/futures/sub_accounts/transfer.py +77 -0
  169. typed_aster/futures/sub_accounts/update.py +66 -0
  170. typed_aster/futures/trade/__init__.py +48 -0
  171. typed_aster/futures/trade/all_orders.py +143 -0
  172. typed_aster/futures/trade/cancel_all_open_orders.py +40 -0
  173. typed_aster/futures/trade/cancel_batch_orders.py +58 -0
  174. typed_aster/futures/trade/cancel_order.py +54 -0
  175. typed_aster/futures/trade/chase_order.py +147 -0
  176. typed_aster/futures/trade/countdown_cancel_all.py +52 -0
  177. typed_aster/futures/trade/force_orders.py +174 -0
  178. typed_aster/futures/trade/guarded_cancel_batch_orders.py +64 -0
  179. typed_aster/futures/trade/guarded_cancel_order.py +58 -0
  180. typed_aster/futures/trade/modify_batch_orders.py +75 -0
  181. typed_aster/futures/trade/modify_order.py +67 -0
  182. typed_aster/futures/trade/noop.py +43 -0
  183. typed_aster/futures/trade/open_order.py +54 -0
  184. typed_aster/futures/trade/open_orders.py +46 -0
  185. typed_aster/futures/trade/order.py +54 -0
  186. typed_aster/futures/trade/place_batch_orders.py +199 -0
  187. typed_aster/futures/trade/place_order.py +258 -0
  188. typed_aster/futures/trade/schemas.py +96 -0
  189. typed_aster/futures/trade/test_order.py +290 -0
  190. typed_aster/futures/trade/user_trades.py +187 -0
  191. typed_aster/futures/user_stream/__init__.py +10 -0
  192. typed_aster/futures/user_stream/events.py +299 -0
  193. typed_aster/futures/user_stream/schemas.py +26 -0
  194. typed_aster/futures/wallet/__init__.py +24 -0
  195. typed_aster/futures/wallet/deposit_withdraw_history.py +57 -0
  196. typed_aster/futures/wallet/migrate.py +39 -0
  197. typed_aster/futures/wallet/migrate_history.py +84 -0
  198. typed_aster/futures/wallet/solana_withdraw.py +55 -0
  199. typed_aster/futures/wallet/transfer.py +53 -0
  200. typed_aster/futures/wallet/withdraw.py +55 -0
  201. typed_aster/futures/wallet/withdraw_info.py +75 -0
  202. typed_aster/main.py +51 -0
  203. typed_aster/prediction/__init__.py +101 -0
  204. typed_aster/prediction/account/__init__.py +12 -0
  205. typed_aster/prediction/account/commission_rate.py +53 -0
  206. typed_aster/prediction/account/info.py +30 -0
  207. typed_aster/prediction/account/transaction_history.py +120 -0
  208. typed_aster/prediction/listen_key/__init__.py +12 -0
  209. typed_aster/prediction/listen_key/close.py +46 -0
  210. typed_aster/prediction/listen_key/keepalive.py +46 -0
  211. typed_aster/prediction/listen_key/start.py +36 -0
  212. typed_aster/prediction/market/__init__.py +32 -0
  213. typed_aster/prediction/market/agg_trades.py +170 -0
  214. typed_aster/prediction/market/book_ticker.py +46 -0
  215. typed_aster/prediction/market/depth.py +47 -0
  216. typed_aster/prediction/market/exchange_info.py +163 -0
  217. typed_aster/prediction/market/historical_trades.py +119 -0
  218. typed_aster/prediction/market/klines.py +281 -0
  219. typed_aster/prediction/market/ping.py +33 -0
  220. typed_aster/prediction/market/schemas.py +118 -0
  221. typed_aster/prediction/market/ticker_24hr.py +50 -0
  222. typed_aster/prediction/market/ticker_price.py +46 -0
  223. typed_aster/prediction/market/time.py +37 -0
  224. typed_aster/prediction/market/trades.py +50 -0
  225. typed_aster/prediction/outcomes/__init__.py +13 -0
  226. typed_aster/prediction/outcomes/burn.py +66 -0
  227. typed_aster/prediction/outcomes/merge.py +63 -0
  228. typed_aster/prediction/outcomes/mint.py +66 -0
  229. typed_aster/prediction/outcomes/schemas.py +14 -0
  230. typed_aster/prediction/outcomes/split.py +69 -0
  231. typed_aster/prediction/positions/__init__.py +12 -0
  232. typed_aster/prediction/positions/history.py +102 -0
  233. typed_aster/prediction/positions/list.py +80 -0
  234. typed_aster/prediction/positions/settlements.py +96 -0
  235. typed_aster/prediction/streams/__init__.py +36 -0
  236. typed_aster/prediction/streams/agg_trade.py +30 -0
  237. typed_aster/prediction/streams/all_book_tickers.py +28 -0
  238. typed_aster/prediction/streams/all_mini_tickers.py +31 -0
  239. typed_aster/prediction/streams/all_tickers.py +31 -0
  240. typed_aster/prediction/streams/book_ticker.py +30 -0
  241. typed_aster/prediction/streams/diff_depth.py +32 -0
  242. typed_aster/prediction/streams/event.py +72 -0
  243. typed_aster/prediction/streams/kline.py +48 -0
  244. typed_aster/prediction/streams/mini_ticker.py +30 -0
  245. typed_aster/prediction/streams/partial_depth.py +34 -0
  246. typed_aster/prediction/streams/ticker.py +30 -0
  247. typed_aster/prediction/streams/trade.py +30 -0
  248. typed_aster/prediction/streams/trade_pro.py +30 -0
  249. typed_aster/prediction/trade/__init__.py +28 -0
  250. typed_aster/prediction/trade/all_orders.py +145 -0
  251. typed_aster/prediction/trade/cancel_all_open_orders.py +53 -0
  252. typed_aster/prediction/trade/cancel_order.py +53 -0
  253. typed_aster/prediction/trade/noop.py +41 -0
  254. typed_aster/prediction/trade/open_order.py +53 -0
  255. typed_aster/prediction/trade/open_orders.py +46 -0
  256. typed_aster/prediction/trade/order.py +53 -0
  257. typed_aster/prediction/trade/place_order.py +92 -0
  258. typed_aster/prediction/trade/schemas.py +57 -0
  259. typed_aster/prediction/trade/user_trades.py +152 -0
  260. typed_aster/prediction/user_stream/__init__.py +10 -0
  261. typed_aster/prediction/user_stream/events.py +33 -0
  262. typed_aster/prediction/wallet/__init__.py +14 -0
  263. typed_aster/prediction/wallet/deposit_address.py +43 -0
  264. typed_aster/prediction/wallet/estimate_withdraw_fee.py +44 -0
  265. typed_aster/prediction/wallet/solana_withdraw.py +57 -0
  266. typed_aster/prediction/wallet/transfer.py +55 -0
  267. typed_aster/prediction/wallet/withdraw.py +57 -0
  268. typed_aster/py.typed +0 -0
  269. typed_aster/schemas.py +697 -0
  270. typed_aster/spot/__init__.py +91 -0
  271. typed_aster/spot/account/__init__.py +12 -0
  272. typed_aster/spot/account/commission_rate.py +40 -0
  273. typed_aster/spot/account/info.py +30 -0
  274. typed_aster/spot/account/transaction_history.py +175 -0
  275. typed_aster/spot/builders/__init__.py +13 -0
  276. typed_aster/spot/builders/approve.py +57 -0
  277. typed_aster/spot/builders/delete.py +46 -0
  278. typed_aster/spot/builders/list.py +45 -0
  279. typed_aster/spot/builders/update.py +51 -0
  280. typed_aster/spot/listen_key/__init__.py +12 -0
  281. typed_aster/spot/listen_key/close.py +46 -0
  282. typed_aster/spot/listen_key/keepalive.py +46 -0
  283. typed_aster/spot/listen_key/start.py +36 -0
  284. typed_aster/spot/market/__init__.py +34 -0
  285. typed_aster/spot/market/agg_trades.py +170 -0
  286. typed_aster/spot/market/book_ticker.py +46 -0
  287. typed_aster/spot/market/depth.py +47 -0
  288. typed_aster/spot/market/exchange_info.py +115 -0
  289. typed_aster/spot/market/historical_trades.py +119 -0
  290. typed_aster/spot/market/klines.py +329 -0
  291. typed_aster/spot/market/ping.py +33 -0
  292. typed_aster/spot/market/schemas.py +136 -0
  293. typed_aster/spot/market/ticker_24hr.py +46 -0
  294. typed_aster/spot/market/ticker_24hr_opt.py +46 -0
  295. typed_aster/spot/market/ticker_price.py +46 -0
  296. typed_aster/spot/market/time.py +37 -0
  297. typed_aster/spot/market/trades.py +50 -0
  298. typed_aster/spot/streams/__init__.py +34 -0
  299. typed_aster/spot/streams/agg_trade.py +30 -0
  300. typed_aster/spot/streams/all_book_tickers.py +28 -0
  301. typed_aster/spot/streams/all_mini_tickers.py +31 -0
  302. typed_aster/spot/streams/all_tickers.py +31 -0
  303. typed_aster/spot/streams/book_ticker.py +30 -0
  304. typed_aster/spot/streams/diff_depth.py +32 -0
  305. typed_aster/spot/streams/kline.py +48 -0
  306. typed_aster/spot/streams/mini_ticker.py +30 -0
  307. typed_aster/spot/streams/partial_depth.py +34 -0
  308. typed_aster/spot/streams/ticker.py +30 -0
  309. typed_aster/spot/streams/trade.py +30 -0
  310. typed_aster/spot/streams/trade_pro.py +30 -0
  311. typed_aster/spot/trade/__init__.py +32 -0
  312. typed_aster/spot/trade/all_orders.py +143 -0
  313. typed_aster/spot/trade/cancel_all_open_orders.py +53 -0
  314. typed_aster/spot/trade/cancel_batch_orders.py +99 -0
  315. typed_aster/spot/trade/cancel_order.py +53 -0
  316. typed_aster/spot/trade/noop.py +41 -0
  317. typed_aster/spot/trade/open_order.py +53 -0
  318. typed_aster/spot/trade/open_orders.py +46 -0
  319. typed_aster/spot/trade/order.py +53 -0
  320. typed_aster/spot/trade/place_batch_orders.py +161 -0
  321. typed_aster/spot/trade/place_order.py +164 -0
  322. typed_aster/spot/trade/schemas.py +57 -0
  323. typed_aster/spot/trade/user_trades.py +152 -0
  324. typed_aster/spot/user_stream/__init__.py +10 -0
  325. typed_aster/spot/user_stream/events.py +33 -0
  326. typed_aster/spot/wallet/__init__.py +14 -0
  327. typed_aster/spot/wallet/deposit_address.py +43 -0
  328. typed_aster/spot/wallet/estimate_withdraw_fee.py +44 -0
  329. typed_aster/spot/wallet/solana_withdraw.py +57 -0
  330. typed_aster/spot/wallet/transfer.py +55 -0
  331. typed_aster/spot/wallet/withdraw.py +57 -0
  332. typed_aster-0.1.0.dist-info/METADATA +116 -0
  333. typed_aster-0.1.0.dist-info/RECORD +336 -0
  334. typed_aster-0.1.0.dist-info/WHEEL +5 -0
  335. typed_aster-0.1.0.dist-info/licenses/LICENSE +21 -0
  336. typed_aster-0.1.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,14 @@
1
+ """A fully typed, validated async client for the Aster API.
2
+
3
+ Examples:
4
+ ```python
5
+ from typed_aster import Aster
6
+
7
+ async with Aster.new(public=True) as client:
8
+ server_time = await client.futures.market.time()
9
+ ```
10
+ """
11
+
12
+ import lazy_loader as lazy
13
+
14
+ __getattr__, __dir__, __all__ = lazy.attach_stub(__name__, __file__)
@@ -0,0 +1,23 @@
1
+ from .main import Aster
2
+ from .core import (
3
+ Error,
4
+ NetworkError,
5
+ ValidationError,
6
+ ApiError,
7
+ BadRequest,
8
+ AuthError,
9
+ RateLimited,
10
+ LogicError,
11
+ )
12
+
13
+ __all__ = [
14
+ 'Aster',
15
+ 'Error',
16
+ 'NetworkError',
17
+ 'ValidationError',
18
+ 'ApiError',
19
+ 'BadRequest',
20
+ 'AuthError',
21
+ 'RateLimited',
22
+ 'LogicError',
23
+ ]
@@ -0,0 +1,71 @@
1
+ # Generated by typed-dev — see CONTRIBUTING.md.
2
+ from functools import cached_property
3
+ from .account import Account
4
+ from .perp import Perp
5
+ from .rpc import ChainRpc
6
+ from .spot import Spot
7
+ from .staking import Staking
8
+ from .wallet import Wallet
9
+ from typed_aster.core.base import ChainBase
10
+
11
+
12
+ class Chain(ChainBase):
13
+ """Aster Chain: REST (account privacy, staking, deposits, withdrawals and transfers) and the read-only JSON-RPC. Mainnet only.
14
+
15
+ References:
16
+ - [Upstream docs](https://asterdex.github.io/aster-api-website/aster-chain/endpoints/)
17
+ """
18
+
19
+ @cached_property
20
+ def account(self) -> Account:
21
+ """Aster Chain account: privacy mode (PUBLIC/PRIVATE) and transfers to another Aster Chain address.
22
+
23
+ References:
24
+ - [Upstream docs](https://asterdex.github.io/aster-api-website/aster-chain/endpoints/#aster-chain-account-endpoints)
25
+ """
26
+ return Account(client=self.client)
27
+
28
+ @cached_property
29
+ def perp(self) -> Perp:
30
+ """Aster Chain perp account: withdrawals (EVM and Solana), withdraw limits, deposit/withdraw history and spot/perp transfers.
31
+
32
+ References:
33
+ - [Upstream docs](https://asterdex.github.io/aster-api-website/aster-chain/endpoints/#aster-chain-perp-withdraw-transfer-endpoints)
34
+ """
35
+ return Perp(client=self.client)
36
+
37
+ @cached_property
38
+ def rpc(self) -> ChainRpc:
39
+ """Aster Chain read-only JSON-RPC 2.0 (`POST /info`): balances, positions, staking summary, open orders and fills of any address, honouring account privacy mode.
40
+
41
+ References:
42
+ - [Upstream docs](https://asterdex.github.io/aster-api-website/rpc/endpoints/)
43
+ """
44
+ return ChainRpc(client=self.rpc_client)
45
+
46
+ @cached_property
47
+ def spot(self) -> Spot:
48
+ """Aster Chain spot account: withdrawals (EVM and Solana), spot/perp transfers and the SUI deposit address.
49
+
50
+ References:
51
+ - [Upstream docs](https://asterdex.github.io/aster-api-website/aster-chain/endpoints/#aster-chain-spot-withdraw-transfer-endpoints)
52
+ """
53
+ return Spot(client=self.client)
54
+
55
+ @cached_property
56
+ def staking(self) -> Staking:
57
+ """ASTER staking on Aster Chain: staking position reads, stake/add/extend/claim actions and the network-wide locked total.
58
+
59
+ References:
60
+ - [Upstream docs](https://asterdex.github.io/aster-api-website/aster-chain/endpoints/#aster-chain-staking-endpoints)
61
+ """
62
+ return Staking(client=self.client)
63
+
64
+ @cached_property
65
+ def wallet(self) -> Wallet:
66
+ """Aster Chain withdrawal helpers: public withdrawal fee estimates.
67
+
68
+ References:
69
+ - [Upstream docs](https://asterdex.github.io/aster-api-website/aster-chain/endpoints/#aster-chain-withdraw-endpoints)
70
+ """
71
+ return Wallet(client=self.client)
@@ -0,0 +1,12 @@
1
+ # Generated by typed-dev — see CONTRIBUTING.md.
2
+ from .modify_status import ModifyStatus
3
+ from .status import Status
4
+ from .transfer import Transfer
5
+
6
+
7
+ class Account(ModifyStatus, Status, Transfer):
8
+ """Aster Chain account: privacy mode (PUBLIC/PRIVATE) and transfers to another Aster Chain address.
9
+
10
+ References:
11
+ - [Upstream docs](https://asterdex.github.io/aster-api-website/aster-chain/endpoints/#aster-chain-account-endpoints)
12
+ """
@@ -0,0 +1,44 @@
1
+ # Generated by typed-dev — see CONTRIBUTING.md.
2
+ from typing_extensions import Literal, TypedDict
3
+ from typed_aster.core.endpoint.rpc import RpcEndpoint
4
+
5
+
6
+ class AccountPrivacyStatus(TypedDict):
7
+ """Account privacy mode after the change."""
8
+
9
+ status: Literal['PUBLIC', 'PRIVATE']
10
+ """Account privacy mode."""
11
+
12
+
13
+ class Request(TypedDict):
14
+ status: Literal['PUBLIC', 'PRIVATE']
15
+ """New privacy mode: `PUBLIC` or `PRIVATE`."""
16
+
17
+
18
+ class ModifyStatus(RpcEndpoint):
19
+ """Set the account's privacy mode. The change is broadcast to Aster Chain."""
20
+
21
+ async def modify_status(
22
+ self,
23
+ status: Literal['PUBLIC', 'PRIVATE'],
24
+ *,
25
+ validate: bool | None = None,
26
+ ) -> AccountPrivacyStatus:
27
+ """Set the account's privacy mode. The change is broadcast to Aster Chain.
28
+
29
+ Args:
30
+ status: New privacy mode: `PUBLIC` or `PRIVATE`.
31
+ validate: Override this call's response validation; falls back to the client-level default when omitted.
32
+
33
+ References:
34
+ - [Official docs](https://asterdex.github.io/aster-api-website/aster-chain/endpoints/#modify-account-status-trade)
35
+ """
36
+ return await self.request(
37
+ Request(status=status),
38
+ method='POST',
39
+ path='account/modify-status',
40
+ meta={},
41
+ validate=validate,
42
+ request_type=Request,
43
+ response_type=AccountPrivacyStatus,
44
+ )
@@ -0,0 +1,36 @@
1
+ # Generated by typed-dev — see CONTRIBUTING.md.
2
+ from typing_extensions import Literal, TypedDict
3
+ from typed_aster.core.endpoint.rpc import RpcEndpoint
4
+
5
+
6
+ class AccountPrivacyStatus(TypedDict):
7
+ """Account privacy mode."""
8
+
9
+ status: Literal['PUBLIC', 'PRIVATE']
10
+ """Account privacy mode."""
11
+
12
+
13
+ class Request(TypedDict): ...
14
+
15
+
16
+ class Status(RpcEndpoint):
17
+ """Get the account's privacy mode."""
18
+
19
+ async def status(self, *, validate: bool | None = None) -> AccountPrivacyStatus:
20
+ """Get the account's privacy mode.
21
+
22
+ Args:
23
+ validate: Override this call's response validation; falls back to the client-level default when omitted.
24
+
25
+ References:
26
+ - [Official docs](https://asterdex.github.io/aster-api-website/aster-chain/endpoints/#get-account-status-user_data)
27
+ """
28
+ return await self.request(
29
+ Request(),
30
+ method='GET',
31
+ path='account/status',
32
+ meta={},
33
+ validate=validate,
34
+ request_type=Request,
35
+ response_type=AccountPrivacyStatus,
36
+ )
@@ -0,0 +1,74 @@
1
+ # Generated by typed-dev — see CONTRIBUTING.md.
2
+ from decimal import Decimal
3
+ from typing_extensions import Literal, NotRequired, TypedDict
4
+ from typed_aster.core import TimestampMillis
5
+ from typed_aster.core.endpoint.rpc import RpcEndpoint
6
+
7
+
8
+ class ChainTransfer(TypedDict):
9
+ """Accepted transfer."""
10
+
11
+ transferId: NotRequired[str]
12
+ """Transfer id."""
13
+ asset: NotRequired[str]
14
+ """Asset name."""
15
+ amount: NotRequired[Decimal]
16
+ """Transferred amount."""
17
+ toAddress: NotRequired[str]
18
+ """Recipient address."""
19
+ timestamp: NotRequired[TimestampMillis]
20
+ """Transfer time."""
21
+ status: NotRequired[Literal['SUCCESS', 'PENDING']]
22
+ """Transfer status."""
23
+
24
+
25
+ class Request(TypedDict):
26
+ asset: str
27
+ """Asset name, e.g. `USDT`."""
28
+ amount: Decimal
29
+ """Transfer amount, greater than 0."""
30
+ toAddress: str
31
+ """Recipient's Aster Chain wallet address."""
32
+ clientTranId: NotRequired[str]
33
+ """Client-defined transfer id; generated by Aster when omitted."""
34
+
35
+
36
+ class Transfer(RpcEndpoint):
37
+ """Transfer an asset to another Aster Chain address. The recipient must be a registered Aster Chain user."""
38
+
39
+ async def transfer(
40
+ self,
41
+ *,
42
+ asset: str,
43
+ amount: Decimal,
44
+ to_address: str,
45
+ client_tran_id: str | None = None,
46
+ validate: bool | None = None,
47
+ ) -> ChainTransfer:
48
+ """Transfer an asset to another Aster Chain address. The recipient must be a registered Aster Chain user.
49
+
50
+ Args:
51
+ asset: Asset name, e.g. `USDT`.
52
+ amount: Transfer amount, greater than 0.
53
+ to_address: Recipient's Aster Chain wallet address.
54
+ client_tran_id: Client-defined transfer id; generated by Aster when omitted.
55
+ validate: Override this call's response validation; falls back to the client-level default when omitted.
56
+
57
+ References:
58
+ - [Official docs](https://asterdex.github.io/aster-api-website/aster-chain/endpoints/#transfer-to-address-withdraw)
59
+ """
60
+ request: Request = Request(asset=asset, amount=amount, toAddress=to_address)
61
+ if client_tran_id is not None:
62
+ request['clientTranId'] = client_tran_id
63
+ return await self.request(
64
+ request,
65
+ method='POST',
66
+ path='transfer',
67
+ meta={
68
+ 'sign': 'main',
69
+ 'order': ['asset', 'amount', 'toAddress', 'clientTranId', 'nonce', 'user'],
70
+ },
71
+ validate=validate,
72
+ request_type=Request,
73
+ response_type=ChainTransfer,
74
+ )
@@ -0,0 +1,16 @@
1
+ # Generated by typed-dev — see CONTRIBUTING.md.
2
+ from .deposit_withdraw_history import DepositWithdrawHistory
3
+ from .solana_withdraw import SolanaWithdraw
4
+ from .transfer import Transfer
5
+ from .withdraw import Withdraw
6
+ from .withdraw_info import WithdrawInfoEndpoint
7
+
8
+
9
+ class Perp(
10
+ DepositWithdrawHistory, SolanaWithdraw, Transfer, Withdraw, WithdrawInfoEndpoint
11
+ ):
12
+ """Aster Chain perp account: withdrawals (EVM and Solana), withdraw limits, deposit/withdraw history and spot/perp transfers.
13
+
14
+ References:
15
+ - [Upstream docs](https://asterdex.github.io/aster-api-website/aster-chain/endpoints/#aster-chain-perp-withdraw-transfer-endpoints)
16
+ """
@@ -0,0 +1,68 @@
1
+ # Generated by typed-dev — see CONTRIBUTING.md.
2
+ from decimal import Decimal
3
+ from typing_extensions import Literal, NotRequired, TypedDict
4
+ from typed_aster.core import TimestampMillis
5
+ from typed_aster.core.endpoint.rpc import RpcEndpoint
6
+
7
+
8
+ class ChainDepositWithdrawal(TypedDict):
9
+ """One deposit or withdrawal."""
10
+
11
+ id: NotRequired[str]
12
+ """Record id."""
13
+ type: NotRequired[Literal['DEPOSIT', 'WITHDRAW']]
14
+ """Record type."""
15
+ asset: NotRequired[str]
16
+ """Asset name."""
17
+ amount: NotRequired[Decimal]
18
+ """Amount."""
19
+ state: NotRequired[str]
20
+ """Record state, e.g. `COMPLETED`."""
21
+ txHash: NotRequired[str]
22
+ """On-chain transaction hash."""
23
+ time: NotRequired[TimestampMillis]
24
+ """Record time."""
25
+ chainId: NotRequired[int]
26
+ """Chain id."""
27
+ accountType: NotRequired[str]
28
+ """Account type, e.g. `perp`."""
29
+
30
+
31
+ class Request(TypedDict):
32
+ chainId: NotRequired[str]
33
+ """Filter by chain id (sent as a string)."""
34
+
35
+
36
+ Response = list[ChainDepositWithdrawal]
37
+
38
+
39
+ class DepositWithdrawHistory(RpcEndpoint):
40
+ """Get the deposit and withdrawal history of the user's perp account."""
41
+
42
+ async def deposit_withdraw_history(
43
+ self,
44
+ chain_id: str | None = None,
45
+ *,
46
+ validate: bool | None = None,
47
+ ) -> Response:
48
+ """Get the deposit and withdrawal history of the user's perp account.
49
+
50
+ Args:
51
+ chain_id: Filter by chain id (sent as a string).
52
+ validate: Override this call's response validation; falls back to the client-level default when omitted.
53
+
54
+ References:
55
+ - [Official docs](https://asterdex.github.io/aster-api-website/aster-chain/endpoints/#depositwithdraw-history-user_data)
56
+ """
57
+ request: Request = Request()
58
+ if chain_id is not None:
59
+ request['chainId'] = chain_id
60
+ return await self.request(
61
+ request,
62
+ method='GET',
63
+ path='perp/deposit-withdraw-history',
64
+ meta={},
65
+ validate=validate,
66
+ request_type=Request,
67
+ response_type=Response,
68
+ )
@@ -0,0 +1,55 @@
1
+ # Generated by typed-dev — see CONTRIBUTING.md.
2
+ from decimal import Decimal
3
+ from typing_extensions import TypedDict
4
+ from typed_aster.core.endpoint.rpc import RpcEndpoint
5
+ from typed_aster.schemas import Withdrawal
6
+
7
+
8
+ class Request(TypedDict):
9
+ asset: str
10
+ """Asset name, e.g. `USDT`."""
11
+ chainId: int
12
+ """Target chain id (`101`, Solana)."""
13
+ amount: Decimal
14
+ """Withdrawal amount."""
15
+ fee: Decimal
16
+ """Withdrawal fee (see `wallet.estimate_withdraw_fee`)."""
17
+ receiver: str
18
+ """Recipient Solana address."""
19
+
20
+
21
+ class SolanaWithdraw(RpcEndpoint):
22
+ """Withdraw from the perp account to a Solana address."""
23
+
24
+ async def solana_withdraw(
25
+ self,
26
+ *,
27
+ asset: str,
28
+ chain_id: int,
29
+ amount: Decimal,
30
+ fee: Decimal,
31
+ receiver: str,
32
+ validate: bool | None = None,
33
+ ) -> Withdrawal:
34
+ """Withdraw from the perp account to a Solana address.
35
+
36
+ Args:
37
+ asset: Asset name, e.g. `USDT`.
38
+ chain_id: Target chain id (`101`, Solana).
39
+ amount: Withdrawal amount.
40
+ fee: Withdrawal fee (see `wallet.estimate_withdraw_fee`).
41
+ receiver: Recipient Solana address.
42
+ validate: Override this call's response validation; falls back to the client-level default when omitted.
43
+
44
+ References:
45
+ - [Official docs](https://asterdex.github.io/aster-api-website/aster-chain/endpoints/#user-solana-withdraw-withdraw)
46
+ """
47
+ return await self.request(
48
+ Request(asset=asset, chainId=chain_id, amount=amount, fee=fee, receiver=receiver),
49
+ method='POST',
50
+ path='perp/user-solana-withdraw',
51
+ meta={},
52
+ validate=validate,
53
+ request_type=Request,
54
+ response_type=Withdrawal,
55
+ )
@@ -0,0 +1,56 @@
1
+ # Generated by typed-dev — see CONTRIBUTING.md.
2
+ from decimal import Decimal
3
+ from typing_extensions import Literal, TypedDict
4
+ from typed_aster.core.endpoint.rpc import RpcEndpoint
5
+ from typed_aster.schemas import TransferResult
6
+
7
+
8
+ class Request(TypedDict):
9
+ asset: str
10
+ """Asset name, e.g. `USDT`."""
11
+ amount: Decimal
12
+ """Transfer amount, greater than 0."""
13
+ clientTranId: str
14
+ """Client-defined transfer id."""
15
+ kindType: Literal['SPOT_FUTURE', 'FUTURE_SPOT']
16
+ """Direction: `SPOT_FUTURE` (spot to perp) or `FUTURE_SPOT` (perp to spot)."""
17
+
18
+
19
+ class Transfer(RpcEndpoint):
20
+ """Transfer an asset between the spot wallet and the perp account."""
21
+
22
+ async def transfer(
23
+ self,
24
+ *,
25
+ asset: str,
26
+ amount: Decimal,
27
+ client_tran_id: str,
28
+ kind_type: Literal['SPOT_FUTURE', 'FUTURE_SPOT'],
29
+ validate: bool | None = None,
30
+ ) -> TransferResult:
31
+ """Transfer an asset between the spot wallet and the perp account.
32
+
33
+ Args:
34
+ asset: Asset name, e.g. `USDT`.
35
+ amount: Transfer amount, greater than 0.
36
+ client_tran_id: Client-defined transfer id.
37
+ kind_type: Direction: `SPOT_FUTURE` (spot to perp) or `FUTURE_SPOT` (perp to spot).
38
+ validate: Override this call's response validation; falls back to the client-level default when omitted.
39
+
40
+ References:
41
+ - [Official docs](https://asterdex.github.io/aster-api-website/aster-chain/endpoints/#wallet-transfer-trade)
42
+ """
43
+ return await self.request(
44
+ Request(
45
+ asset=asset, amount=amount, clientTranId=client_tran_id, kindType=kind_type
46
+ ),
47
+ method='POST',
48
+ path='perp/wallet/transfer',
49
+ meta={
50
+ 'sign': 'main',
51
+ 'order': ['asset', 'amount', 'clientTranId', 'kindType', 'nonce', 'user'],
52
+ },
53
+ validate=validate,
54
+ request_type=Request,
55
+ response_type=TransferResult,
56
+ )
@@ -0,0 +1,64 @@
1
+ # Generated by typed-dev — see CONTRIBUTING.md.
2
+ from decimal import Decimal
3
+ from typing_extensions import Literal, NotRequired, TypedDict
4
+ from typed_aster.core.endpoint.rpc import RpcEndpoint
5
+ from typed_aster.schemas import Withdrawal
6
+
7
+
8
+ class Request(TypedDict):
9
+ asset: str
10
+ """Asset name, e.g. `USDT`."""
11
+ chainId: int
12
+ """Target chain id, e.g. `1` (ETH), `56` (BSC), `42161` (Arbitrum)."""
13
+ amount: Decimal
14
+ """Withdrawal amount."""
15
+ fee: Decimal
16
+ """Withdrawal fee (see `wallet.estimate_withdraw_fee`)."""
17
+ receiver: str
18
+ """Recipient on-chain address."""
19
+ signatureType: NotRequired[Literal['EOA', 'SafeWallet']]
20
+ """Signature type; `SafeWallet` for a Safe wallet account, which may send several comma-separated signatures. Default `EOA`."""
21
+
22
+
23
+ class Withdraw(RpcEndpoint):
24
+ """Withdraw from the perp account to an EVM address. The main wallet signs the EIP-712 withdraw `Action` (`userNonce`, `userSignature`); the call itself is agent-signed."""
25
+
26
+ async def withdraw(
27
+ self,
28
+ *,
29
+ asset: str,
30
+ chain_id: int,
31
+ amount: Decimal,
32
+ fee: Decimal,
33
+ receiver: str,
34
+ signature_type: Literal['EOA', 'SafeWallet'] | None = None,
35
+ validate: bool | None = None,
36
+ ) -> Withdrawal:
37
+ """Withdraw from the perp account to an EVM address. The main wallet signs the EIP-712 withdraw `Action` (`userNonce`, `userSignature`); the call itself is agent-signed.
38
+
39
+ Args:
40
+ asset: Asset name, e.g. `USDT`.
41
+ chain_id: Target chain id, e.g. `1` (ETH), `56` (BSC), `42161` (Arbitrum).
42
+ amount: Withdrawal amount.
43
+ fee: Withdrawal fee (see `wallet.estimate_withdraw_fee`).
44
+ receiver: Recipient on-chain address.
45
+ signature_type: Signature type; `SafeWallet` for a Safe wallet account, which may send several comma-separated signatures. Default `EOA`.
46
+ validate: Override this call's response validation; falls back to the client-level default when omitted.
47
+
48
+ References:
49
+ - [Official docs](https://asterdex.github.io/aster-api-website/aster-chain/endpoints/#user-withdraw-withdraw)
50
+ """
51
+ request: Request = Request(
52
+ asset=asset, chainId=chain_id, amount=amount, fee=fee, receiver=receiver
53
+ )
54
+ if signature_type is not None:
55
+ request['signatureType'] = signature_type
56
+ return await self.request(
57
+ request,
58
+ method='POST',
59
+ path='perp/user-withdraw',
60
+ meta={'sign': 'withdraw'},
61
+ validate=validate,
62
+ request_type=Request,
63
+ response_type=Withdrawal,
64
+ )
@@ -0,0 +1,75 @@
1
+ # Generated by typed-dev — see CONTRIBUTING.md.
2
+ from decimal import Decimal
3
+ from typing_extensions import NotRequired, TypedDict
4
+ from typed_aster.core.endpoint.rpc import RpcEndpoint
5
+
6
+
7
+ class ChainWithdrawLimit(TypedDict):
8
+ """Withdraw limits of one asset on one chain."""
9
+
10
+ chainId: NotRequired[int]
11
+ """Chain id."""
12
+ spotMaxWithdrawAmount: NotRequired[Decimal]
13
+ """Maximum withdrawable from the spot account."""
14
+ perpMaxWithdrawAmount: NotRequired[Decimal]
15
+ """Maximum withdrawable from the perp account."""
16
+ chainLimit: NotRequired[Decimal]
17
+ """Chain withdrawal limit."""
18
+ withdrawFee: NotRequired[Decimal]
19
+ """Withdrawal fee."""
20
+
21
+
22
+ class Request(TypedDict): ...
23
+
24
+
25
+ class AssetWithdrawLimits(TypedDict):
26
+ """Withdraw limits of one asset."""
27
+
28
+ currency: NotRequired[str]
29
+ """Asset name."""
30
+ spotTotalWithdrawAmount: NotRequired[Decimal]
31
+ """Total withdrawn from the spot account."""
32
+ perpTotalWithdrawAmount: NotRequired[Decimal]
33
+ """Total withdrawn from the perp account."""
34
+ dailyLimit: NotRequired[Decimal]
35
+ """Daily limit for this asset."""
36
+ chainBalances: NotRequired[dict[str, ChainWithdrawLimit]]
37
+ """Limits per chain, keyed by chain id."""
38
+
39
+
40
+ class WithdrawInfo(TypedDict):
41
+ """Withdrawal limits."""
42
+
43
+ userDailyLimit: NotRequired[Decimal]
44
+ """User's daily withdrawal limit."""
45
+ userRemainingDailyLimit: NotRequired[Decimal]
46
+ """User's remaining daily limit."""
47
+ totalDailyLimit: NotRequired[Decimal]
48
+ """Platform daily limit."""
49
+ totalRemainingDailyLimit: NotRequired[Decimal]
50
+ """Platform remaining daily limit."""
51
+ balances: NotRequired[dict[str, AssetWithdrawLimits]]
52
+ """Limits per asset, keyed by asset name."""
53
+
54
+
55
+ class WithdrawInfoEndpoint(RpcEndpoint):
56
+ """Get the user's withdrawal limits and available balances per asset and chain."""
57
+
58
+ async def withdraw_info(self, *, validate: bool | None = None) -> WithdrawInfo:
59
+ """Get the user's withdrawal limits and available balances per asset and chain.
60
+
61
+ Args:
62
+ validate: Override this call's response validation; falls back to the client-level default when omitted.
63
+
64
+ References:
65
+ - [Official docs](https://asterdex.github.io/aster-api-website/aster-chain/endpoints/#get-withdraw-info-user_data)
66
+ """
67
+ return await self.request(
68
+ Request(),
69
+ method='GET',
70
+ path='perp/user-withdraw-info',
71
+ meta={},
72
+ validate=validate,
73
+ request_type=Request,
74
+ response_type=WithdrawInfo,
75
+ )
@@ -0,0 +1,14 @@
1
+ # Generated by typed-dev — see CONTRIBUTING.md.
2
+ from .get_balance import GetBalance
3
+ from .open_orders import OpenOrders
4
+ from .spot_open_orders import SpotOpenOrders
5
+ from .spot_user_fills import SpotUserFills
6
+ from .user_fills import UserFills
7
+
8
+
9
+ class ChainRpc(GetBalance, OpenOrders, SpotOpenOrders, SpotUserFills, UserFills):
10
+ """Aster Chain read-only JSON-RPC 2.0 (`POST /info`): balances, positions, staking summary, open orders and fills of any address, honouring account privacy mode.
11
+
12
+ References:
13
+ - [Upstream docs](https://asterdex.github.io/aster-api-website/rpc/endpoints/)
14
+ """