diff --git a/src/api/exchange/_methods/reserveRequestWeight.ts b/src/api/exchange/_methods/reserveRequestWeight.ts index 55f990fd..c1aa0c93 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 7df820bd..7bf7810b 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)));