Repository navigation
v0.4.0
Package version: 0.4.0. Git tag: v0.4.0. Released 2026-11-02.
What a trading bot gains. An order now says why it ended, in the same
words everywhere. A rejected order's reject_reason is the error code the
Orders API returns for the same refusal, and a canceled order's
cancel_reason says why it was canceled, on order reads and on the private
order stream alike. Before, the numeric reason used the matching engine's own
numbering, which clashed with the API's error codes. OrderbookData::available
tells a bot when a book's levels are unknown rather than empty, so it does not
quote into a book that is being rebuilt. Trigger::version picks out the
newest copy of a trigger, and nine new error codes are final refusals: the
request did not apply, so do not resend it unchanged.
This release works on devnet now, and on testnet after testnet's next upgrade.
Reason labels in this SDK. Both reasons are full proto enum names.
reject_reason is the orders.v1.ErrorCode name, the same string as
Error::Api's code, for example ERROR_CODE_POST_ONLY_CROSS.
cancel_reason is the orders.v1.CancelReason name, for example
CANCEL_REASON_USER_REQUEST. The Go and Python SDKs format these labels
differently.
Breaking changes
Client::whiteboard,Client::polychartandClient::layoutare removed.- The generated
orders.v1.Orderlosesterminal_reason_codeand
terminal_reason, and the private order stream'sOrderEventloses
reason_code. Readreject_reasonandcancel_reasoninstead. OrderStreamEvent::reason_codeis replaced byreject_reasonand
cancel_reason, bothOption<String>.GetSubaccountOpts::include_balancesis removed.orderbook::build_orderbook_datatakes the book's availability as a new
last argument.
Breaking
Client::whiteboard,Client::polychartandClient::layoutare removed,
because those APIs are no longer part of the public API.- The order terminal reason fields are removed: the generated
orders.v1.Orderno longer hasterminal_reason_codeorterminal_reason,
and the private order stream'sOrderEventno longer hasreason_code.
Read the typedreject_reasonandcancel_reasoninstead, and replace any
matching onterminal_reasontext with them. OrderStreamEvent::reason_codeis replaced byreject_reasonand
cancel_reason, bothOption<String>. A rejected order's event names its
refusal with the order error code the Orders API returns (for example
ERROR_CODE_POST_ONLY_CROSS). A canceled order's event names why it ended
(for exampleCANCEL_REASON_USER_REQUEST), and so does the replaced event
of the order a replace ended (CANCEL_REASON_REPLACED). Both areNone
otherwise.GetSubaccountOpts::include_balancesis removed: a sub-account read no
longer returns balances. Read them with the balances service for the
sub-account.orderbook::build_orderbook_datatakes the book's availability as a new
last argument.
Added
Order::reject_reasonandOrder::cancel_reasonon order reads and on the
orders of the private order stream's snapshots and units. A rejected order's
reject reason is formatted likeError::Api'scodefor the same refusal;
a canceled order's cancel reason is aCancelReasonproto name. Both are
Nonefor every other status, and a value this SDK does not know keeps its
number (UNKNOWN_ERROR_CODE(<n>),UNKNOWN(<n>)).OrderbookData::available: false while the book is being built or after it
was invalidated, when its levels are unknown rather than empty. It is the
server's value as sent, never inferred from the levels; a managed order book
subscription carries the value of its last snapshot. A server that predates
the field reports false.Trigger::version: 1 for the first state, higher for every later state
change. Keep the copy with the highest version.- Order error codes
ERROR_CODE_ATTACHED_LEGS_EXCEEDED,
ERROR_CODE_FEE_ASSET_INVALID,ERROR_CODE_FEE_CEILING_INVALID,
ERROR_CODE_UNSUPPORTED_FIELD_SET,ERROR_CODE_TRIGGER_FIRE_LIMIT_REACHED,
ERROR_CODE_CONDITION_FLAGS_INVALID,ERROR_CODE_CONDITION_PARAMETER_SET,
ERROR_CODE_TWAP_CAPACITY_REACHEDandERROR_CODE_CHILD_ORDER_INCONSISTENT
surface asError::Apicodes. Their outcome is known: they are not
retryable andmutation_outcome_unknown()is false.