typed-aster 0.1.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.
- typed_aster-0.1.0/LICENSE +21 -0
- typed_aster-0.1.0/PKG-INFO +116 -0
- typed_aster-0.1.0/README.md +95 -0
- typed_aster-0.1.0/pyproject.toml +32 -0
- typed_aster-0.1.0/setup.cfg +4 -0
- typed_aster-0.1.0/src/typed_aster/__init__.py +14 -0
- typed_aster-0.1.0/src/typed_aster/__init__.pyi +23 -0
- typed_aster-0.1.0/src/typed_aster/chain/__init__.py +71 -0
- typed_aster-0.1.0/src/typed_aster/chain/account/__init__.py +12 -0
- typed_aster-0.1.0/src/typed_aster/chain/account/modify_status.py +44 -0
- typed_aster-0.1.0/src/typed_aster/chain/account/status.py +36 -0
- typed_aster-0.1.0/src/typed_aster/chain/account/transfer.py +74 -0
- typed_aster-0.1.0/src/typed_aster/chain/perp/__init__.py +16 -0
- typed_aster-0.1.0/src/typed_aster/chain/perp/deposit_withdraw_history.py +68 -0
- typed_aster-0.1.0/src/typed_aster/chain/perp/solana_withdraw.py +55 -0
- typed_aster-0.1.0/src/typed_aster/chain/perp/transfer.py +56 -0
- typed_aster-0.1.0/src/typed_aster/chain/perp/withdraw.py +64 -0
- typed_aster-0.1.0/src/typed_aster/chain/perp/withdraw_info.py +75 -0
- typed_aster-0.1.0/src/typed_aster/chain/rpc/__init__.py +14 -0
- typed_aster-0.1.0/src/typed_aster/chain/rpc/get_balance.py +131 -0
- typed_aster-0.1.0/src/typed_aster/chain/rpc/open_orders.py +50 -0
- typed_aster-0.1.0/src/typed_aster/chain/rpc/schemas.py +73 -0
- typed_aster-0.1.0/src/typed_aster/chain/rpc/spot_open_orders.py +50 -0
- typed_aster-0.1.0/src/typed_aster/chain/rpc/spot_user_fills.py +67 -0
- typed_aster-0.1.0/src/typed_aster/chain/rpc/user_fills.py +67 -0
- typed_aster-0.1.0/src/typed_aster/chain/spot/__init__.py +13 -0
- typed_aster-0.1.0/src/typed_aster/chain/spot/deposit_address.py +41 -0
- typed_aster-0.1.0/src/typed_aster/chain/spot/solana_withdraw.py +55 -0
- typed_aster-0.1.0/src/typed_aster/chain/spot/transfer.py +56 -0
- typed_aster-0.1.0/src/typed_aster/chain/spot/withdraw.py +70 -0
- typed_aster-0.1.0/src/typed_aster/chain/staking/__init__.py +26 -0
- typed_aster-0.1.0/src/typed_aster/chain/staking/claim_rewards.py +45 -0
- typed_aster-0.1.0/src/typed_aster/chain/staking/claimable_rewards.py +46 -0
- typed_aster-0.1.0/src/typed_aster/chain/staking/create.py +60 -0
- typed_aster-0.1.0/src/typed_aster/chain/staking/deposit.py +52 -0
- typed_aster-0.1.0/src/typed_aster/chain/staking/locked_aster.py +38 -0
- typed_aster-0.1.0/src/typed_aster/chain/staking/my_staking.py +48 -0
- typed_aster-0.1.0/src/typed_aster/chain/staking/stake_account_status.py +40 -0
- typed_aster-0.1.0/src/typed_aster/chain/staking/update_lock_period.py +44 -0
- typed_aster-0.1.0/src/typed_aster/chain/wallet/__init__.py +10 -0
- typed_aster-0.1.0/src/typed_aster/chain/wallet/estimate_withdraw_fee.py +58 -0
- typed_aster-0.1.0/src/typed_aster/core/__init__.py +5 -0
- typed_aster-0.1.0/src/typed_aster/core/__init__.pyi +37 -0
- typed_aster-0.1.0/src/typed_aster/core/auth.py +329 -0
- typed_aster-0.1.0/src/typed_aster/core/base.py +208 -0
- typed_aster-0.1.0/src/typed_aster/core/endpoint/__init__.py +0 -0
- typed_aster-0.1.0/src/typed_aster/core/endpoint/jsonrpc.py +100 -0
- typed_aster-0.1.0/src/typed_aster/core/endpoint/rpc.py +141 -0
- typed_aster-0.1.0/src/typed_aster/core/endpoint/stream.py +72 -0
- typed_aster-0.1.0/src/typed_aster/core/endpoint/user_stream.py +68 -0
- typed_aster-0.1.0/src/typed_aster/core/endpoint/wire.py +20 -0
- typed_aster-0.1.0/src/typed_aster/core/envelope.py +102 -0
- typed_aster-0.1.0/src/typed_aster/core/exc.py +49 -0
- typed_aster-0.1.0/src/typed_aster/core/transport/__init__.py +0 -0
- typed_aster-0.1.0/src/typed_aster/core/transport/http.py +303 -0
- typed_aster-0.1.0/src/typed_aster/core/transport/jsonrpc.py +117 -0
- typed_aster-0.1.0/src/typed_aster/core/transport/ws/__init__.py +0 -0
- typed_aster-0.1.0/src/typed_aster/core/transport/ws/streams.py +131 -0
- typed_aster-0.1.0/src/typed_aster/core/transport/ws/user_stream.py +76 -0
- typed_aster-0.1.0/src/typed_aster/core/types.py +36 -0
- typed_aster-0.1.0/src/typed_aster/core/urls.py +47 -0
- typed_aster-0.1.0/src/typed_aster/futures/__init__.py +161 -0
- typed_aster-0.1.0/src/typed_aster/futures/account/__init__.py +40 -0
- typed_aster-0.1.0/src/typed_aster/futures/account/asset_exchange.py +47 -0
- typed_aster-0.1.0/src/typed_aster/futures/account/balance.py +57 -0
- typed_aster-0.1.0/src/typed_aster/futures/account/commission_rate.py +38 -0
- typed_aster-0.1.0/src/typed_aster/futures/account/income.py +241 -0
- typed_aster-0.1.0/src/typed_aster/futures/account/info.py +30 -0
- typed_aster-0.1.0/src/typed_aster/futures/account/info_with_join_margin.py +32 -0
- typed_aster-0.1.0/src/typed_aster/futures/account/leverage_brackets.py +70 -0
- typed_aster-0.1.0/src/typed_aster/futures/account/multi_assets_margin.py +38 -0
- typed_aster-0.1.0/src/typed_aster/futures/account/position_mode.py +36 -0
- typed_aster-0.1.0/src/typed_aster/futures/account/schemas.py +115 -0
- typed_aster-0.1.0/src/typed_aster/futures/account/set_leverage.py +53 -0
- typed_aster-0.1.0/src/typed_aster/futures/account/set_margin_type.py +42 -0
- typed_aster-0.1.0/src/typed_aster/futures/account/set_multi_assets_margin.py +38 -0
- typed_aster-0.1.0/src/typed_aster/futures/account/set_position_mode.py +38 -0
- typed_aster-0.1.0/src/typed_aster/futures/account/set_stp_mode.py +38 -0
- typed_aster-0.1.0/src/typed_aster/futures/account/stp_mode.py +36 -0
- typed_aster-0.1.0/src/typed_aster/futures/agents/__init__.py +14 -0
- typed_aster-0.1.0/src/typed_aster/futures/agents/approve.py +106 -0
- typed_aster-0.1.0/src/typed_aster/futures/agents/delete.py +40 -0
- typed_aster-0.1.0/src/typed_aster/futures/agents/list.py +57 -0
- typed_aster-0.1.0/src/typed_aster/futures/agents/register.py +100 -0
- typed_aster-0.1.0/src/typed_aster/futures/agents/update.py +64 -0
- typed_aster-0.1.0/src/typed_aster/futures/announcement/__init__.py +11 -0
- typed_aster-0.1.0/src/typed_aster/futures/announcement/direct.py +90 -0
- typed_aster-0.1.0/src/typed_aster/futures/announcement/direct_by_id.py +38 -0
- typed_aster-0.1.0/src/typed_aster/futures/announcement/schemas.py +33 -0
- typed_aster-0.1.0/src/typed_aster/futures/builder_users/__init__.py +26 -0
- typed_aster-0.1.0/src/typed_aster/futures/builder_users/accounts.py +161 -0
- typed_aster-0.1.0/src/typed_aster/futures/builder_users/all_orders.py +212 -0
- typed_aster-0.1.0/src/typed_aster/futures/builder_users/approved.py +132 -0
- typed_aster-0.1.0/src/typed_aster/futures/builder_users/balances.py +123 -0
- typed_aster-0.1.0/src/typed_aster/futures/builder_users/commission_rates.py +131 -0
- typed_aster-0.1.0/src/typed_aster/futures/builder_users/open_orders.py +170 -0
- typed_aster-0.1.0/src/typed_aster/futures/builder_users/position_risk.py +158 -0
- typed_aster-0.1.0/src/typed_aster/futures/builder_users/schemas.py +13 -0
- typed_aster-0.1.0/src/typed_aster/futures/builder_users/trades.py +173 -0
- typed_aster-0.1.0/src/typed_aster/futures/builders/__init__.py +13 -0
- typed_aster-0.1.0/src/typed_aster/futures/builders/approve.py +45 -0
- typed_aster-0.1.0/src/typed_aster/futures/builders/delete.py +37 -0
- typed_aster-0.1.0/src/typed_aster/futures/builders/list.py +46 -0
- typed_aster-0.1.0/src/typed_aster/futures/builders/update.py +45 -0
- typed_aster-0.1.0/src/typed_aster/futures/listen_key/__init__.py +12 -0
- typed_aster-0.1.0/src/typed_aster/futures/listen_key/close.py +33 -0
- typed_aster-0.1.0/src/typed_aster/futures/listen_key/keepalive.py +33 -0
- typed_aster-0.1.0/src/typed_aster/futures/listen_key/start.py +36 -0
- typed_aster-0.1.0/src/typed_aster/futures/market/__init__.py +50 -0
- typed_aster-0.1.0/src/typed_aster/futures/market/agg_trades.py +168 -0
- typed_aster-0.1.0/src/typed_aster/futures/market/asset_logos.py +41 -0
- typed_aster-0.1.0/src/typed_aster/futures/market/book_ticker.py +44 -0
- typed_aster-0.1.0/src/typed_aster/futures/market/depth.py +61 -0
- typed_aster-0.1.0/src/typed_aster/futures/market/exchange_info.py +206 -0
- typed_aster-0.1.0/src/typed_aster/futures/market/funding_info.py +62 -0
- typed_aster-0.1.0/src/typed_aster/futures/market/funding_rate.py +168 -0
- typed_aster-0.1.0/src/typed_aster/futures/market/historical_trades.py +121 -0
- typed_aster-0.1.0/src/typed_aster/futures/market/index_price_klines.py +327 -0
- typed_aster-0.1.0/src/typed_aster/futures/market/index_references.py +61 -0
- typed_aster-0.1.0/src/typed_aster/futures/market/klines.py +327 -0
- typed_aster-0.1.0/src/typed_aster/futures/market/mark_price_klines.py +327 -0
- typed_aster-0.1.0/src/typed_aster/futures/market/market_klines.py +327 -0
- typed_aster-0.1.0/src/typed_aster/futures/market/ping.py +33 -0
- typed_aster-0.1.0/src/typed_aster/futures/market/premium_index.py +44 -0
- typed_aster-0.1.0/src/typed_aster/futures/market/remaining_openable_notional_value.py +49 -0
- typed_aster-0.1.0/src/typed_aster/futures/market/schemas.py +111 -0
- typed_aster-0.1.0/src/typed_aster/futures/market/ticker_24hr.py +44 -0
- typed_aster-0.1.0/src/typed_aster/futures/market/ticker_price.py +44 -0
- typed_aster-0.1.0/src/typed_aster/futures/market/time.py +37 -0
- typed_aster-0.1.0/src/typed_aster/futures/market/trades.py +48 -0
- typed_aster-0.1.0/src/typed_aster/futures/mmp/__init__.py +13 -0
- typed_aster-0.1.0/src/typed_aster/futures/mmp/delete.py +37 -0
- typed_aster-0.1.0/src/typed_aster/futures/mmp/get.py +59 -0
- typed_aster-0.1.0/src/typed_aster/futures/mmp/reset.py +37 -0
- typed_aster-0.1.0/src/typed_aster/futures/mmp/set.py +73 -0
- typed_aster-0.1.0/src/typed_aster/futures/position/__init__.py +13 -0
- typed_aster-0.1.0/src/typed_aster/futures/position/adl_quantile.py +48 -0
- typed_aster-0.1.0/src/typed_aster/futures/position/margin_history.py +193 -0
- typed_aster-0.1.0/src/typed_aster/futures/position/risk.py +80 -0
- typed_aster-0.1.0/src/typed_aster/futures/position/schemas.py +25 -0
- typed_aster-0.1.0/src/typed_aster/futures/position/set_margin.py +72 -0
- typed_aster-0.1.0/src/typed_aster/futures/strategy/__init__.py +13 -0
- typed_aster-0.1.0/src/typed_aster/futures/strategy/history.py +67 -0
- typed_aster-0.1.0/src/typed_aster/futures/strategy/open_orders.py +54 -0
- typed_aster-0.1.0/src/typed_aster/futures/strategy/place.py +428 -0
- typed_aster-0.1.0/src/typed_aster/futures/strategy/schemas.py +100 -0
- typed_aster-0.1.0/src/typed_aster/futures/strategy/update.py +122 -0
- typed_aster-0.1.0/src/typed_aster/futures/streams/__init__.py +48 -0
- typed_aster-0.1.0/src/typed_aster/futures/streams/agg_trade.py +56 -0
- typed_aster-0.1.0/src/typed_aster/futures/streams/all_book_tickers.py +28 -0
- typed_aster-0.1.0/src/typed_aster/futures/streams/all_force_orders.py +28 -0
- typed_aster-0.1.0/src/typed_aster/futures/streams/all_mark_price.py +31 -0
- typed_aster-0.1.0/src/typed_aster/futures/streams/all_mark_price_1s.py +31 -0
- typed_aster-0.1.0/src/typed_aster/futures/streams/all_mini_tickers.py +31 -0
- typed_aster-0.1.0/src/typed_aster/futures/streams/all_tickers.py +31 -0
- typed_aster-0.1.0/src/typed_aster/futures/streams/book_ticker.py +30 -0
- typed_aster-0.1.0/src/typed_aster/futures/streams/diff_depth.py +30 -0
- typed_aster-0.1.0/src/typed_aster/futures/streams/diff_depth_speed.py +32 -0
- typed_aster-0.1.0/src/typed_aster/futures/streams/force_order.py +30 -0
- typed_aster-0.1.0/src/typed_aster/futures/streams/kline.py +116 -0
- typed_aster-0.1.0/src/typed_aster/futures/streams/mark_price.py +30 -0
- typed_aster-0.1.0/src/typed_aster/futures/streams/mark_price_1s.py +30 -0
- typed_aster-0.1.0/src/typed_aster/futures/streams/mini_ticker.py +30 -0
- typed_aster-0.1.0/src/typed_aster/futures/streams/partial_depth.py +32 -0
- typed_aster-0.1.0/src/typed_aster/futures/streams/partial_depth_speed.py +34 -0
- typed_aster-0.1.0/src/typed_aster/futures/streams/schemas.py +95 -0
- typed_aster-0.1.0/src/typed_aster/futures/streams/ticker.py +30 -0
- typed_aster-0.1.0/src/typed_aster/futures/streams/trade_pro.py +30 -0
- typed_aster-0.1.0/src/typed_aster/futures/sub_accounts/__init__.py +14 -0
- typed_aster-0.1.0/src/typed_aster/futures/sub_accounts/bind.py +57 -0
- typed_aster-0.1.0/src/typed_aster/futures/sub_accounts/create.py +64 -0
- typed_aster-0.1.0/src/typed_aster/futures/sub_accounts/list.py +58 -0
- typed_aster-0.1.0/src/typed_aster/futures/sub_accounts/transfer.py +77 -0
- typed_aster-0.1.0/src/typed_aster/futures/sub_accounts/update.py +66 -0
- typed_aster-0.1.0/src/typed_aster/futures/trade/__init__.py +48 -0
- typed_aster-0.1.0/src/typed_aster/futures/trade/all_orders.py +143 -0
- typed_aster-0.1.0/src/typed_aster/futures/trade/cancel_all_open_orders.py +40 -0
- typed_aster-0.1.0/src/typed_aster/futures/trade/cancel_batch_orders.py +58 -0
- typed_aster-0.1.0/src/typed_aster/futures/trade/cancel_order.py +54 -0
- typed_aster-0.1.0/src/typed_aster/futures/trade/chase_order.py +147 -0
- typed_aster-0.1.0/src/typed_aster/futures/trade/countdown_cancel_all.py +52 -0
- typed_aster-0.1.0/src/typed_aster/futures/trade/force_orders.py +174 -0
- typed_aster-0.1.0/src/typed_aster/futures/trade/guarded_cancel_batch_orders.py +64 -0
- typed_aster-0.1.0/src/typed_aster/futures/trade/guarded_cancel_order.py +58 -0
- typed_aster-0.1.0/src/typed_aster/futures/trade/modify_batch_orders.py +75 -0
- typed_aster-0.1.0/src/typed_aster/futures/trade/modify_order.py +67 -0
- typed_aster-0.1.0/src/typed_aster/futures/trade/noop.py +43 -0
- typed_aster-0.1.0/src/typed_aster/futures/trade/open_order.py +54 -0
- typed_aster-0.1.0/src/typed_aster/futures/trade/open_orders.py +46 -0
- typed_aster-0.1.0/src/typed_aster/futures/trade/order.py +54 -0
- typed_aster-0.1.0/src/typed_aster/futures/trade/place_batch_orders.py +199 -0
- typed_aster-0.1.0/src/typed_aster/futures/trade/place_order.py +258 -0
- typed_aster-0.1.0/src/typed_aster/futures/trade/schemas.py +96 -0
- typed_aster-0.1.0/src/typed_aster/futures/trade/test_order.py +290 -0
- typed_aster-0.1.0/src/typed_aster/futures/trade/user_trades.py +187 -0
- typed_aster-0.1.0/src/typed_aster/futures/user_stream/__init__.py +10 -0
- typed_aster-0.1.0/src/typed_aster/futures/user_stream/events.py +299 -0
- typed_aster-0.1.0/src/typed_aster/futures/user_stream/schemas.py +26 -0
- typed_aster-0.1.0/src/typed_aster/futures/wallet/__init__.py +24 -0
- typed_aster-0.1.0/src/typed_aster/futures/wallet/deposit_withdraw_history.py +57 -0
- typed_aster-0.1.0/src/typed_aster/futures/wallet/migrate.py +39 -0
- typed_aster-0.1.0/src/typed_aster/futures/wallet/migrate_history.py +84 -0
- typed_aster-0.1.0/src/typed_aster/futures/wallet/solana_withdraw.py +55 -0
- typed_aster-0.1.0/src/typed_aster/futures/wallet/transfer.py +53 -0
- typed_aster-0.1.0/src/typed_aster/futures/wallet/withdraw.py +55 -0
- typed_aster-0.1.0/src/typed_aster/futures/wallet/withdraw_info.py +75 -0
- typed_aster-0.1.0/src/typed_aster/main.py +51 -0
- typed_aster-0.1.0/src/typed_aster/prediction/__init__.py +101 -0
- typed_aster-0.1.0/src/typed_aster/prediction/account/__init__.py +12 -0
- typed_aster-0.1.0/src/typed_aster/prediction/account/commission_rate.py +53 -0
- typed_aster-0.1.0/src/typed_aster/prediction/account/info.py +30 -0
- typed_aster-0.1.0/src/typed_aster/prediction/account/transaction_history.py +120 -0
- typed_aster-0.1.0/src/typed_aster/prediction/listen_key/__init__.py +12 -0
- typed_aster-0.1.0/src/typed_aster/prediction/listen_key/close.py +46 -0
- typed_aster-0.1.0/src/typed_aster/prediction/listen_key/keepalive.py +46 -0
- typed_aster-0.1.0/src/typed_aster/prediction/listen_key/start.py +36 -0
- typed_aster-0.1.0/src/typed_aster/prediction/market/__init__.py +32 -0
- typed_aster-0.1.0/src/typed_aster/prediction/market/agg_trades.py +170 -0
- typed_aster-0.1.0/src/typed_aster/prediction/market/book_ticker.py +46 -0
- typed_aster-0.1.0/src/typed_aster/prediction/market/depth.py +47 -0
- typed_aster-0.1.0/src/typed_aster/prediction/market/exchange_info.py +163 -0
- typed_aster-0.1.0/src/typed_aster/prediction/market/historical_trades.py +119 -0
- typed_aster-0.1.0/src/typed_aster/prediction/market/klines.py +281 -0
- typed_aster-0.1.0/src/typed_aster/prediction/market/ping.py +33 -0
- typed_aster-0.1.0/src/typed_aster/prediction/market/schemas.py +118 -0
- typed_aster-0.1.0/src/typed_aster/prediction/market/ticker_24hr.py +50 -0
- typed_aster-0.1.0/src/typed_aster/prediction/market/ticker_price.py +46 -0
- typed_aster-0.1.0/src/typed_aster/prediction/market/time.py +37 -0
- typed_aster-0.1.0/src/typed_aster/prediction/market/trades.py +50 -0
- typed_aster-0.1.0/src/typed_aster/prediction/outcomes/__init__.py +13 -0
- typed_aster-0.1.0/src/typed_aster/prediction/outcomes/burn.py +66 -0
- typed_aster-0.1.0/src/typed_aster/prediction/outcomes/merge.py +63 -0
- typed_aster-0.1.0/src/typed_aster/prediction/outcomes/mint.py +66 -0
- typed_aster-0.1.0/src/typed_aster/prediction/outcomes/schemas.py +14 -0
- typed_aster-0.1.0/src/typed_aster/prediction/outcomes/split.py +69 -0
- typed_aster-0.1.0/src/typed_aster/prediction/positions/__init__.py +12 -0
- typed_aster-0.1.0/src/typed_aster/prediction/positions/history.py +102 -0
- typed_aster-0.1.0/src/typed_aster/prediction/positions/list.py +80 -0
- typed_aster-0.1.0/src/typed_aster/prediction/positions/settlements.py +96 -0
- typed_aster-0.1.0/src/typed_aster/prediction/streams/__init__.py +36 -0
- typed_aster-0.1.0/src/typed_aster/prediction/streams/agg_trade.py +30 -0
- typed_aster-0.1.0/src/typed_aster/prediction/streams/all_book_tickers.py +28 -0
- typed_aster-0.1.0/src/typed_aster/prediction/streams/all_mini_tickers.py +31 -0
- typed_aster-0.1.0/src/typed_aster/prediction/streams/all_tickers.py +31 -0
- typed_aster-0.1.0/src/typed_aster/prediction/streams/book_ticker.py +30 -0
- typed_aster-0.1.0/src/typed_aster/prediction/streams/diff_depth.py +32 -0
- typed_aster-0.1.0/src/typed_aster/prediction/streams/event.py +72 -0
- typed_aster-0.1.0/src/typed_aster/prediction/streams/kline.py +48 -0
- typed_aster-0.1.0/src/typed_aster/prediction/streams/mini_ticker.py +30 -0
- typed_aster-0.1.0/src/typed_aster/prediction/streams/partial_depth.py +34 -0
- typed_aster-0.1.0/src/typed_aster/prediction/streams/ticker.py +30 -0
- typed_aster-0.1.0/src/typed_aster/prediction/streams/trade.py +30 -0
- typed_aster-0.1.0/src/typed_aster/prediction/streams/trade_pro.py +30 -0
- typed_aster-0.1.0/src/typed_aster/prediction/trade/__init__.py +28 -0
- typed_aster-0.1.0/src/typed_aster/prediction/trade/all_orders.py +145 -0
- typed_aster-0.1.0/src/typed_aster/prediction/trade/cancel_all_open_orders.py +53 -0
- typed_aster-0.1.0/src/typed_aster/prediction/trade/cancel_order.py +53 -0
- typed_aster-0.1.0/src/typed_aster/prediction/trade/noop.py +41 -0
- typed_aster-0.1.0/src/typed_aster/prediction/trade/open_order.py +53 -0
- typed_aster-0.1.0/src/typed_aster/prediction/trade/open_orders.py +46 -0
- typed_aster-0.1.0/src/typed_aster/prediction/trade/order.py +53 -0
- typed_aster-0.1.0/src/typed_aster/prediction/trade/place_order.py +92 -0
- typed_aster-0.1.0/src/typed_aster/prediction/trade/schemas.py +57 -0
- typed_aster-0.1.0/src/typed_aster/prediction/trade/user_trades.py +152 -0
- typed_aster-0.1.0/src/typed_aster/prediction/user_stream/__init__.py +10 -0
- typed_aster-0.1.0/src/typed_aster/prediction/user_stream/events.py +33 -0
- typed_aster-0.1.0/src/typed_aster/prediction/wallet/__init__.py +14 -0
- typed_aster-0.1.0/src/typed_aster/prediction/wallet/deposit_address.py +43 -0
- typed_aster-0.1.0/src/typed_aster/prediction/wallet/estimate_withdraw_fee.py +44 -0
- typed_aster-0.1.0/src/typed_aster/prediction/wallet/solana_withdraw.py +57 -0
- typed_aster-0.1.0/src/typed_aster/prediction/wallet/transfer.py +55 -0
- typed_aster-0.1.0/src/typed_aster/prediction/wallet/withdraw.py +57 -0
- typed_aster-0.1.0/src/typed_aster/py.typed +0 -0
- typed_aster-0.1.0/src/typed_aster/schemas.py +697 -0
- typed_aster-0.1.0/src/typed_aster/spot/__init__.py +91 -0
- typed_aster-0.1.0/src/typed_aster/spot/account/__init__.py +12 -0
- typed_aster-0.1.0/src/typed_aster/spot/account/commission_rate.py +40 -0
- typed_aster-0.1.0/src/typed_aster/spot/account/info.py +30 -0
- typed_aster-0.1.0/src/typed_aster/spot/account/transaction_history.py +175 -0
- typed_aster-0.1.0/src/typed_aster/spot/builders/__init__.py +13 -0
- typed_aster-0.1.0/src/typed_aster/spot/builders/approve.py +57 -0
- typed_aster-0.1.0/src/typed_aster/spot/builders/delete.py +46 -0
- typed_aster-0.1.0/src/typed_aster/spot/builders/list.py +45 -0
- typed_aster-0.1.0/src/typed_aster/spot/builders/update.py +51 -0
- typed_aster-0.1.0/src/typed_aster/spot/listen_key/__init__.py +12 -0
- typed_aster-0.1.0/src/typed_aster/spot/listen_key/close.py +46 -0
- typed_aster-0.1.0/src/typed_aster/spot/listen_key/keepalive.py +46 -0
- typed_aster-0.1.0/src/typed_aster/spot/listen_key/start.py +36 -0
- typed_aster-0.1.0/src/typed_aster/spot/market/__init__.py +34 -0
- typed_aster-0.1.0/src/typed_aster/spot/market/agg_trades.py +170 -0
- typed_aster-0.1.0/src/typed_aster/spot/market/book_ticker.py +46 -0
- typed_aster-0.1.0/src/typed_aster/spot/market/depth.py +47 -0
- typed_aster-0.1.0/src/typed_aster/spot/market/exchange_info.py +115 -0
- typed_aster-0.1.0/src/typed_aster/spot/market/historical_trades.py +119 -0
- typed_aster-0.1.0/src/typed_aster/spot/market/klines.py +329 -0
- typed_aster-0.1.0/src/typed_aster/spot/market/ping.py +33 -0
- typed_aster-0.1.0/src/typed_aster/spot/market/schemas.py +136 -0
- typed_aster-0.1.0/src/typed_aster/spot/market/ticker_24hr.py +46 -0
- typed_aster-0.1.0/src/typed_aster/spot/market/ticker_24hr_opt.py +46 -0
- typed_aster-0.1.0/src/typed_aster/spot/market/ticker_price.py +46 -0
- typed_aster-0.1.0/src/typed_aster/spot/market/time.py +37 -0
- typed_aster-0.1.0/src/typed_aster/spot/market/trades.py +50 -0
- typed_aster-0.1.0/src/typed_aster/spot/streams/__init__.py +34 -0
- typed_aster-0.1.0/src/typed_aster/spot/streams/agg_trade.py +30 -0
- typed_aster-0.1.0/src/typed_aster/spot/streams/all_book_tickers.py +28 -0
- typed_aster-0.1.0/src/typed_aster/spot/streams/all_mini_tickers.py +31 -0
- typed_aster-0.1.0/src/typed_aster/spot/streams/all_tickers.py +31 -0
- typed_aster-0.1.0/src/typed_aster/spot/streams/book_ticker.py +30 -0
- typed_aster-0.1.0/src/typed_aster/spot/streams/diff_depth.py +32 -0
- typed_aster-0.1.0/src/typed_aster/spot/streams/kline.py +48 -0
- typed_aster-0.1.0/src/typed_aster/spot/streams/mini_ticker.py +30 -0
- typed_aster-0.1.0/src/typed_aster/spot/streams/partial_depth.py +34 -0
- typed_aster-0.1.0/src/typed_aster/spot/streams/ticker.py +30 -0
- typed_aster-0.1.0/src/typed_aster/spot/streams/trade.py +30 -0
- typed_aster-0.1.0/src/typed_aster/spot/streams/trade_pro.py +30 -0
- typed_aster-0.1.0/src/typed_aster/spot/trade/__init__.py +32 -0
- typed_aster-0.1.0/src/typed_aster/spot/trade/all_orders.py +143 -0
- typed_aster-0.1.0/src/typed_aster/spot/trade/cancel_all_open_orders.py +53 -0
- typed_aster-0.1.0/src/typed_aster/spot/trade/cancel_batch_orders.py +99 -0
- typed_aster-0.1.0/src/typed_aster/spot/trade/cancel_order.py +53 -0
- typed_aster-0.1.0/src/typed_aster/spot/trade/noop.py +41 -0
- typed_aster-0.1.0/src/typed_aster/spot/trade/open_order.py +53 -0
- typed_aster-0.1.0/src/typed_aster/spot/trade/open_orders.py +46 -0
- typed_aster-0.1.0/src/typed_aster/spot/trade/order.py +53 -0
- typed_aster-0.1.0/src/typed_aster/spot/trade/place_batch_orders.py +161 -0
- typed_aster-0.1.0/src/typed_aster/spot/trade/place_order.py +164 -0
- typed_aster-0.1.0/src/typed_aster/spot/trade/schemas.py +57 -0
- typed_aster-0.1.0/src/typed_aster/spot/trade/user_trades.py +152 -0
- typed_aster-0.1.0/src/typed_aster/spot/user_stream/__init__.py +10 -0
- typed_aster-0.1.0/src/typed_aster/spot/user_stream/events.py +33 -0
- typed_aster-0.1.0/src/typed_aster/spot/wallet/__init__.py +14 -0
- typed_aster-0.1.0/src/typed_aster/spot/wallet/deposit_address.py +43 -0
- typed_aster-0.1.0/src/typed_aster/spot/wallet/estimate_withdraw_fee.py +44 -0
- typed_aster-0.1.0/src/typed_aster/spot/wallet/solana_withdraw.py +57 -0
- typed_aster-0.1.0/src/typed_aster/spot/wallet/transfer.py +55 -0
- typed_aster-0.1.0/src/typed_aster/spot/wallet/withdraw.py +57 -0
- typed_aster-0.1.0/src/typed_aster.egg-info/PKG-INFO +116 -0
- typed_aster-0.1.0/src/typed_aster.egg-info/SOURCES.txt +339 -0
- typed_aster-0.1.0/src/typed_aster.egg-info/dependency_links.txt +1 -0
- typed_aster-0.1.0/src/typed_aster.egg-info/requires.txt +3 -0
- typed_aster-0.1.0/src/typed_aster.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Tribulnation Labs
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: typed-aster
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A fully typed, validated async client for the Aster API.
|
|
5
|
+
Author-email: Marcel Claramunt <marcel@tribulnation.com>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Repository, https://github.com/tribulnation/typed
|
|
8
|
+
Project-URL: Documentation, https://tribulnation.com/typed/aster
|
|
9
|
+
Project-URL: Website, https://tribulnation.com/typed
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
13
|
+
Classifier: Typing :: Typed
|
|
14
|
+
Requires-Python: >=3.10
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
License-File: LICENSE
|
|
17
|
+
Requires-Dist: typed-core>=0.9.0
|
|
18
|
+
Requires-Dist: lazy-loader
|
|
19
|
+
Requires-Dist: eth-account
|
|
20
|
+
Dynamic: license-file
|
|
21
|
+
|
|
22
|
+
<p align="center">
|
|
23
|
+
<a href="https://tribulnation.com/typed/aster">
|
|
24
|
+
<picture>
|
|
25
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://tribulnation.com/media/lockups/aster-dark.svg">
|
|
26
|
+
<source media="(prefers-color-scheme: light)" srcset="https://tribulnation.com/media/lockups/aster-light.svg">
|
|
27
|
+
<img alt="Typed Aster" src="https://tribulnation.com/media/lockups/aster-light.svg" width="520">
|
|
28
|
+
</picture>
|
|
29
|
+
</a>
|
|
30
|
+
</p>
|
|
31
|
+
|
|
32
|
+
<p align="center">
|
|
33
|
+
<em>A fully typed, validated async client for the Aster API.</em>
|
|
34
|
+
</p>
|
|
35
|
+
|
|
36
|
+
<p align="center">
|
|
37
|
+
<a href="https://pypi.org/project/typed-aster/">
|
|
38
|
+
<img src="https://img.shields.io/pypi/v/typed-aster.svg" alt="PyPI version">
|
|
39
|
+
</a>
|
|
40
|
+
<a href="https://pypi.org/project/typed-aster/">
|
|
41
|
+
<img src="https://img.shields.io/pypi/pyversions/typed-aster.svg" alt="Python versions">
|
|
42
|
+
</a>
|
|
43
|
+
<a href="https://tribulnation.com/typed/aster">
|
|
44
|
+
<img src="https://img.shields.io/badge/docs-live-black" alt="Docs">
|
|
45
|
+
</a>
|
|
46
|
+
<a href="LICENSE">
|
|
47
|
+
<img src="https://img.shields.io/pypi/l/typed-aster.svg" alt="License">
|
|
48
|
+
</a>
|
|
49
|
+
</p>
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
- **Documentation**: [https://tribulnation.com/typed/aster](https://tribulnation.com/typed/aster)
|
|
54
|
+
- **Source Code**: [https://github.com/tribulnation/typed/tree/main/packages/aster](https://github.com/tribulnation/typed/tree/main/packages/aster)
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
```python
|
|
59
|
+
from typed_aster import Aster
|
|
60
|
+
|
|
61
|
+
async with Aster.new(public=True) as client:
|
|
62
|
+
book = await client.futures.market.depth('BTCUSDT', limit=5)
|
|
63
|
+
print(book['bids'][0])
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
One `Aster` client covers four surfaces:
|
|
67
|
+
|
|
68
|
+
- `client.futures`: perpetual futures
|
|
69
|
+
- `client.spot`: spot trading
|
|
70
|
+
- `client.prediction`: prediction markets
|
|
71
|
+
- `client.chain`: Aster Chain (staking, transfers, withdrawals, and on-chain reads by address)
|
|
72
|
+
|
|
73
|
+
Public market data needs no credentials. Everything signed uses Aster's Pro API wallets. See
|
|
74
|
+
[Authenticated Setup](https://tribulnation.com/typed/aster/authenticated-setup).
|
|
75
|
+
|
|
76
|
+
## Why Typed Aster?
|
|
77
|
+
|
|
78
|
+
- **🎯 Precise Types**: Typed order unions and `datetime` timestamps across futures, spot, prediction and Aster Chain, not `dict`/`Any`. Prices and quantities Aster sends as strings are `Decimal`; the few amounts it sends as JSON numbers (Aster Chain balances such as `walletBalance`, withdrawal fee estimates, fee caps) are `float`.
|
|
79
|
+
- **✅ Runtime Validation**: Every REST, JSON-RPC and WebSocket response is validated by default, not just typed on paper.
|
|
80
|
+
- **⚡ Async First**: Async HTTP plus WebSocket market and user-data streams, built for concurrent workflows.
|
|
81
|
+
- **📚 Full Surface**: Every documented Pro API endpoint, including strategy orders, sub-accounts, builders, prediction outcomes and staking.
|
|
82
|
+
|
|
83
|
+
## Installation
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
pip install typed-aster
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## How To
|
|
90
|
+
|
|
91
|
+
- [Fetch Market Data](https://tribulnation.com/typed/aster/how-to/fetch-market-data)
|
|
92
|
+
- [Fetch Account Data](https://tribulnation.com/typed/aster/how-to/fetch-account-data)
|
|
93
|
+
- [Place & Manage Orders](https://tribulnation.com/typed/aster/how-to/place-and-manage-orders)
|
|
94
|
+
- [Paginate Through Results](https://tribulnation.com/typed/aster/how-to/paginate-through-results)
|
|
95
|
+
- [Listen To Live Streams](https://tribulnation.com/typed/aster/how-to/listen-to-live-streams)
|
|
96
|
+
- [Trade Prediction Markets](https://tribulnation.com/typed/aster/how-to/trade-prediction-markets)
|
|
97
|
+
- [Stake ASTER](https://tribulnation.com/typed/aster/how-to/stake-aster)
|
|
98
|
+
- [Manage Deposits & Withdrawals](https://tribulnation.com/typed/aster/how-to/manage-deposits-withdrawals)
|
|
99
|
+
|
|
100
|
+
## Reference
|
|
101
|
+
|
|
102
|
+
- [Authenticated Setup](https://tribulnation.com/typed/aster/authenticated-setup)
|
|
103
|
+
- [Async Usage](https://tribulnation.com/typed/aster/reference/async-usage)
|
|
104
|
+
- [Error Handling](https://tribulnation.com/typed/aster/reference/error-handling)
|
|
105
|
+
- [Environment Variables](https://tribulnation.com/typed/aster/reference/env-vars)
|
|
106
|
+
- [Timestamps](https://tribulnation.com/typed/aster/reference/timestamps)
|
|
107
|
+
|
|
108
|
+
## Design Philosophy
|
|
109
|
+
|
|
110
|
+
Typed Aster follows the principles outlined in [this blog post](https://tribulnation.com/blog/clients).
|
|
111
|
+
|
|
112
|
+
*Details matter. Developer experience matters.*
|
|
113
|
+
|
|
114
|
+
## License
|
|
115
|
+
|
|
116
|
+
MIT — see [LICENSE](LICENSE).
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://tribulnation.com/typed/aster">
|
|
3
|
+
<picture>
|
|
4
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://tribulnation.com/media/lockups/aster-dark.svg">
|
|
5
|
+
<source media="(prefers-color-scheme: light)" srcset="https://tribulnation.com/media/lockups/aster-light.svg">
|
|
6
|
+
<img alt="Typed Aster" src="https://tribulnation.com/media/lockups/aster-light.svg" width="520">
|
|
7
|
+
</picture>
|
|
8
|
+
</a>
|
|
9
|
+
</p>
|
|
10
|
+
|
|
11
|
+
<p align="center">
|
|
12
|
+
<em>A fully typed, validated async client for the Aster API.</em>
|
|
13
|
+
</p>
|
|
14
|
+
|
|
15
|
+
<p align="center">
|
|
16
|
+
<a href="https://pypi.org/project/typed-aster/">
|
|
17
|
+
<img src="https://img.shields.io/pypi/v/typed-aster.svg" alt="PyPI version">
|
|
18
|
+
</a>
|
|
19
|
+
<a href="https://pypi.org/project/typed-aster/">
|
|
20
|
+
<img src="https://img.shields.io/pypi/pyversions/typed-aster.svg" alt="Python versions">
|
|
21
|
+
</a>
|
|
22
|
+
<a href="https://tribulnation.com/typed/aster">
|
|
23
|
+
<img src="https://img.shields.io/badge/docs-live-black" alt="Docs">
|
|
24
|
+
</a>
|
|
25
|
+
<a href="LICENSE">
|
|
26
|
+
<img src="https://img.shields.io/pypi/l/typed-aster.svg" alt="License">
|
|
27
|
+
</a>
|
|
28
|
+
</p>
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
- **Documentation**: [https://tribulnation.com/typed/aster](https://tribulnation.com/typed/aster)
|
|
33
|
+
- **Source Code**: [https://github.com/tribulnation/typed/tree/main/packages/aster](https://github.com/tribulnation/typed/tree/main/packages/aster)
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
```python
|
|
38
|
+
from typed_aster import Aster
|
|
39
|
+
|
|
40
|
+
async with Aster.new(public=True) as client:
|
|
41
|
+
book = await client.futures.market.depth('BTCUSDT', limit=5)
|
|
42
|
+
print(book['bids'][0])
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
One `Aster` client covers four surfaces:
|
|
46
|
+
|
|
47
|
+
- `client.futures`: perpetual futures
|
|
48
|
+
- `client.spot`: spot trading
|
|
49
|
+
- `client.prediction`: prediction markets
|
|
50
|
+
- `client.chain`: Aster Chain (staking, transfers, withdrawals, and on-chain reads by address)
|
|
51
|
+
|
|
52
|
+
Public market data needs no credentials. Everything signed uses Aster's Pro API wallets. See
|
|
53
|
+
[Authenticated Setup](https://tribulnation.com/typed/aster/authenticated-setup).
|
|
54
|
+
|
|
55
|
+
## Why Typed Aster?
|
|
56
|
+
|
|
57
|
+
- **🎯 Precise Types**: Typed order unions and `datetime` timestamps across futures, spot, prediction and Aster Chain, not `dict`/`Any`. Prices and quantities Aster sends as strings are `Decimal`; the few amounts it sends as JSON numbers (Aster Chain balances such as `walletBalance`, withdrawal fee estimates, fee caps) are `float`.
|
|
58
|
+
- **✅ Runtime Validation**: Every REST, JSON-RPC and WebSocket response is validated by default, not just typed on paper.
|
|
59
|
+
- **⚡ Async First**: Async HTTP plus WebSocket market and user-data streams, built for concurrent workflows.
|
|
60
|
+
- **📚 Full Surface**: Every documented Pro API endpoint, including strategy orders, sub-accounts, builders, prediction outcomes and staking.
|
|
61
|
+
|
|
62
|
+
## Installation
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
pip install typed-aster
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## How To
|
|
69
|
+
|
|
70
|
+
- [Fetch Market Data](https://tribulnation.com/typed/aster/how-to/fetch-market-data)
|
|
71
|
+
- [Fetch Account Data](https://tribulnation.com/typed/aster/how-to/fetch-account-data)
|
|
72
|
+
- [Place & Manage Orders](https://tribulnation.com/typed/aster/how-to/place-and-manage-orders)
|
|
73
|
+
- [Paginate Through Results](https://tribulnation.com/typed/aster/how-to/paginate-through-results)
|
|
74
|
+
- [Listen To Live Streams](https://tribulnation.com/typed/aster/how-to/listen-to-live-streams)
|
|
75
|
+
- [Trade Prediction Markets](https://tribulnation.com/typed/aster/how-to/trade-prediction-markets)
|
|
76
|
+
- [Stake ASTER](https://tribulnation.com/typed/aster/how-to/stake-aster)
|
|
77
|
+
- [Manage Deposits & Withdrawals](https://tribulnation.com/typed/aster/how-to/manage-deposits-withdrawals)
|
|
78
|
+
|
|
79
|
+
## Reference
|
|
80
|
+
|
|
81
|
+
- [Authenticated Setup](https://tribulnation.com/typed/aster/authenticated-setup)
|
|
82
|
+
- [Async Usage](https://tribulnation.com/typed/aster/reference/async-usage)
|
|
83
|
+
- [Error Handling](https://tribulnation.com/typed/aster/reference/error-handling)
|
|
84
|
+
- [Environment Variables](https://tribulnation.com/typed/aster/reference/env-vars)
|
|
85
|
+
- [Timestamps](https://tribulnation.com/typed/aster/reference/timestamps)
|
|
86
|
+
|
|
87
|
+
## Design Philosophy
|
|
88
|
+
|
|
89
|
+
Typed Aster follows the principles outlined in [this blog post](https://tribulnation.com/blog/clients).
|
|
90
|
+
|
|
91
|
+
*Details matter. Developer experience matters.*
|
|
92
|
+
|
|
93
|
+
## License
|
|
94
|
+
|
|
95
|
+
MIT — see [LICENSE](LICENSE).
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "typed-aster"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
authors = [
|
|
9
|
+
{name="Marcel Claramunt", email="marcel@tribulnation.com"}
|
|
10
|
+
]
|
|
11
|
+
description = "A fully typed, validated async client for the Aster API."
|
|
12
|
+
license = "MIT"
|
|
13
|
+
license-files = ["LICENSE"]
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Programming Language :: Python :: 3",
|
|
16
|
+
"Programming Language :: Python :: 3.10",
|
|
17
|
+
"Programming Language :: Python :: 3.11",
|
|
18
|
+
"Typing :: Typed",
|
|
19
|
+
]
|
|
20
|
+
dependencies = [
|
|
21
|
+
"typed-core>=0.9.0", "lazy-loader", "eth-account",
|
|
22
|
+
]
|
|
23
|
+
requires-python = ">=3.10"
|
|
24
|
+
readme = {file="README.md", content-type="text/markdown"}
|
|
25
|
+
|
|
26
|
+
[tool.setuptools.package-data]
|
|
27
|
+
"typed_aster" = ["py.typed", "*.pyi", "**/*.pyi"]
|
|
28
|
+
|
|
29
|
+
[project.urls]
|
|
30
|
+
Repository = "https://github.com/tribulnation/typed"
|
|
31
|
+
Documentation = "https://tribulnation.com/typed/aster"
|
|
32
|
+
Website = "https://tribulnation.com/typed"
|
|
@@ -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
|
+
)
|