๐งน Cancel All Orders by Market
Cancel all open orders by outcome, market, or event using the Forkast SDK with a single required identifier parameter.
Cancels all open orders by outcome, market, or event. Provide one of outcomeId, marketId, or eventId. If eventIdis used, it cancels for all markets in that event.
import {
ForkastSDK,
Network,
CancelAllOrderParams,
CancelAllOrderResponse,
} from "@forkastgg/client";
const sdk = new ForkastSDK(Network.TESTNET, "YOUR_API_KEY");
const accountService = sdk.getAccountService();
const orderService = sdk.getOrderService();
const { accessToken } = await accountService.loginWithPrivateKey(
"YOUR_PRIVATE_KEY"
);
// By marketId
const params: CancelAllOrderParams = { marketId: 123 };
const result: CancelAllOrderResponse = await orderService.cancelAllOrder(
params,
accessToken
);
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
params | CancelAllOrderParams | Yes | Send one of the below in the object: โข outcomeIdโข marketIdโข eventId |
accessToken | string | Yes | Access Token received from login response |