project-serum / serum-js

JavaScript client library for interacting with the Project Serum DEX.
82 stars 33 forks source link

how to get the trade status and the trade balance changed and histroy? #34

Closed gzf445 closed 3 years ago

gzf445 commented 3 years ago

hello. is there an funtion for the trade status or the trade balance update? i use the postonly to test but it seems nothing show on the https://dex.projectserum.com.

nathanielparke commented 3 years ago

Loading open orders using market.loadOrdersForOwner and filtering the orders for the order you are looking for should work. This will give you the up to date order quantity if the order exists on the orderbook. If the order is not in the set of orders, then the order has either not successfully made it onto the orderbook yet (the request is still in the request queue) or the order has been cancelled or filled.

gzf445 commented 3 years ago

hello. thanks for your reply. i have tested the market.loadOrdersForOwner and i use the postonly order.it seems that the order need about more than 10s after the order place by placeorder function.do you know the excatly time that the order to be show.and what is the meaning of cacheDurationMs in the market.loadOrdersForOwner?

and i got an error Error: Transaction was not confirmed in 10.01 seconds i tested 30 times by use the placeorder method.sometimes this error shown but the order already placed.sometimes it did not how to solve this situation?