jupiter_limit_orders
Retrieve all open limit orders for a wallet, including pending trigger orders with price targets and amounts.
Instructions
Get all open limit orders for a wallet — pending trigger orders with price targets and amounts.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| wallet | Yes | Wallet address |
Implementation Reference
- src/tools/trigger.ts:5-16 (handler)The tool handler for 'jupiter_limit_orders' — registers the tool with Zod schema (wallet string), calls client.triggerOrders(args.wallet) and returns JSON result.
export function registerTriggerTools(register: ToolRegistrar, client: JupiterClient) { register( "jupiter_limit_orders", "Get all open limit orders for a wallet — pending trigger orders with price targets and amounts.", { wallet: z.string().describe("Wallet address"), }, async (args) => { const result = await client.triggerOrders(args.wallet); return JSON.stringify(result, null, 2); }, ); - src/client.ts:139-169 (helper)The JupiterClient methods backing limit order tools: triggerOrders (GET /trigger/v2/orders), triggerCreate (POST /trigger/v2/orders/price), triggerCancel (POST /trigger/v2/orders/cancel).
// ── Trigger (Limit Orders) ─────────────────────────────── /** Get open limit orders for a wallet */ async triggerOrders(wallet: string) { return this.request("/trigger/v2/orders", { params: { wallet }, }); } /** Create a limit order (returns transaction to sign) */ async triggerCreate(params: { inputMint: string; outputMint: string; inAmount: string; outAmount: string; maker: string; expiredAt?: string; }) { return this.request("/trigger/v2/orders/price", { method: "POST", body: params, }); } /** Cancel a limit order */ async triggerCancel(params: { maker: string; orders: string[] }) { return this.request("/trigger/v2/orders/cancel", { method: "POST", body: params, }); } - src/tools/trigger.ts:1-47 (registration)All three trigger/limit-order tools registered in registerTriggerTools: jupiter_limit_orders, jupiter_limit_order_create, jupiter_limit_order_cancel.
import { z } from "zod"; import { JupiterClient } from "../client.js"; import type { ToolRegistrar } from "../types.js"; export function registerTriggerTools(register: ToolRegistrar, client: JupiterClient) { register( "jupiter_limit_orders", "Get all open limit orders for a wallet — pending trigger orders with price targets and amounts.", { wallet: z.string().describe("Wallet address"), }, async (args) => { const result = await client.triggerOrders(args.wallet); return JSON.stringify(result, null, 2); }, ); register( "jupiter_limit_order_create", "Create a limit order. Returns a transaction to sign. Supports single, OCO (TP/SL), and OTOCO orders.", { inputMint: z.string().describe("Mint of token to sell"), outputMint: z.string().describe("Mint of token to buy"), inAmount: z.string().describe("Amount to sell in base units"), outAmount: z.string().describe("Min amount to receive (sets limit price)"), maker: z.string().describe("Wallet address creating the order"), expiredAt: z.string().optional().describe("ISO 8601 expiration time"), }, async (args) => { const result = await client.triggerCreate(args); return JSON.stringify(result, null, 2); }, ); register( "jupiter_limit_order_cancel", "Cancel one or more open limit orders.", { maker: z.string().describe("Wallet that created the orders"), orders: z.array(z.string()).describe("Order public keys to cancel"), }, async (args) => { const result = await client.triggerCancel(args); return JSON.stringify(result, null, 2); }, ); } - src/index.ts:40-58 (registration)The central register() function that wraps server.tool() with error handling — called for all tool registrations including jupiter_limit_orders.
function register( name: string, description: string, shape: Record<string, z.ZodType>, handler: (args: any) => Promise<string>, ) { server.tool(name, description, shape, async (args) => { try { const text = await handler(args); return { content: [{ type: "text" as const, text }] }; } catch (err: any) { return { content: [{ type: "text" as const, text: `Error: ${err.message}` }], isError: true, }; } }); toolCount++; } - src/index.ts:65-65 (registration)Invocation of registerTriggerTools(register, client) which registers jupiter_limit_orders and its sibling tools.
registerTriggerTools(register, client);