feat: paginate KIS balance inquiries

This commit is contained in:
Hermes Agent
2026-08-10 00:11:04 +09:00
parent 701fb06362
commit 0fa8f39be9
6 changed files with 297 additions and 37 deletions
@@ -96,15 +96,17 @@ def _serve(state: _ExchangeState):
def do_GET(self):
if self.path.startswith("/uapi/domestic-stock/v1/trading/inquire-balance"):
self._reply(state.balance())
self._reply(state.balance(), tr_cont="E")
else:
self._reply(state.daily_orders())
def _reply(self, payload):
def _reply(self, payload, *, tr_cont=None):
raw = json.dumps(payload).encode()
try:
self.send_response(200)
self.send_header("content-type", "application/json")
if tr_cont is not None:
self.send_header("tr_cont", tr_cont)
self.send_header("content-length", str(len(raw)))
self.end_headers()
self.wfile.write(raw)