Skip to content

Commit 951cdc1

Browse files
Merge branch 'master' into dependabot/github_actions/all-fd277942c8
2 parents 55a6c7d + df2e812 commit 951cdc1

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/kraken/futures/trade.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
from __future__ import annotations
2222

23+
import json
2324
from typing import Self
2425

2526
from kraken.base_api import FuturesClient, defined
@@ -239,7 +240,7 @@ def create_batch_order(
239240
}
240241
"""
241242
batchorder: dict = {"batchOrder": batchorder_list}
242-
params = {"json": f"{batchorder}"}
243+
params = {"json": json.dumps(batchorder)}
243244
if processBefore:
244245
params["processBefore"] = processBefore
245246

tests/futures/test_futures_trade.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,16 @@ def test_create_batch_order(futures_demo_trade: Trade) -> None:
198198
"limitPrice": 2.00,
199199
"stopPrice": 3.00,
200200
},
201+
{
202+
"order": "send",
203+
"order_tag": "3",
204+
"orderType": "post",
205+
"symbol": "PI_XBTUSD",
206+
"side": "buy",
207+
"size": 5,
208+
"limitPrice": 1.00,
209+
"reduceOnly": True,
210+
},
201211
],
202212
processBefore="3033-11-08T19:56:35.441899Z",
203213
),

0 commit comments

Comments
 (0)