Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

cancel_conditional_order

Cancel a conditional order by ConditionalOrderRef, by AllForPair, or "all" for every conditional order.

Signature

def cancel_conditional_order(
    self,
    spec: CancelConditionalSpec,
) -> dict[str, Any]

Example

from dango.exchange import Exchange
from dango.utils.types import (
    Addr, AllForPair, ConditionalOrderRef, PairId, TriggerDirection,
)
 
exchange = Exchange(wallet, base_url, account_address=Addr("0x..."))
 
# Cancel one specific conditional order
exchange.cancel_conditional_order(
    ConditionalOrderRef(pair_id=PairId("perp/ethusd"), trigger_direction=TriggerDirection.ABOVE),
)
 
# Cancel every conditional order on one pair
exchange.cancel_conditional_order(AllForPair(pair_id=PairId("perp/ethusd")))
 
# Cancel every conditional order on every pair
exchange.cancel_conditional_order("all")

Parameters

specConditionalOrderRef | AllForPair | Literal["all"]. The cancel target.

  • ConditionalOrderRef(pair_id, trigger_direction) cancels one specific conditional order.
  • AllForPair(pair_id) cancels every conditional order on one pair.
  • "all" cancels every conditional order for this account.

Returns

dict[str, Any] — the BroadcastTxOutcome envelope.

See also