diff --git a/examples/getMarkets.ts b/examples/getMarkets.ts index a44a9d5..e56d66a 100644 --- a/examples/getMarkets.ts +++ b/examples/getMarkets.ts @@ -14,6 +14,10 @@ async function main() { console.log("markets", await clobClient.getMarkets()); console.log("simplified markets", await clobClient.getSimplifiedMarkets()); + + console.log("sampling markets", await clobClient.getSamplingMarkets()); + + console.log("sampling simplified markets", await clobClient.getSamplingSimplifiedMarkets()); } main(); diff --git a/src/client.ts b/src/client.ts index a5a8b5c..2b4777f 100644 --- a/src/client.ts +++ b/src/client.ts @@ -79,6 +79,8 @@ import { GET_TICK_SIZE, ARE_ORDERS_SCORING, GET_SIMPLIFIED_MARKETS, + GET_SAMPLING_SIMPLIFIED_MARKETS, + GET_SAMPLING_MARKETS, } from "./endpoints"; import { OrderBuilder } from "./order-builder/builder"; @@ -132,6 +134,14 @@ export class ClobClient { return get(`${this.host}${TIME}`); } + public async getSamplingSimplifiedMarkets(next_cursor = "MA=="): Promise { + return get(`${this.host}${GET_SAMPLING_SIMPLIFIED_MARKETS}?next_cursor=${next_cursor}`); + } + + public async getSamplingMarkets(next_cursor = "MA=="): Promise { + return get(`${this.host}${GET_SAMPLING_MARKETS}?next_cursor=${next_cursor}`); + } + public async getSimplifiedMarkets(next_cursor = "MA=="): Promise { return get(`${this.host}${GET_SIMPLIFIED_MARKETS}?next_cursor=${next_cursor}`); } diff --git a/src/endpoints.ts b/src/endpoints.ts index 87e9bab..3a67873 100644 --- a/src/endpoints.ts +++ b/src/endpoints.ts @@ -8,6 +8,8 @@ export const DELETE_API_KEY = "/delete-api-key"; export const DERIVE_API_KEY = "/derive-api-key"; // Markets +export const GET_SAMPLING_SIMPLIFIED_MARKETS = "/sampling-simplified-markets"; +export const GET_SAMPLING_MARKETS = "/sampling-markets"; export const GET_SIMPLIFIED_MARKETS = "/simplified-markets"; export const GET_MARKETS = "/markets"; export const GET_MARKET = "/markets/";