aftermath-ts-sdk - v3.3.3
    Preparing search index...

    Type Alias ApiPerpetualsCancelAndPlaceOrdersBody

    ApiPerpetualsCancelAndPlaceOrdersBody: {
        builderCode?: PerpetualsBuilderCodeParamaters;
        clientOrderIdsToCancel?: PerpetualsClientOrderId[];
        expiryTimestamp?: bigint;
        hasPosition: boolean;
        leverage?: number;
        marketId: PerpetualsMarketId;
        orderIdsToCancel: PerpetualsOrderId[];
        ordersToPlace: ApiPerpetualsOrderToPlace[];
        orderType: PerpetualsOrderType;
        reduceOnly: boolean;
        shouldAbortOnMissingId?: boolean;
        shouldDeallocateFreeCollateral?: boolean;
        txKind?: SerializedTransaction;
        walletAddress: SuiAddress;
    } & (
        | { accountCapId?: ObjectId; accountId: PerpetualsAccountId }
        | { vaultId: ObjectId }
    )

    API request body for atomically canceling existing orders and placing new ones in a single transaction.

    Type Declaration

    • OptionalbuilderCode?: PerpetualsBuilderCodeParamaters

      Optional integrator fee configuration.

    • OptionalclientOrderIdsToCancel?: PerpetualsClientOrderId[]

      Optional client-managed order ids to cancel (in addition to orderIdsToCancel).

    • OptionalexpiryTimestamp?: bigint

      Optional expiration timestamp in milliseconds since epoch.

    • hasPosition: boolean

      Whether the account already has a position in this market.

    • Optionalleverage?: number

      Optional leverage override.

    • marketId: PerpetualsMarketId

      Market ID associated with the request.

    • orderIdsToCancel: PerpetualsOrderId[]

      Order IDs to cancel.

    • ordersToPlace: ApiPerpetualsOrderToPlace[]

      New orders to place after the cancellation.

    • orderType: PerpetualsOrderType

      Order type (e.g. GTC, IOC).

    • reduceOnly: boolean

      If true, placed orders can only reduce an existing position.

    • OptionalshouldAbortOnMissingId?: boolean

      If true, abort the transaction when any ID in orderIdsToCancel is not found on-chain. If false (default), missing IDs are tolerated.

    • OptionalshouldDeallocateFreeCollateral?: boolean

      If true, also deallocate free collateral (margin not backing a position) back to the wallet in the same transaction. Defaults to false.

    • OptionaltxKind?: SerializedTransaction

      Optionally pre-built transaction payload.

    • walletAddress: SuiAddress

      Wallet address used to identify the signer or owner.