cancel
Cancel one open order by its on-chain oid. The name argument is verified for parity (typos fail loudly).
Signature
def cancel(self, name: str, oid: int) -> dict[str, Any]Example
result = exchange.cancel("BTC", oid=12345)Parameters
name — str. HL coin name (e.g. "BTC"). Used only for verification — info.name_to_pair(name) runs first to surface typos before the cancel is dispatched.
oid — int. On-chain order id to cancel.
Returns
dict[str, Any] — Hyperliquid-shaped cancel envelope.
Notes
- Native cancel only needs the
oid, but verifyingnamefirst gives a clearer error if the caller passes the wrong coin.
See also
bulk_cancel— cancel multiple orders in one callcancel_order— native equivalent