@triadxyz/triad-protocol 2.3.9-beta → 2.4.1-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.
@@ -77,6 +77,7 @@ export type BookOrder = {
77
77
  orderDirection: OrderDirection;
78
78
  orderSide: OrderSide;
79
79
  userNonce: string;
80
+ linkedBookOrderId: string;
80
81
  };
81
82
  export declare enum WinningDirection {
82
83
  HYPE = "Hype",
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getOrderStatus = exports.getOrderSide = exports.getOrderType = exports.getOrderSideFromNumber = exports.getOrderDirectionFromNumber = exports.getOrderDirection = exports.getTokenProgram = exports.calculateStakeRewards = exports.formatBookOrder = exports.formatOrder = exports.formatUserTrade = exports.formatMarket = exports.formatPool = exports.formatStake = exports.formatStakeVault = exports.decodeString = exports.encodeString = void 0;
4
+ const web3_js_1 = require("@solana/web3.js");
4
5
  const spl_token_1 = require("@solana/spl-token");
5
6
  const types_1 = require("../types");
6
7
  const constants_1 = require("./constants");
@@ -134,11 +135,12 @@ const formatBookOrder = (order) => {
134
135
  id: order.id.toString(),
135
136
  price: order.price.toString(),
136
137
  totalShares: order.totalShares.toString(),
137
- authority: order.authority.toString(),
138
+ authority: new web3_js_1.PublicKey(order.authority).toString(),
138
139
  filledShares: order.filledShares.toString(),
139
140
  orderDirection: (0, exports.getOrderDirectionFromNumber)(order.orderDirection),
140
141
  orderSide: (0, exports.getOrderSideFromNumber)(order.orderSide),
141
- userNonce: order.userNonce.toString()
142
+ userNonce: order.userNonce.toString(),
143
+ linkedBookOrderId: order.linkedBookOrderId.toString()
142
144
  };
143
145
  };
144
146
  exports.formatBookOrder = formatBookOrder;
@@ -176,10 +178,10 @@ const getOrderDirection = (direction) => {
176
178
  };
177
179
  exports.getOrderDirection = getOrderDirection;
178
180
  const getOrderDirectionFromNumber = (direction) => {
179
- if (direction === 1) {
181
+ if (direction === 0) {
180
182
  return types_1.OrderDirection.HYPE;
181
183
  }
182
- if (direction === 2) {
184
+ if (direction === 1) {
183
185
  return types_1.OrderDirection.FLOP;
184
186
  }
185
187
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@triadxyz/triad-protocol",
3
- "version": "2.3.9-beta",
3
+ "version": "2.4.1-beta",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",