Limit orders run as confidential 1Click swaps. They are not Perpetuals on near.com. See Confidential Swaps and the 1Click Terms of Service.
Place a limit order
Sell 1 NEAR for Ethereum USDC at 5 USDC per NEAR. The user pays on NEAR; filled USDC goes to their Ethereum address. Partial fills are allowed.- Look up both
assetIds withGET /v0/tokens. - Create the order with
POST /v0/orders. - Send the amount on
swapViewtodepositAddress, then pollGET /v0/orders/{orderId}.
quantity, side, and price. quantity is the base in smallest units. price is quote per one base — "5" is 5 USDC per 1 NEAR.
This page uses NEAR (24 decimals) and Ethereum USDC (6 decimals):
The quote-side amount is
quantity × price × 10^quoteDecimals / 10^baseDecimals, rounded up to a whole smallest unit. After create, send the amount on swapView.
Tokens
symbol (or other fields you care about) and use the returned assetId as baseAsset and quoteAsset. Take decimals from the same object.
For the examples on this page:
baseAsset is nep141:wrap.near. quoteAsset is nep141:eth-0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48.omft.near. Treat those assetId strings as snapshots; take current IDs from /v0/tokens before you ship.
See Asset support.
Authorization
Send a partner JWT asX-API-Key for your app. If the user is signing in, send their User-Session as Authorization: Bearer.
Use that same identity on create, get, list, and cancel so you can keep managing the order.
Create
The user pays on the origin chain and receives filled output on a destination-chain address.
Send
swapView.amountIn on a SELL, or swapView.maxAmountIn on a BUY, to depositAddress. You can optionally notify 1Click with POST /v0/deposit/submit.
The order stays open until it fills, you cancel it, or deadline (default 7 days). timeInForce is GTC.
Watch the order
Poll untilisPayoutStatusFinal is true. That’s when filled output has been withdrawn and any unfilled amount refunded (COMPLETED or FAILED).
fillStatus is the matching state:
When payout is final,
payouts has the withdrawal and refund legs (txHash on completed legs). partialFills are fills that already executed. depositedAmount is how much was funded.
Once the order is in flight, extra deposits are not applied to it. They come back separately from the unfilled refund (payouts.refund).
Cancel
FILLED instead of CANCELED.
List
GET /v0/orders returns your orders, newest first. Page with page[after] and page[size] (1–50, default 50). links.next is null on the last page.
If the user already holds an Intents balance
Use this when the payment already sits in Intents or Confidential Intents — an in-app balance, for example near.com. On create, setdepositType, refundType, and recipientType to INTENTS or CONFIDENTIAL_INTENTS. Then fund the order with signed intent execution: generate an intent against the order’s depositAddress, have the user sign it, and submit it.
Each generate call covers the remaining unfunded amount.
Fees
1Click platform fees apply as for other flows (Fee configuration, Fees). OptionalappFees on create are deducted from input.
If it fails
Errors come back aserrors[] with a stable code. Use code when you handle them. Include meta.correlationId if you report a problem.
Related
Making a request
Quote, deposit, and status for 1Click swaps
Confidential Swaps
confidentiality and CONFIDENTIAL_INTENTSSigned Intent Execution
Fund Intents deposits without an on-chain transfer
Fee configuration
appFees on create