deltadefi 0.0.3__py3-none-any.whl → 0.0.5__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.
Potentially problematic release.
This version of deltadefi might be problematic. Click here for more details.
deltadefi/api.py
CHANGED
|
@@ -23,13 +23,23 @@ class API(object):
|
|
|
23
23
|
if payload is None:
|
|
24
24
|
payload = {}
|
|
25
25
|
url = self.base_url + url_path
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
26
|
+
if http_method.upper() == "GET":
|
|
27
|
+
params = clean_none_value(
|
|
28
|
+
{
|
|
29
|
+
"url": url,
|
|
30
|
+
"params": self._prepare_params(payload), # Query parameters
|
|
31
|
+
"timeout": self.timeout,
|
|
32
|
+
}
|
|
33
|
+
)
|
|
34
|
+
else:
|
|
35
|
+
params = clean_none_value(
|
|
36
|
+
{
|
|
37
|
+
"url": url,
|
|
38
|
+
"json": payload, # Use 'json' to send payload in the body
|
|
39
|
+
"timeout": self.timeout,
|
|
40
|
+
}
|
|
41
|
+
)
|
|
42
|
+
|
|
33
43
|
response = self._dispatch_request(http_method)(**params)
|
|
34
44
|
self._handle_exception(response)
|
|
35
45
|
|
deltadefi/clients/order.py
CHANGED
|
@@ -25,9 +25,9 @@ class Order(API):
|
|
|
25
25
|
side: OrderSide,
|
|
26
26
|
type: OrderType,
|
|
27
27
|
quantity: int,
|
|
28
|
-
price: int,
|
|
29
|
-
max_slippage_basis_point: int,
|
|
30
|
-
limit_slippage: bool,
|
|
28
|
+
price: int = None,
|
|
29
|
+
max_slippage_basis_point: int = 10000,
|
|
30
|
+
limit_slippage: bool = False,
|
|
31
31
|
**kwargs,
|
|
32
32
|
) -> BuildPlaceOrderTransactionResponse:
|
|
33
33
|
"""
|
|
@@ -41,17 +41,20 @@ class Order(API):
|
|
|
41
41
|
"""
|
|
42
42
|
|
|
43
43
|
check_required_parameters(
|
|
44
|
-
[
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
[
|
|
45
|
+
[symbol, "symbol"],
|
|
46
|
+
[side, "side"],
|
|
47
|
+
[type, "type"],
|
|
48
|
+
[quantity, "quantity"],
|
|
49
|
+
]
|
|
47
50
|
)
|
|
48
51
|
|
|
49
52
|
if type == "limit":
|
|
50
|
-
check_required_parameter(price, "price")
|
|
53
|
+
check_required_parameter(kwargs.get("price"), "price")
|
|
51
54
|
|
|
52
|
-
if type == "market" and limit_slippage:
|
|
55
|
+
if type == "market" and kwargs.get("limit_slippage"):
|
|
53
56
|
check_required_parameter(
|
|
54
|
-
max_slippage_basis_point, "max_slippage_basis_point"
|
|
57
|
+
kwargs.get("max_slippage_basis_point"), "max_slippage_basis_point"
|
|
55
58
|
)
|
|
56
59
|
|
|
57
60
|
payload = {
|
|
@@ -59,8 +62,6 @@ class Order(API):
|
|
|
59
62
|
"side": side,
|
|
60
63
|
"type": type,
|
|
61
64
|
"quantity": quantity,
|
|
62
|
-
"max_slippage_basis_point": max_slippage_basis_point,
|
|
63
|
-
"limit_slippage": limit_slippage,
|
|
64
65
|
**kwargs,
|
|
65
66
|
}
|
|
66
67
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
deltadefi/__init__.py,sha256=_dbB-toNXZvwZxj5DnEY0nW5noDnDpF4QsJNEwGO_IA,46
|
|
2
|
-
deltadefi/api.py,sha256=
|
|
2
|
+
deltadefi/api.py,sha256=XSdOFwq9s2HFxKxiv7ljaCgUhwXVAkkq19dPSRhwlek,2720
|
|
3
3
|
deltadefi/api_resources/__init__.py,sha256=_SGHTpaQTIBvh9Rm868IT5pXpvvGBPqz3bxkY6YapZ4,61
|
|
4
4
|
deltadefi/api_resources/auth.py,sha256=Mpl4Dbh_d_gGhwLo2CtBSKxZ21DC74x-qjVhlczZCDE,278
|
|
5
5
|
deltadefi/api_resources/validation.py,sha256=vz-hovpLy9SMOIFGcBHC8vWZH8CJRlQP8rcbbTSM-PM,1375
|
|
@@ -8,7 +8,7 @@ deltadefi/clients/accounts.py,sha256=I3Yh82iHVK932u2Luvewbxk_KJ-WVLYqH048XBFgrsQ
|
|
|
8
8
|
deltadefi/clients/app.py,sha256=TOgRlP83p91r7oS4ez8Gfm8soQzFHrJAmOHZJoGZ4SM,712
|
|
9
9
|
deltadefi/clients/clients.py,sha256=Yzxkpf9-PA6LdYiJtmap1DrE3U5Sd4VNDGjexZxVbcs,2197
|
|
10
10
|
deltadefi/clients/market.py,sha256=v8hK06oXC73qS3IjvWDempHq_-9T6OW2pckIcDR7P2M,2580
|
|
11
|
-
deltadefi/clients/order.py,sha256=
|
|
11
|
+
deltadefi/clients/order.py,sha256=Cnjz1N6Fd4ezaToPVQCY-lQudwp2bO94wyuBM3dwV5c,3960
|
|
12
12
|
deltadefi/constants/__init__.py,sha256=7LkrzfLTJsCCUl5IgZYrl-AbY_cf1fftcLklgnBYDTs,40
|
|
13
13
|
deltadefi/constants/constants.py,sha256=9Ksb8_4t78KJpHVUnRArKlvgQk-CzcYsLRmA5qUnMwc,168
|
|
14
14
|
deltadefi/error.py,sha256=Pq55p7FQbVn1GTih7NQBI7ZcVUUrlkaFKn-SwZUxBA8,1650
|
|
@@ -19,6 +19,6 @@ deltadefi/models/models.py,sha256=vnNFFPMQcOOSKhONHNHXJIx4wddV4IKeBszykiqWCwk,11
|
|
|
19
19
|
deltadefi/responses/__init__.py,sha256=JKSIUQu6qI_XhbAR2mVMCKNvR6x_vFZdyLGOuQTVrVY,64
|
|
20
20
|
deltadefi/responses/accounts.py,sha256=aVQq1CqebIQz0YuNphFlA2fGBgvmf8FpboJzToEiY2g,939
|
|
21
21
|
deltadefi/responses/responses.py,sha256=etlx83GgZC2noLKo8GKrmDo3Xhwup-g8Ob29f0WYA4I,993
|
|
22
|
-
deltadefi-0.0.
|
|
23
|
-
deltadefi-0.0.
|
|
24
|
-
deltadefi-0.0.
|
|
22
|
+
deltadefi-0.0.5.dist-info/METADATA,sha256=zu4UWV9bGCyiFAZBGdWsyMrPBzHBrciTXs715vLm9t0,3081
|
|
23
|
+
deltadefi-0.0.5.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
|
|
24
|
+
deltadefi-0.0.5.dist-info/RECORD,,
|
|
File without changes
|