From bfe02e676ed8d0c5323816f6514afa938c4b74fa Mon Sep 17 00:00:00 2001 From: nktkas Date: Sat, 1 Aug 2026 02:13:19 +0300 Subject: [PATCH] feat(exchange/reserveRequestWeight): add destination parameter Co-Authored-By: Claude Opus 5 (1M context) --- src/api/exchange/_methods/reserveRequestWeight.ts | 4 +++- tests/api/exchange/reserveRequestWeight.test.ts | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/api/exchange/_methods/reserveRequestWeight.ts b/src/api/exchange/_methods/reserveRequestWeight.ts index 55f990fd5..c1aa0c936 100644 --- a/src/api/exchange/_methods/reserveRequestWeight.ts +++ b/src/api/exchange/_methods/reserveRequestWeight.ts @@ -4,7 +4,7 @@ import * as v from "@valibot/valibot"; // API Schemas // ============================================================ -import { Hex, UnsignedInteger } from "../../_schemas.ts"; +import { Address, Hex, UnsignedInteger } from "../../_schemas.ts"; /** * Reserve additional rate-limited actions for a fee. @@ -18,6 +18,8 @@ export const ReserveRequestWeightRequest = /* @__PURE__ */ (() => { type: v.literal("reserveRequestWeight"), /** Amount of request weight to reserve. */ weight: v.pipe(UnsignedInteger, v.maxValue(1844674407370955)), // Truncated max uint64 / 1000 + /** Address of an existing user to reserve the weight for. */ + destination: v.optional(Address), }), /** Nonce (timestamp in ms) used to prevent replay attacks. */ nonce: UnsignedInteger, diff --git a/tests/api/exchange/reserveRequestWeight.test.ts b/tests/api/exchange/reserveRequestWeight.test.ts index 7df820bd9..7bf7810b1 100644 --- a/tests/api/exchange/reserveRequestWeight.test.ts +++ b/tests/api/exchange/reserveRequestWeight.test.ts @@ -15,7 +15,10 @@ runTest({ name: "reserveRequestWeight", codeTestFn: async (_t, exchClient) => { const params: ReserveRequestWeightParameters[] = [ + // no destination { weight: 1 }, + // destination + { weight: 1, destination: "0xe019d6167e7e324aed003d94098496b6d986ab05" }, ]; const data = await Promise.all(params.map((p) => exchClient.reserveRequestWeight(p)));