Skip to content

Commit

Permalink
Unsub orderbooks on Exchange.close() (#271)
Browse files Browse the repository at this point in the history
  • Loading branch information
filipzeta authored Sep 15, 2023
1 parent d7bf5d9 commit 6c7e872
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ Version changes are pinned to SDK releases.

## Unreleased

## [1.10.2] 2023-09-15

- Bugfix: Unsubscribe from orderbooks on Exchange.close(). ([#271](https://github.com/zetamarkets/sdk/pull/271))

## [1.10.1] 2023-09-15

- New function to cancel all trigger orders + place order. ([#265](https://github.com/zetamarkets/sdk/pull/265))
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": "@zetamarkets/sdk",
"repository": "https://github.com/zetamarkets/sdk/",
"version": "1.10.1",
"version": "1.10.2",
"description": "Zeta SDK",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
3 changes: 3 additions & 0 deletions src/subexchange.ts
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,9 @@ export class SubExchange {
await Exchange.program.account.perpSyncQueue.unsubscribe(
Exchange.pricing.perpSyncQueues[assetToIndex(this._asset)]
);

await this.markets.market.unsubscribeOrderbook();

for (var i = 0; i < this._eventEmitters.length; i++) {
this._eventEmitters[i].removeListener("change");
}
Expand Down

0 comments on commit 6c7e872

Please sign in to comment.