@triadxyz/triad-protocol 3.4.8-beta → 3.5.0-beta

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -839,13 +839,14 @@ class TriadProtocol {
839
839
  .div(new bn_js_1.default(Math.pow(10, constants_1.BASE_DECIMALS)));
840
840
  if (usdcAmount.lte(new bn_js_1.default(0)))
841
841
  continue;
842
+ const oppositeOrderDirection = (0, helpers_1.getOppositeOrderDirectionEncoded)(orderDirection);
842
843
  ixs.push(yield this.program.methods
843
844
  .marketBidOrder({
844
845
  amount: new bn_js_1.default(usdcAmount),
845
846
  marketId: new bn_js_1.default(marketId),
846
847
  orderDirection,
847
848
  bookOrderAskId: new bn_js_1.default(order.id),
848
- oppositeOrderDirection: (0, helpers_1.getOppositeOrderDirectionEncoded)(orderDirection)
849
+ oppositeOrderDirection
849
850
  })
850
851
  .accounts({
851
852
  signer: this.program.provider.publicKey,
@@ -854,7 +855,7 @@ class TriadProtocol {
854
855
  orderBook: (0, pda_1.getOrderBookPDA)(this.program.programId, marketId),
855
856
  bookOrderAskAuthority: new web3_js_1.PublicKey(order.authority),
856
857
  order: (0, pda_1.getOrderPDA)(this.program.programId, this.program.provider.publicKey, marketId, (0, helpers_1.getOrderDirection)(orderDirection)),
857
- oppositeOrder: (0, pda_1.getOrderPDA)(this.program.programId, new web3_js_1.PublicKey(order.authority), marketId, (0, helpers_1.getOrderDirection)(orderDirection))
858
+ oppositeOrder: (0, pda_1.getOrderPDA)(this.program.programId, new web3_js_1.PublicKey(order.authority), marketId, (0, helpers_1.getOrderDirection)(oppositeOrderDirection))
858
859
  })
859
860
  .instruction());
860
861
  remainingUSDC = remainingUSDC.sub(usdcAmount);
@@ -263,8 +263,8 @@ const getOppositeOrderDirection = (orderDirection) => {
263
263
  exports.getOppositeOrderDirection = getOppositeOrderDirection;
264
264
  const getOppositeOrderDirectionEncoded = (orderDirection) => {
265
265
  if (Object.keys(orderDirection)[0] === 'hype') {
266
- return { hype: {} };
266
+ return { flop: {} };
267
267
  }
268
- return { flop: {} };
268
+ return { hype: {} };
269
269
  };
270
270
  exports.getOppositeOrderDirectionEncoded = getOppositeOrderDirectionEncoded;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@triadxyz/triad-protocol",
3
- "version": "3.4.8-beta",
3
+ "version": "3.5.0-beta",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",