Skip to content

Commit

Permalink
Merge pull request #32 from Polymarket/feature/add-side-to-last-trade
Browse files Browse the repository at this point in the history
Adding 'side' parameter
  • Loading branch information
poly-rodr authored May 31, 2022
2 parents 8dff86b + b440c40 commit 5b9d0b5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/getLastTradePrice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
4 changes: 2 additions & 2 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ export class ClobClient {
return get(`${this.host}${PRICE}?market=${tokenID}&side=${side}`);
}

public async getLastTradePrice(tokenID: string): Promise<any> {
const endpoint = `${this.host}${GET_LAST_TRADE_PRICE}?market=${tokenID}`;
public async getLastTradePrice(tokenID: string, side:string): Promise<any> {
const endpoint = `${this.host}${GET_LAST_TRADE_PRICE}?market=${tokenID}&side=${side}`;
return get(endpoint);
}

Expand Down

0 comments on commit 5b9d0b5

Please sign in to comment.