use super::super::schemas::{ToolSchema, object_schema, safe_output_schema};
use crate::internal::auth::{ORDERS_LIVE_CANCEL, ORDERS_LIVE_MODIFY, ORDERS_LIVE_SUBMIT};
pub const LIVE_ORDER_SUBMIT_TOOL: &str = "ibkr_live_order_submit";
pub const LIVE_ORDER_CANCEL_TOOL: &str = "ibkr_live_order_cancel";
pub const LIVE_ORDER_MODIFY_TOOL: &str = "ibkr_live_order_modify";
#[must_use]
pub fn live_order_submit_schema() -> ToolSchema {
ToolSchema {
name: LIVE_ORDER_SUBMIT_TOOL.to_string(),
scope: ORDERS_LIVE_SUBMIT.to_string(),
input_schema: object_schema(&[
"account_id",
"approval_id",
"preview_id",
"idempotency_key",
]),
output_schema: safe_output_schema(),
}
}
#[must_use]
pub fn live_order_cancel_schema() -> ToolSchema {
ToolSchema {
name: LIVE_ORDER_CANCEL_TOOL.to_string(),
scope: ORDERS_LIVE_CANCEL.to_string(),
input_schema: object_schema(&["account_id", "broker_order_id", "idempotency_key"]),
output_schema: safe_output_schema(),
}
}
#[must_use]
pub fn live_order_modify_schema() -> ToolSchema {
ToolSchema {
name: LIVE_ORDER_MODIFY_TOOL.to_string(),
scope: ORDERS_LIVE_MODIFY.to_string(),
input_schema: object_schema(&[
"account_id",
"broker_order_id",
"approval_id",
"preview_id",
"idempotency_key",
]),
output_schema: safe_output_schema(),
}
}