From 60a99f8ce687c198647fc0506c5c7e394052d35a Mon Sep 17 00:00:00 2001 From: nktkas Date: Sun, 2 Aug 2026 04:00:32 +0300 Subject: [PATCH] refactor(api/marginTable): add `dex` parameter Co-authored-by: Claude Opus 5 (1M context) --- src/api/info/_methods/marginTable.ts | 2 ++ tests/api/info/marginTable.test.ts | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/api/info/_methods/marginTable.ts b/src/api/info/_methods/marginTable.ts index bf71dd2fa..e415873ab 100644 --- a/src/api/info/_methods/marginTable.ts +++ b/src/api/info/_methods/marginTable.ts @@ -16,6 +16,8 @@ export const MarginTableRequest = /* @__PURE__ */ (() => { type: v.literal("marginTable"), /** Margin requirements table. */ id: UnsignedInteger, + /** DEX name (empty string for main dex). */ + dex: v.optional(v.string()), }); })(); diff --git a/tests/api/info/marginTable.test.ts b/tests/api/info/marginTable.test.ts index f1c1d5f3c..127654279 100644 --- a/tests/api/info/marginTable.test.ts +++ b/tests/api/info/marginTable.test.ts @@ -14,6 +14,8 @@ runTest({ codeTestFn: async (_t, client) => { const params: MarginTableParameters[] = [ { id: 1 }, + { id: 51, dex: "" }, // main dex + { id: 51, dex: "flx" }, // other dex ]; const data = await Promise.all(params.map((p) => client.marginTable(p)));