agentbroker 1.0.1__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.
- agentbroker/__init__.py +78 -0
- agentbroker/client.py +696 -0
- agentbroker/exceptions.py +61 -0
- agentbroker/models.py +298 -0
- agentbroker/websocket.py +260 -0
- agentbroker-1.0.1.dist-info/METADATA +377 -0
- agentbroker-1.0.1.dist-info/RECORD +9 -0
- agentbroker-1.0.1.dist-info/WHEEL +5 -0
- agentbroker-1.0.1.dist-info/top_level.txt +1 -0
agentbroker/__init__.py
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"""
|
|
2
|
+
AgentBroker Python SDK
|
|
3
|
+
|
|
4
|
+
Programmatic access to the AgentBroker trading API.
|
|
5
|
+
|
|
6
|
+
Quick start:
|
|
7
|
+
|
|
8
|
+
from agentbroker import AgentBroker
|
|
9
|
+
|
|
10
|
+
# Register a new agent
|
|
11
|
+
agent = AgentBroker.register(name="my-bot", email="me@example.com")
|
|
12
|
+
print(agent.api_key) # save this!
|
|
13
|
+
|
|
14
|
+
# Use authenticated client
|
|
15
|
+
client = AgentBroker(api_key="your_key_here")
|
|
16
|
+
client.deposit(1000)
|
|
17
|
+
client.select_strategy("momentum")
|
|
18
|
+
order = client.place_order("BTC-USDC", "buy", "market", quantity=0.001)
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
from .client import AgentBroker, DEFAULT_BASE_URL
|
|
22
|
+
from .models import (
|
|
23
|
+
Account,
|
|
24
|
+
Agent,
|
|
25
|
+
BalanceHistory,
|
|
26
|
+
Deposit,
|
|
27
|
+
Fill,
|
|
28
|
+
Order,
|
|
29
|
+
OrderBook,
|
|
30
|
+
OrderBookLevel,
|
|
31
|
+
Price,
|
|
32
|
+
Strategy,
|
|
33
|
+
Trade,
|
|
34
|
+
Withdrawal,
|
|
35
|
+
)
|
|
36
|
+
from .exceptions import (
|
|
37
|
+
AgentBrokerError,
|
|
38
|
+
AuthenticationError,
|
|
39
|
+
InsufficientBalanceError,
|
|
40
|
+
NotFoundError,
|
|
41
|
+
RateLimitError,
|
|
42
|
+
ServerError,
|
|
43
|
+
ValidationError,
|
|
44
|
+
WebSocketError,
|
|
45
|
+
)
|
|
46
|
+
from .websocket import AgentBrokerWebSocket
|
|
47
|
+
|
|
48
|
+
__version__ = "1.0.0"
|
|
49
|
+
__author__ = "AgentBroker"
|
|
50
|
+
__all__ = [
|
|
51
|
+
# Client
|
|
52
|
+
"AgentBroker",
|
|
53
|
+
"DEFAULT_BASE_URL",
|
|
54
|
+
# WebSocket
|
|
55
|
+
"AgentBrokerWebSocket",
|
|
56
|
+
# Models
|
|
57
|
+
"Account",
|
|
58
|
+
"Agent",
|
|
59
|
+
"BalanceHistory",
|
|
60
|
+
"Deposit",
|
|
61
|
+
"Fill",
|
|
62
|
+
"Order",
|
|
63
|
+
"OrderBook",
|
|
64
|
+
"OrderBookLevel",
|
|
65
|
+
"Price",
|
|
66
|
+
"Strategy",
|
|
67
|
+
"Trade",
|
|
68
|
+
"Withdrawal",
|
|
69
|
+
# Exceptions
|
|
70
|
+
"AgentBrokerError",
|
|
71
|
+
"AuthenticationError",
|
|
72
|
+
"InsufficientBalanceError",
|
|
73
|
+
"NotFoundError",
|
|
74
|
+
"RateLimitError",
|
|
75
|
+
"ServerError",
|
|
76
|
+
"ValidationError",
|
|
77
|
+
"WebSocketError",
|
|
78
|
+
]
|