@triadxyz/triad-protocol 1.5.6-beta → 1.5.7-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.
Files changed (2) hide show
  1. package/dist/trade.js +3 -5
  2. package/package.json +1 -1
package/dist/trade.js CHANGED
@@ -182,10 +182,8 @@ class Trade {
182
182
  const addressLookupTableAccounts = [];
183
183
  let amountInTRD = amount * Math.pow(10, constants_1.TRD_DECIMALS);
184
184
  let myUserTrades = [];
185
- try {
186
- myUserTrades = yield this.getMyUserTrades(this.provider.publicKey);
187
- }
188
- catch (_a) {
185
+ myUserTrades = yield this.getMyUserTrades(this.provider.publicKey);
186
+ if (myUserTrades.length === 0) {
189
187
  ixs.push(yield this.program.methods
190
188
  .createUserTrade()
191
189
  .accounts({
@@ -197,7 +195,7 @@ class Trade {
197
195
  userTradePDA = yield this.getUserTradeNonceWithSlots(myUserTrades);
198
196
  console.log(userTradePDA);
199
197
  }
200
- catch (_b) {
198
+ catch (_a) {
201
199
  const mainUserTrade = myUserTrades.find((userTrade) => !userTrade.isSubUser);
202
200
  const subUserTradePDA = (0, trade_1.getSubUserTradePDA)(this.program.programId, this.provider.publicKey, Number(mainUserTrade.nonce) + 1);
203
201
  userTradePDA = (0, trade_1.getUserTradePDA)(this.program.programId, subUserTradePDA);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@triadxyz/triad-protocol",
3
- "version": "1.5.6-beta",
3
+ "version": "1.5.7-beta",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",