提交代码
This commit is contained in:
@@ -20,6 +20,21 @@ params = BalanceAllowanceParams(
|
|||||||
)
|
)
|
||||||
print(client.get_balance_allowance(params))
|
print(client.get_balance_allowance(params))
|
||||||
|
|
||||||
|
from py_clob_client.clob_types import OpenOrderParams
|
||||||
|
|
||||||
|
# 1) 查当前 API key 下全部 open orders
|
||||||
|
orders = client.get_orders() # 或 client.get_orders(OpenOrderParams())
|
||||||
|
print("open orders:", len(orders))
|
||||||
|
print(orders[:5])
|
||||||
|
|
||||||
|
# 2) 只查某个 market 的 open orders
|
||||||
|
orders_m = client.get_orders(OpenOrderParams(market="你的market_id"))
|
||||||
|
print("open orders (market):", len(orders_m))
|
||||||
|
|
||||||
|
# 3) 只查某个 asset_id 的 open orders(Yes/No token 各自一个 asset_id)
|
||||||
|
orders_a = client.get_orders(OpenOrderParams(asset_id="你的asset_id"))
|
||||||
|
print("open orders (asset):", len(orders_a))
|
||||||
|
|
||||||
|
|
||||||
# # 获取所有活跃市场
|
# # 获取所有活跃市场
|
||||||
# markets = client.get_markets()
|
# markets = client.get_markets()
|
||||||
|
|||||||
Reference in New Issue
Block a user