Converter
ib_interface.protobuf.converter
Convert between Protobuf messages and ib-interface dataclasses.
This module is the bridge that allows ib-interface to maintain its dataclass-based API while internally using Protobuf for communication.
Design Philosophy:
- Protobuf is used for wire protocol only
- All internal state uses ib-interface dataclasses
- User-facing API never exposes Protobuf types
ProtobufConverter
Bidirectional converter between Protobuf and dataclasses.
order_from_proto
def order_from_proto(proto: OrderProto) -> Order
Convert Protobuf Order to ib-interface Order dataclass.
order_to_proto
def order_to_proto(order: Order) -> OrderProto
Convert ib-interface Order dataclass to Protobuf Order.
contract_from_proto
def contract_from_proto(proto: ContractProto) -> Contract
Convert Protobuf Contract to ib-interface Contract dataclass.
bar_data_from_proto
def bar_data_from_proto(proto: BarProto) -> BarData
Convert Protobuf historical bar to ib-interface BarData.