From b440c406ceb17f40c4ed9a87b0a1592d6dc3fffc Mon Sep 17 00:00:00 2001 From: Rodrigo <95635797+poly-rodr@users.noreply.github.com> Date: Mon, 30 May 2022 23:03:42 -0300 Subject: [PATCH] Adding 'side' parameter --- examples/getLastTradePrice.ts | 2 +- package.json | 2 +- src/client.ts | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/getLastTradePrice.ts b/examples/getLastTradePrice.ts index eece921..b7346ea 100644 --- a/examples/getLastTradePrice.ts +++ b/examples/getLastTradePrice.ts @@ -15,7 +15,7 @@ async function main() { const clobClient = new ClobClient(host, wallet); console.log(`Price: `); - const resp = await clobClient.getLastTradePrice("16678291189211314787145083999015737376658799626183230671758641503291735614088"); + const resp = await clobClient.getLastTradePrice("16678291189211314787145083999015737376658799626183230671758641503291735614088", "buy"); console.log(resp); } diff --git a/package.json b/package.json index 8d22b91..9ae068a 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@polymarket/clob-client", "description": "Typescript client for Polymarket's CLOB", - "version": "1.0.25", + "version": "1.0.26", "contributors": [ { "name": "Jonathan Amenechi", diff --git a/src/client.ts b/src/client.ts index 5ed68fd..30e19a4 100644 --- a/src/client.ts +++ b/src/client.ts @@ -92,8 +92,8 @@ export class ClobClient { return get(`${this.host}${PRICE}?market=${tokenID}&side=${side}`); } - public async getLastTradePrice(tokenID: string): Promise { - const endpoint = `${this.host}${GET_LAST_TRADE_PRICE}?market=${tokenID}`; + public async getLastTradePrice(tokenID: string, side:string): Promise { + const endpoint = `${this.host}${GET_LAST_TRADE_PRICE}?market=${tokenID}&side=${side}`; return get(endpoint); }