jupiter_lend_withdraw
Create an unsigned transaction to withdraw tokens from Jupiter Lend Earn, encoded in base64.
Instructions
Create a withdraw transaction for Jupiter Lend Earn. Returns a base64-encoded unsigned transaction.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| asset | Yes | Token mint address to withdraw | |
| signer | Yes | Wallet address | |
| amount | Yes | Amount to withdraw in base units |
Implementation Reference
- src/client.ts:132-137 (handler)The actual HTTP request handler for the Jupiter Lend Earn withdraw endpoint. Sends a POST to /lend/v1/earn/withdraw with asset, signer, and amount params.
async lendWithdraw(params: { asset: string; signer: string; amount: string }) { return this.request("/lend/v1/earn/withdraw", { method: "POST", body: params, }); } - src/tools/lend.ts:23-27 (schema)Zod schema defining the input parameters for jupiter_lend_withdraw: asset (token mint address), signer (wallet address), amount (in base units).
{ asset: z.string().describe("Token mint address to withdraw"), signer: z.string().describe("Wallet address"), amount: z.string().describe("Amount to withdraw in base units"), }, - src/tools/lend.ts:28-31 (handler)The tool handler function that delegates to client.lendWithdraw() and returns the result as a formatted JSON string.
async (args) => { const result = await client.lendWithdraw(args); return JSON.stringify(result, null, 2); }, - src/tools/lend.ts:20-33 (registration)Registration of the jupiter_lend_withdraw tool with its name, description, Zod schema, and handler via the register function.
register( "jupiter_lend_withdraw", "Create a withdraw transaction for Jupiter Lend Earn. Returns a base64-encoded unsigned transaction.", { asset: z.string().describe("Token mint address to withdraw"), signer: z.string().describe("Wallet address"), amount: z.string().describe("Amount to withdraw in base units"), }, async (args) => { const result = await client.lendWithdraw(args); return JSON.stringify(result, null, 2); }, ); } - src/client.ts:21-21 (helper)The generic HTTP request helper used by lendWithdraw to call the Jupiter API base URL.
private async request<T>(path: string, opts: RequestOptions = {}): Promise<T> {