@triadxyz/triad-protocol 0.1.1-alpha.5 → 0.1.1-alpha.6

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/index.js +7 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -22,7 +22,8 @@ class TriadProtocolClient {
22
22
  constructor(connection, wallet) {
23
23
  this.getUserPositions = (userWallet) => __awaiter(this, void 0, void 0, function* () {
24
24
  const tickers = yield this.ticker.getTickers();
25
- const positions = yield Promise.all(tickers.map((ticker) => __awaiter(this, void 0, void 0, function* () {
25
+ const positions = yield Promise.all(tickers
26
+ .map((ticker) => __awaiter(this, void 0, void 0, function* () {
26
27
  let data = {};
27
28
  try {
28
29
  const UserPositionPDA = (0, helpers_1.getUserPositionAddressSync)(this.program.programId, userWallet, ticker.publicKey);
@@ -32,9 +33,12 @@ class TriadProtocolClient {
32
33
  position
33
34
  };
34
35
  }
35
- catch (_a) { }
36
+ catch (_a) {
37
+ return;
38
+ }
36
39
  return data;
37
- })));
40
+ }))
41
+ .filter(Boolean));
38
42
  return positions;
39
43
  });
40
44
  this.provider = new anchor_1.AnchorProvider(connection, wallet, anchor_1.AnchorProvider.defaultOptions());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@triadxyz/triad-protocol",
3
- "version": "0.1.1-alpha.5",
3
+ "version": "0.1.1-alpha.6",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",