Skip to main content

Module cid

Module cid 

Source
Expand description

T-Bank client order id codec

PostOrderRequest.order_id is the idempotency key: “в формате UID, максимальная длина 36 символов” (orders.proto). A hyphenated UUID is exactly 36 characters, so the cid fits without loss. The same value comes back as order_request_id in PostOrderResponse, OrderState and OrderStateStream, and CancelOrder / GetOrderState accept it with ORDER_ID_TYPE_REQUEST.

Structs§

TbankCidCodec
The client order id codec of T-Bank: the cid is sent as a hyphenated UUID.

Functions§

parse_request_id
order_request_id of a broker message -> our cid, if it is one.
synthetic_cid
Stable stand-in cid for an order that was not placed by us (phone, another robot): the broker gives no order_request_id, but ReconcileReport::foreign needs a non-nil cid. Derived from the exchange order id (FNV-1a), never produced by Uuid::new_v4.