Skip to content

Commit

Permalink
fix cancelOrder for proxies (#171)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomjohn1028 committed Sep 22, 2021
1 parent 8d97780 commit 3e6545c
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions packages/serum/src/market-proxy/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,18 @@ export class MarketProxyInstruction {
}

public cancelOrder(owner: PublicKey, order: Order): TransactionInstruction {
const ix = this._market.makeCancelOrderInstruction(
// @ts-ignore
null, // Not used by the function.
const ix = DexInstructions.cancelOrderV2({
market: this._market.address,
owner,
order,
);
openOrders: order.openOrdersAddress,
bids: this._market.decoded.bids,
asks: this._market.decoded.asks,
eventQueue: this._market.decoded.eventQueue,
side: order.side,
orderId: order.orderId,
openOrdersSlot: order.openOrdersSlot,
programId: this._proxyProgramId,
})
this._middlewares.forEach((mw) => mw.cancelOrderV2(ix));
return this.proxy(ix);
}
Expand Down

0 comments on commit 3e6545c

Please sign in to comment.