Skip to content

Cancel Order

Terminate an existing order using the provided order ID and related parameters, such as block validity periods and transaction options.

Method Declaration

Python
async def cancel_order(
    self,
    wallet: Wallet,
    order_id: OrderId,
    good_til_block: int = None,
    good_til_block_time: int = None,
    tx_options: Optional[TxOptions] = None,
)
Unification plan
  • Check the marketId is really needed (used in TypeScript)

Parameters

ParameterLocationTypeRequiredDescription
walletqueryWallettrueThe wallet to use for signing the transaction.
order_idqueryOrderIdtrueThe ID of the order to cancel.
good_til_blockqueryi32falseThe block number until which the order is valid. Defaults to None.
good_til_block_timequeryi32falseThe block time until which the order is valid. Defaults to None.
tx_optionsqueryTxOptionsfalseOptions for transaction to support authenticators.

Response

StatusMeaningSchema
200OKTxHashThe transaction hash.
400Bad RequestThe request was malformed or invalid.
404Not FoundThe order was not found.

Examples: Rust | Guide - Cancel an order