js-stellar-sdk icon indicating copy to clipboard operation
js-stellar-sdk copied to clipboard

.offers().forAccount().stream() returns one order at a time

Open praneethmendu opened this issue 5 years ago • 1 comments

Describe the bug When I try to stream my own orders with server.offers().forAccount().stream() I get one order at a time instead of an array or object containing all of them. I have considered this might be a design choice but there is nothing in the sent object that lets me know which batch this particular order belongs to.

What version are you on? 5.0.3

To Reproduce Steps to reproduce the behavior: server .offers() .forAccount(account) .stream({ onmessage: function (currentOrders) { console.log(currentOrders); } })

praneethmendu avatar May 31 '20 11:05 praneethmendu

This sounds like normal behavior. You can .call() your offers to see any which exist already, then using the id of the last offer, .offers().forAccount(account).cursor(id).stream() will stream new offers you place.

brianebert avatar Jan 03 '22 16:01 brianebert