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

cancelConditionalOrder

Cancel one conditional order, all for a pair, or every conditional order.

Signature

function cancelConditionalOrder(
  client: Client<Signer>,
  parameters: {
    sender: Address
    request: PerpsCancelConditionalOrderRequest
  },
): Promise<{ hash: Uint8Array } & TxData>
 
type PerpsCancelConditionalOrderRequest =
  | { one: { pairId: string; triggerDirection: "above" | "below" } }
  | { allForPair: { pairId: string } }
  | "all"

Example

import { createSignerClient, createTransport, testnet, PrivateKeySigner } from "@left-curve/sdk"
import type { Address } from "@left-curve/sdk"
 
const client = createSignerClient({
  chain: testnet,
  transport: createTransport(),
  signer: PrivateKeySigner.fromMnemonic(process.env.DANGO_MNEMONIC!),
})
const sender: Address = "0x1234567890abcdef1234567890abcdef12345678"
 
await client.cancelConditionalOrder({
  sender,
  request: { one: { pairId: "BTC-PERP", triggerDirection: "above" } },
})

Parameters

senderAddress. The trader.

requestPerpsCancelConditionalOrderRequest. "all", { one: {...} }, or { allForPair: { pairId } }.

Returns

{ hash: Uint8Array } & TxData — see broadcastTxSync.

See also