project-serum / serum-ts

Project Serum TypeScript monorepo
https://projectserum.com
Apache License 2.0
270 stars 245 forks source link

How to cancel several orders in just one single transaction? #233

Open Danilo-Araujo-Silva opened 2 years ago

Danilo-Araujo-Silva commented 2 years ago

How can we cancel several orders in just one transaction? Guaranteeing this way that it returns success only if all of them succeeded?

For example, we have this documentation here: https://github.com/project-serum/serum-ts/tree/master/packages/serum

But we only have an example to be canceling a single order at a time, how can we achieve the proposed above? This is very needed.

Maybe we could have something like:

await market.cancelOrder(connection, owner, [order1, order2, order3, ...]);