deltadefi 0.1.1__tar.gz → 0.1.3__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.
Potentially problematic release.
This version of deltadefi might be problematic. Click here for more details.
- {deltadefi-0.1.1 → deltadefi-0.1.3}/PKG-INFO +1 -1
- {deltadefi-0.1.1 → deltadefi-0.1.3}/coverage.xml +92 -80
- {deltadefi-0.1.1 → deltadefi-0.1.3}/pyproject.toml +1 -1
- {deltadefi-0.1.1 → deltadefi-0.1.3}/src/deltadefi/clients/orders.py +33 -2
- {deltadefi-0.1.1 → deltadefi-0.1.3}/src/deltadefi/clients/websocket.py +2 -4
- {deltadefi-0.1.1 → deltadefi-0.1.3}/src/deltadefi/responses/responses.py +10 -0
- {deltadefi-0.1.1 → deltadefi-0.1.3}/uv.lock +1 -1
- {deltadefi-0.1.1 → deltadefi-0.1.3}/.env.example +0 -0
- {deltadefi-0.1.1 → deltadefi-0.1.3}/.github/workflows/publish.yml +0 -0
- {deltadefi-0.1.1 → deltadefi-0.1.3}/.gitignore +0 -0
- {deltadefi-0.1.1 → deltadefi-0.1.3}/.pre-commit-config.yaml +0 -0
- {deltadefi-0.1.1 → deltadefi-0.1.3}/Makefile +0 -0
- {deltadefi-0.1.1 → deltadefi-0.1.3}/README.md +0 -0
- {deltadefi-0.1.1 → deltadefi-0.1.3}/examples/websocket_example.py +0 -0
- {deltadefi-0.1.1 → deltadefi-0.1.3}/src/deltadefi/__init__.py +0 -0
- {deltadefi-0.1.1 → deltadefi-0.1.3}/src/deltadefi/api.py +0 -0
- {deltadefi-0.1.1 → deltadefi-0.1.3}/src/deltadefi/api_resources/__init__.py +0 -0
- {deltadefi-0.1.1 → deltadefi-0.1.3}/src/deltadefi/api_resources/auth.py +0 -0
- {deltadefi-0.1.1 → deltadefi-0.1.3}/src/deltadefi/api_resources/validation.py +0 -0
- {deltadefi-0.1.1 → deltadefi-0.1.3}/src/deltadefi/clients/__init__.py +0 -0
- {deltadefi-0.1.1 → deltadefi-0.1.3}/src/deltadefi/clients/accounts.py +0 -0
- {deltadefi-0.1.1 → deltadefi-0.1.3}/src/deltadefi/clients/client.py +0 -0
- {deltadefi-0.1.1 → deltadefi-0.1.3}/src/deltadefi/clients/markets.py +0 -0
- {deltadefi-0.1.1 → deltadefi-0.1.3}/src/deltadefi/constants/__init__.py +0 -0
- {deltadefi-0.1.1 → deltadefi-0.1.3}/src/deltadefi/constants/constants.py +0 -0
- {deltadefi-0.1.1 → deltadefi-0.1.3}/src/deltadefi/error.py +0 -0
- {deltadefi-0.1.1 → deltadefi-0.1.3}/src/deltadefi/models/__init__.py +0 -0
- {deltadefi-0.1.1 → deltadefi-0.1.3}/src/deltadefi/models/models.py +0 -0
- {deltadefi-0.1.1 → deltadefi-0.1.3}/src/deltadefi/responses/__init__.py +0 -0
- {deltadefi-0.1.1 → deltadefi-0.1.3}/src/deltadefi/responses/accounts.py +0 -0
- {deltadefi-0.1.1 → deltadefi-0.1.3}/src/deltadefi/utils/__init__.py +0 -0
- {deltadefi-0.1.1 → deltadefi-0.1.3}/src/deltadefi/utils/helpers.py +0 -0
- {deltadefi-0.1.1 → deltadefi-0.1.3}/tests/__init__.py +0 -0
- {deltadefi-0.1.1 → deltadefi-0.1.3}/tests/clients/__init__.py +0 -0
- {deltadefi-0.1.1 → deltadefi-0.1.3}/tests/clients/test_accounts.py +0 -0
- {deltadefi-0.1.1 → deltadefi-0.1.3}/tests/clients/test_order.py +0 -0
- {deltadefi-0.1.1 → deltadefi-0.1.3}/tests/clients/test_sign.py +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<?xml version="1.0" ?>
|
|
2
|
-
<coverage version="7.10.6" timestamp="
|
|
2
|
+
<coverage version="7.10.6" timestamp="1760881961146" lines-valid="633" lines-covered="291" line-rate="0.4597" branches-covered="0" branches-valid="0" branch-rate="0" complexity="0">
|
|
3
3
|
<!-- Generated by coverage.py: https://coverage.readthedocs.io/en/7.10.6 -->
|
|
4
4
|
<!-- Based on https://raw.githubusercontent.com/cobertura/web/master/htdocs/xml/coverage-04.dtd -->
|
|
5
5
|
<sources>
|
|
@@ -159,7 +159,7 @@
|
|
|
159
159
|
</class>
|
|
160
160
|
</classes>
|
|
161
161
|
</package>
|
|
162
|
-
<package name="src.deltadefi.clients" line-rate="0.
|
|
162
|
+
<package name="src.deltadefi.clients" line-rate="0.2508" branch-rate="0" complexity="0">
|
|
163
163
|
<classes>
|
|
164
164
|
<class name="__init__.py" filename="src/deltadefi/clients/__init__.py" complexity="0" line-rate="1" branch-rate="0">
|
|
165
165
|
<methods/>
|
|
@@ -307,43 +307,51 @@
|
|
|
307
307
|
<line number="59" hits="0"/>
|
|
308
308
|
</lines>
|
|
309
309
|
</class>
|
|
310
|
-
<class name="orders.py" filename="src/deltadefi/clients/orders.py" complexity="0" line-rate="0.
|
|
310
|
+
<class name="orders.py" filename="src/deltadefi/clients/orders.py" complexity="0" line-rate="0.3333" branch-rate="0">
|
|
311
311
|
<methods/>
|
|
312
312
|
<lines>
|
|
313
313
|
<line number="1" hits="1"/>
|
|
314
314
|
<line number="2" hits="1"/>
|
|
315
315
|
<line number="3" hits="1"/>
|
|
316
|
-
<line number="
|
|
317
|
-
<line number="
|
|
318
|
-
<line number="16" hits="1"/>
|
|
316
|
+
<line number="10" hits="1"/>
|
|
317
|
+
<line number="13" hits="1"/>
|
|
319
318
|
<line number="18" hits="1"/>
|
|
320
|
-
<line number="
|
|
321
|
-
<line number="21" hits="
|
|
322
|
-
<line number="
|
|
323
|
-
<line number="
|
|
324
|
-
<line number="
|
|
319
|
+
<line number="20" hits="1"/>
|
|
320
|
+
<line number="21" hits="0"/>
|
|
321
|
+
<line number="23" hits="1"/>
|
|
322
|
+
<line number="45" hits="0"/>
|
|
323
|
+
<line number="54" hits="0"/>
|
|
325
324
|
<line number="55" hits="0"/>
|
|
326
|
-
<line number="
|
|
327
|
-
<line number="
|
|
328
|
-
<line number="
|
|
329
|
-
<line number="
|
|
330
|
-
<line number="71" hits="
|
|
331
|
-
<line number="
|
|
325
|
+
<line number="57" hits="0"/>
|
|
326
|
+
<line number="58" hits="0"/>
|
|
327
|
+
<line number="62" hits="0"/>
|
|
328
|
+
<line number="70" hits="0"/>
|
|
329
|
+
<line number="71" hits="0"/>
|
|
330
|
+
<line number="73" hits="1"/>
|
|
332
331
|
<line number="86" hits="0"/>
|
|
333
|
-
<line number="
|
|
334
|
-
<line number="89" hits="
|
|
332
|
+
<line number="88" hits="0"/>
|
|
333
|
+
<line number="89" hits="0"/>
|
|
334
|
+
<line number="91" hits="1"/>
|
|
335
335
|
<line number="101" hits="0"/>
|
|
336
336
|
<line number="102" hits="0"/>
|
|
337
|
-
<line number="104" hits="
|
|
338
|
-
<line number="105" hits="0"/>
|
|
339
|
-
<line number="107" hits="1"/>
|
|
340
|
-
<line number="114" hits="0"/>
|
|
341
|
-
<line number="115" hits="0"/>
|
|
337
|
+
<line number="104" hits="1"/>
|
|
342
338
|
<line number="117" hits="0"/>
|
|
343
339
|
<line number="118" hits="0"/>
|
|
340
|
+
<line number="120" hits="0"/>
|
|
341
|
+
<line number="121" hits="0"/>
|
|
342
|
+
<line number="123" hits="1"/>
|
|
343
|
+
<line number="130" hits="0"/>
|
|
344
|
+
<line number="131" hits="0"/>
|
|
345
|
+
<line number="133" hits="0"/>
|
|
346
|
+
<line number="134" hits="0"/>
|
|
347
|
+
<line number="136" hits="1"/>
|
|
348
|
+
<line number="145" hits="0"/>
|
|
349
|
+
<line number="146" hits="0"/>
|
|
350
|
+
<line number="148" hits="0"/>
|
|
351
|
+
<line number="149" hits="0"/>
|
|
344
352
|
</lines>
|
|
345
353
|
</class>
|
|
346
|
-
<class name="websocket.py" filename="src/deltadefi/clients/websocket.py" complexity="0" line-rate="0.
|
|
354
|
+
<class name="websocket.py" filename="src/deltadefi/clients/websocket.py" complexity="0" line-rate="0.1429" branch-rate="0">
|
|
347
355
|
<methods/>
|
|
348
356
|
<lines>
|
|
349
357
|
<line number="1" hits="1"/>
|
|
@@ -437,71 +445,69 @@
|
|
|
437
445
|
<line number="185" hits="0"/>
|
|
438
446
|
<line number="188" hits="0"/>
|
|
439
447
|
<line number="189" hits="0"/>
|
|
440
|
-
<line number="190" hits="0"/>
|
|
441
448
|
<line number="191" hits="0"/>
|
|
442
449
|
<line number="193" hits="0"/>
|
|
443
450
|
<line number="195" hits="0"/>
|
|
451
|
+
<line number="196" hits="0"/>
|
|
444
452
|
<line number="197" hits="0"/>
|
|
445
453
|
<line number="198" hits="0"/>
|
|
446
|
-
<line number="
|
|
447
|
-
<line number="
|
|
448
|
-
<line number="
|
|
449
|
-
<line number="
|
|
450
|
-
<line number="
|
|
454
|
+
<line number="200" hits="1"/>
|
|
455
|
+
<line number="202" hits="0"/>
|
|
456
|
+
<line number="203" hits="0"/>
|
|
457
|
+
<line number="207" hits="0"/>
|
|
458
|
+
<line number="208" hits="0"/>
|
|
451
459
|
<line number="209" hits="0"/>
|
|
452
460
|
<line number="210" hits="0"/>
|
|
453
461
|
<line number="211" hits="0"/>
|
|
454
|
-
<line number="
|
|
455
|
-
<line number="
|
|
456
|
-
<line number="
|
|
457
|
-
<line number="
|
|
458
|
-
<line number="
|
|
459
|
-
<line number="
|
|
460
|
-
<line number="
|
|
461
|
-
<line number="
|
|
462
|
-
<line number="
|
|
463
|
-
<line number="
|
|
464
|
-
<line number="
|
|
465
|
-
<line number="
|
|
466
|
-
<line number="
|
|
467
|
-
<line number="
|
|
468
|
-
<line number="
|
|
469
|
-
<line number="
|
|
470
|
-
<line number="
|
|
471
|
-
<line number="
|
|
472
|
-
<line number="
|
|
473
|
-
<line number="
|
|
474
|
-
<line number="
|
|
475
|
-
<line number="
|
|
476
|
-
<line number="
|
|
477
|
-
<line number="
|
|
478
|
-
<line number="
|
|
479
|
-
<line number="
|
|
480
|
-
<line number="
|
|
481
|
-
<line number="
|
|
482
|
-
<line number="
|
|
483
|
-
<line number="
|
|
484
|
-
<line number="
|
|
485
|
-
<line number="
|
|
486
|
-
<line number="
|
|
487
|
-
<line number="
|
|
488
|
-
<line number="
|
|
489
|
-
<line number="
|
|
490
|
-
<line number="
|
|
491
|
-
<line number="
|
|
492
|
-
<line number="
|
|
493
|
-
<line number="
|
|
494
|
-
<line number="
|
|
495
|
-
<line number="338" hits="0"/>
|
|
462
|
+
<line number="213" hits="1"/>
|
|
463
|
+
<line number="221" hits="0"/>
|
|
464
|
+
<line number="223" hits="1"/>
|
|
465
|
+
<line number="230" hits="0"/>
|
|
466
|
+
<line number="231" hits="0"/>
|
|
467
|
+
<line number="236" hits="0"/>
|
|
468
|
+
<line number="237" hits="0"/>
|
|
469
|
+
<line number="240" hits="0"/>
|
|
470
|
+
<line number="241" hits="0"/>
|
|
471
|
+
<line number="244" hits="0"/>
|
|
472
|
+
<line number="249" hits="0"/>
|
|
473
|
+
<line number="251" hits="1"/>
|
|
474
|
+
<line number="258" hits="0"/>
|
|
475
|
+
<line number="259" hits="0"/>
|
|
476
|
+
<line number="264" hits="0"/>
|
|
477
|
+
<line number="265" hits="0"/>
|
|
478
|
+
<line number="268" hits="0"/>
|
|
479
|
+
<line number="269" hits="0"/>
|
|
480
|
+
<line number="272" hits="0"/>
|
|
481
|
+
<line number="277" hits="0"/>
|
|
482
|
+
<line number="279" hits="1"/>
|
|
483
|
+
<line number="286" hits="0"/>
|
|
484
|
+
<line number="287" hits="0"/>
|
|
485
|
+
<line number="292" hits="0"/>
|
|
486
|
+
<line number="293" hits="0"/>
|
|
487
|
+
<line number="296" hits="0"/>
|
|
488
|
+
<line number="297" hits="0"/>
|
|
489
|
+
<line number="300" hits="0"/>
|
|
490
|
+
<line number="305" hits="0"/>
|
|
491
|
+
<line number="307" hits="1"/>
|
|
492
|
+
<line number="312" hits="0"/>
|
|
493
|
+
<line number="313" hits="0"/>
|
|
494
|
+
<line number="318" hits="0"/>
|
|
495
|
+
<line number="319" hits="0"/>
|
|
496
|
+
<line number="322" hits="0"/>
|
|
497
|
+
<line number="323" hits="0"/>
|
|
498
|
+
<line number="326" hits="0"/>
|
|
499
|
+
<line number="327" hits="0"/>
|
|
500
|
+
<line number="329" hits="1"/>
|
|
501
|
+
<line number="336" hits="0"/>
|
|
502
|
+
<line number="337" hits="0"/>
|
|
496
503
|
<line number="339" hits="0"/>
|
|
497
|
-
<line number="
|
|
498
|
-
<line number="
|
|
504
|
+
<line number="340" hits="0"/>
|
|
505
|
+
<line number="346" hits="0"/>
|
|
506
|
+
<line number="347" hits="0"/>
|
|
499
507
|
<line number="348" hits="0"/>
|
|
500
|
-
<line number="
|
|
501
|
-
<line number="
|
|
502
|
-
<line number="
|
|
503
|
-
<line number="354" hits="0"/>
|
|
504
|
-
<line number="355" hits="0"/>
|
|
508
|
+
<line number="350" hits="1"/>
|
|
509
|
+
<line number="352" hits="0"/>
|
|
510
|
+
<line number="353" hits="0"/>
|
|
505
511
|
</lines>
|
|
506
512
|
</class>
|
|
507
513
|
</classes>
|
|
@@ -719,6 +725,12 @@
|
|
|
719
725
|
<line number="61" hits="1"/>
|
|
720
726
|
<line number="62" hits="1"/>
|
|
721
727
|
<line number="63" hits="1"/>
|
|
728
|
+
<line number="66" hits="1"/>
|
|
729
|
+
<line number="67" hits="1"/>
|
|
730
|
+
<line number="68" hits="1"/>
|
|
731
|
+
<line number="71" hits="1"/>
|
|
732
|
+
<line number="72" hits="1"/>
|
|
733
|
+
<line number="73" hits="1"/>
|
|
722
734
|
</lines>
|
|
723
735
|
</class>
|
|
724
736
|
</classes>
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
from deltadefi.api import API
|
|
2
2
|
from deltadefi.models.models import OrderSide, OrderType
|
|
3
3
|
from deltadefi.responses import (
|
|
4
|
+
BuildCancelAllOrdersTransactionResponse,
|
|
4
5
|
BuildCancelOrderTransactionResponse,
|
|
5
6
|
BuildPlaceOrderTransactionResponse,
|
|
7
|
+
SubmitCancelAllOrdersTransactionResponse,
|
|
6
8
|
SubmitPlaceOrderTransactionResponse,
|
|
7
9
|
)
|
|
8
10
|
from deltadefi.utils import check_required_parameter, check_required_parameters
|
|
@@ -86,6 +88,19 @@ class Order(API):
|
|
|
86
88
|
url_path = f"/{order_id}/build"
|
|
87
89
|
return self.send_request("DELETE", self.group_url_path + url_path, **kwargs)
|
|
88
90
|
|
|
91
|
+
def build_cancel_all_orders_transaction(
|
|
92
|
+
self, **kwargs
|
|
93
|
+
) -> BuildCancelAllOrdersTransactionResponse:
|
|
94
|
+
"""
|
|
95
|
+
Build a cancel all orders transaction.
|
|
96
|
+
|
|
97
|
+
Returns:
|
|
98
|
+
A BuildCancelAllOrdersTransactionResponse object containing the built cancel all orders transaction.
|
|
99
|
+
"""
|
|
100
|
+
|
|
101
|
+
url_path = "/cancel-all/build"
|
|
102
|
+
return self.send_request("DELETE", self.group_url_path + url_path, **kwargs)
|
|
103
|
+
|
|
89
104
|
def submit_place_order_transaction(
|
|
90
105
|
self, order_id: str, signed_tx: str, **kwargs
|
|
91
106
|
) -> SubmitPlaceOrderTransactionResponse:
|
|
@@ -93,7 +108,8 @@ class Order(API):
|
|
|
93
108
|
Submit a place order transaction.
|
|
94
109
|
|
|
95
110
|
Args:
|
|
96
|
-
|
|
111
|
+
order_id: The ID of the order to be placed.
|
|
112
|
+
signed_tx: The signed transaction hex string for placing the order.
|
|
97
113
|
|
|
98
114
|
Returns:
|
|
99
115
|
A SubmitPlaceOrderTransactionResponse object containing the submitted order transaction.
|
|
@@ -109,10 +125,25 @@ class Order(API):
|
|
|
109
125
|
Submit a cancel order transaction.
|
|
110
126
|
|
|
111
127
|
Args:
|
|
112
|
-
|
|
128
|
+
signed_tx: The signed transaction hex string for canceling the order.
|
|
113
129
|
"""
|
|
114
130
|
check_required_parameter(signed_tx, "signed_tx")
|
|
115
131
|
payload = {"signed_tx": signed_tx, **kwargs}
|
|
116
132
|
|
|
117
133
|
path_url = "/submit"
|
|
118
134
|
return self.send_request("DELETE", self.group_url_path + path_url, payload)
|
|
135
|
+
|
|
136
|
+
def submit_cancel_all_orders_transaction(
|
|
137
|
+
self, signed_txs: list[str], **kwargs
|
|
138
|
+
) -> SubmitCancelAllOrdersTransactionResponse:
|
|
139
|
+
"""
|
|
140
|
+
Submit a cancel all orders transaction.
|
|
141
|
+
|
|
142
|
+
Args:
|
|
143
|
+
signed_txs: A list of signed transaction hex strings for canceling all orders.
|
|
144
|
+
"""
|
|
145
|
+
check_required_parameter(signed_txs, "signed_txs")
|
|
146
|
+
payload = {"signed_txs": signed_txs, **kwargs}
|
|
147
|
+
|
|
148
|
+
path_url = "/cancel-all/submit"
|
|
149
|
+
return self.send_request("DELETE", self.group_url_path + path_url, payload)
|
|
@@ -187,10 +187,8 @@ class WebSocketClient:
|
|
|
187
187
|
# In a more complex implementation, you'd want to handle multiple concurrent subscriptions
|
|
188
188
|
if self.subscriptions:
|
|
189
189
|
first_sub = next(iter(self.subscriptions.values()))
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
else:
|
|
193
|
-
await self.connect()
|
|
190
|
+
# Always use the stored endpoint for reconnection
|
|
191
|
+
await self.connect(first_sub["endpoint"])
|
|
194
192
|
else:
|
|
195
193
|
await self.connect()
|
|
196
194
|
|
|
@@ -61,3 +61,13 @@ class PostOrderResponse(SubmitPlaceOrderTransactionResponse):
|
|
|
61
61
|
@dataclass
|
|
62
62
|
class BuildCancelOrderTransactionResponse(TypedDict):
|
|
63
63
|
tx_hex: str
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
@dataclass
|
|
67
|
+
class BuildCancelAllOrdersTransactionResponse(TypedDict):
|
|
68
|
+
tx_hexes: list[str]
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
@dataclass
|
|
72
|
+
class SubmitCancelAllOrdersTransactionResponse(TypedDict):
|
|
73
|
+
cancelled_order_ids: list[str]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|