Skip to content

Commit

Permalink
Merge pull request #284 from zetamarkets/trigger-order-callback
Browse files Browse the repository at this point in the history
Manually trigger user callback on editTriggerOrder
  • Loading branch information
audreyleow authored Oct 6, 2023
2 parents d2f3317 + 2d4cb38 commit 1f13ccc
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
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.9] 2023-10-06

- Client: Manually trigger USER callback on editTriggerOrder ([#284](https://github.com/zetamarkets/sdk/pull/284))

## [1.10.8] 2023-10-03

- Client: Add new instruction to allow permissionless deposit to other user's margin accounts. ([#280](https://github.com/zetamarkets/sdk/pull/280))
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.8",
"version": "1.10.9",
"description": "Zeta SDK",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
12 changes: 11 additions & 1 deletion src/cross-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1444,14 +1444,24 @@ export class CrossClient {
triggerAccount
)
);
return await utils.processTransaction(
let txSig = await utils.processTransaction(
this._provider,
tx,
undefined,
undefined,
undefined,
this._useVersionedTxs ? utils.getZetaLutArr() : undefined
);

// Editing a trigger order doesn't prompt an account change because the bits stay the same.
// Therefore just manually fire this
if (this._callback !== undefined) {
this._callback(null, EventType.USER, Exchange.clockSlot, {
UserCallbackType: types.UserCallbackType.CROSSMARGINACCOUNTCHANGE,
});
}

return txSig;
}

public async editDelegatedPubkey(
Expand Down

0 comments on commit 1f13ccc

Please sign in to comment.