Creates a new LimitOrders instance for interacting with limit order functionality
on Aftermath.
Optionalconfig: CallerConfig
Optional configuration, including network, API host, access token, and API path.
The mutable configuration used for subsequent requests.
Static ReadonlyconstantsStatic configuration constants, including a default gas amount for limit order transactions (50 SUI).
The default gas budget for limit-order transactions, in MIST.
50_000_000n equals 0.05 SUI.
Sends a signed request to cancel one or more limit orders.
Sign the exact string returned by
UserData.createTermsAndConditionsMessage() as a personal message over
its UTF-8 bytes. Send those signed bytes and the signature in inputs.
The order IDs are sent in orderObjectIds; the deprecated per-action
message from cancelLimitOrdersMessageToSign is not the current credential.
Wallet address, signed terms-message bytes, signature, and the order object IDs to cancel.
The backend cancellation result. false is a valid response.
Builds the legacy per-action message for canceling limit orders.
This method performs no network I/O. The current cancellation endpoint
authenticates with the canonical terms message instead. Put the order IDs
in cancelLimitOrder's orderObjectIds field.
Object with orderIds, an array of order object IDs to cancel.
{ action: "CANCEL_LIMIT_ORDERS", order_object_ids: inputs.orderIds }.
Fetches the user's active limit orders from the Aftermath API.
The bytes and signature fields authenticate the request. They are the
signed terms-message credential, not a transaction or a limit-order
cancellation payload.
Contains the walletAddress, as well as bytes and signature if needed for auth.
A promise resolving to an array of LimitOrderObject, representing the active orders.
Requests a limit-order creation transaction from the Aftermath API.
The returned Transaction is not signed or executed.
Limit-order details. Coin amounts are in the smallest units
of their coin, and expiryDurationMs is in milliseconds.
A parsed Transaction with the wallet address set as its sender.
Fetches the minimum allowable limit-order size in USD.
A promise resolving to a number (USD value) or undefined if not configured.
Fetches the user's past limit orders from the Aftermath API, including completed, canceled, expired, and failed orders.
An object containing the walletAddress.
A promise resolving to an array of LimitOrderObject representing past orders.
StaticapiReturns the canonical Aftermath API host for a Sui network.
To target a custom or local host, pass baseUrl in CallerConfig to the
constructor instead.
The Sui network whose host to return.
The network's HTTPS or local HTTP API host.
StaticdefaultReturns the canonical Sui fullnode URL for a network.
The network whose fullnode URL to return. undefined
defaults to mainnet.
The network's fullnode URL.
The
LimitOrdersclass manages creation, cancellation, and querying of limit orders on the Aftermath platform. Limit orders allow you to buy or sell at a specified price, giving more control over your trades compared to market execution.Example