Polymarket / clob-client

Typescript client for the Polymarket CLOB
MIT License
32 stars 7 forks source link

Feat/ trade notifications #71

Closed poly-rodr closed 1 year ago

poly-rodr commented 1 year ago

Get notifications

const notifications = await clobClient.getTradeNotifications({
    index: 0,
}),

Response payload

[
  {
    id: 1,
    owner: 'f4f247b7-4ac7-ff29-a152-04fda0a8755a',
    order_id: '0x72c66a1f70c00ac5e5eb9ce0452b7d118bc4869f8b822a1a8d8580c16e3ca83e',
    market: '0xbd31dc8a20211944f6b70f31557f1001557b59905b7738480ca09bd4532f84af',
    asset_id: '1343197538147866997676250008839231694243646439454152539053893078719042421992',
    side: 'SELL',
    price: '0.6',
    original_size: '100',
    matched_size: '10',
    remaining_size: '90',
    outcome: 'YES',
    outcome_index: 0,
    action: 'FILL',
    timestamp: 1675277676
  },
  {
    id: 3,
    owner: 'f4f247b7-4ac7-ff29-a152-04fda0a8755a',
    order_id: '0x26d5cb16c1e8c55f095754be0d8fac5d421b486261a9bafe3367a3dec16be03e',
    market: '0xbd31dc8a20211944f6b70f31557f1001557b59905b7738480ca09bd4532f84af',
    asset_id: '1343197538147866997676250008839231694243646439454152539053893078719042421992',
    side: 'SELL',
    price: '0.5',
    original_size: '50',
    matched_size: '10',
    remaining_size: '40',
    outcome: 'YES',
    outcome_index: 0,
    action: 'FILL',
    timestamp: 1675278294
  },
  { ... }
]

Drop notifications

await clobClient.dropTradeNotifications({
    index: 0,
}),

Response payload

OK