deleteQuoteTpSl
Cancel a live TP or SL order by its handler-issued cohQuoteId. Internally: resolves the handler URL + DELETE signing spec, builds a TpSlDeleteMessage bound to the target cohQuoteId + side, signs it with the session-key wallet, and calls DELETE /api/v5/ with { typedData, signature, signer }.
A resolved call establishes submission acceptance, not confirmed deletion. Check a complete live-order search through searchTpSlOrders before treating absence as removal. Notifications from watchTpSlNotifications can prompt reconciliation, but cannot identify which mutation completed or order successive changes.
import { deleteQuoteTpSl } from "@symmio/trading-core";
await deleteQuoteTpSl(config, {
from: sessionKey,
quoteId: 42n,
virtualAccount,
cohQuoteId: "coh4213",
conditionalOrderType: "take_profit",
});Parameters
quoteIdbigintrequiredOn-chain quote id the order belongs to (used for cache invalidation).
virtualAccountAddressrequiredPartyA (the VA address) that owns the quote.
cohQuoteIdstringrequiredHandler-issued conditional-order id targeted by the delete.
conditionalOrderType"take_profit" | "stop_loss"requiredWhich side is being canceled (TpSlConditionalOrderType).
fromAddressoptionalSession-key signer the wallet client resolves for. Defaults to the connected wallet in the React layer.
chainIdnumberoptionalTarget chain id. Defaults to the config’s defaultChainId.
Returns
DeleteQuoteTpSlReturnTypesuccesstrueAlways true on a resolved call (failures throw).
Throws
DELETE_TPSL_INVALID_RESPONSEfor a missing/malformedsuccessfulfield. Only booleantrueor string"true"establishes acceptance; explicitfalse/"false"yieldsDELETE_TPSL_REJECTED.SymmErrorwhen the chain has notpslconfig or signing fails.SymmApiErrorwhen the handler request fails.
Mutation options
Acceptance does not confirm deletion. Check a complete live-order search before interpreting absence as removal. A malformed response or transport failure can leave the outcome unknown; the action does not retry automatically. Notifications are useful refresh signals but cannot distinguish successive mutations without backend correlation/version metadata.
import { deleteQuoteTpSlMutationOptions } from "@symmio/trading-core";
import { useMutation } from "@tanstack/react-query";
useMutation(deleteQuoteTpSlMutationOptions(config));deleteQuoteTpSlMutationOptions returns { mutationKey, mutationFn, retry: false }; the mutationFn takes the same parameters object as the action. Automatic retries are explicitly disabled, including host-level mutation retry defaults. A lost acknowledgment, timeout or network error may follow an accepted write. Reconcile state before explicitly submitting again; do not override this policy without a proven replay guarantee.
Related
TpSlDeleteMessage— the message body built and signed.watchTpSlNotifications— notification signals for reconciliation.useDeleteQuoteTpSl— React binding.