"""最新财务数据命令。""" import struct from .._binary import slice_bytes, unpack_from from ..exceptions import TdxDecodeError from ..models.enums import Market from ..models.finance import FinanceInfo from .base import BaseCommand # 财务字段 struct 格式:1f + 2H + 2I + 30f _FIN_FMT = " None: self.market = market self.code = code.encode("utf-8") def build_request(self) -> bytes: header = bytes.fromhex("0c1f18760001 0b000b001000 0100".replace(" ", "")) return header + struct.pack(" FinanceInfo: pos = 2 # 跳过前2字节(记录数) market_b, code_b = unpack_from("