Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/api/info/_methods/l2Book.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ export const L2BookResponse = /* @__PURE__ */ (() => {
time: UnsignedInteger,
/** Bid and ask levels (index 0 = bids, index 1 = asks). */
levels: v.tuple([v.array(L2BookLevelSchema), v.array(L2BookLevelSchema)]),
/** Spread (only present when `nSigFigs` is non-null). */
spread: v.optional(UnsignedDecimal),
}),
);
})();
Expand Down
2 changes: 2 additions & 0 deletions src/api/subscription/_methods/l2Book.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ export const L2BookEvent = /* @__PURE__ */ (() => {
time: UnsignedInteger,
/** Bid and ask levels (index 0 = bids, index 1 = asks). */
levels: v.tuple([v.array(L2BookLevelSchema), v.array(L2BookLevelSchema)]),
/** Spread (only present when `nSigFigs` is non-null). */
spread: v.optional(UnsignedDecimal),
});
})();
export type L2BookEvent = v.InferOutput<typeof L2BookEvent>;
Expand Down
1 change: 1 addition & 0 deletions tests/api/info/l2Book.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ runTest({
const data = await Promise.all([
client.l2Book({ coin: "ETH" }),
client.l2Book({ coin: "NONE/EXISTENT" }),
client.l2Book({ coin: "ETH", nSigFigs: 2 }),
]);
schemaCoverage(L2BookResponse, data);
},
Expand Down
1 change: 1 addition & 0 deletions tests/api/subscription/l2Book.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ runTest({
fn: async (_t, client) => {
const data = await collectEventsOverTime<L2BookEvent>(async (cb) => {
await client.l2Book({ coin: "BTC" }, cb);
await client.l2Book({ coin: "BTC", nSigFigs: 2 }, cb);
}, 10_000);
schemaCoverage(L2BookEvent, data);
},
Expand Down