@super-protocol/sdk-js 0.12.5-beta.1 → 0.12.7-beta.0

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.
@@ -1,8 +1,10 @@
1
1
  import { BaseConnector, Config } from "./BaseConnector";
2
+ import { WebsocketProviderBase } from "web3-core-helpers";
2
3
  declare class BlockchainEventsListener extends BaseConnector {
3
4
  private static instance;
4
5
  private constructor();
5
6
  static getInstance(): BlockchainEventsListener;
7
+ getProvider(): WebsocketProviderBase | undefined;
6
8
  /**
7
9
  * Function for connecting to blockchain using web socket
8
10
  * Needs to run this function before using events
@@ -72,6 +72,9 @@ var BlockchainEventsListener = /** @class */ (function (_super) {
72
72
  }
73
73
  return BlockchainEventsListener.instance;
74
74
  };
75
+ BlockchainEventsListener.prototype.getProvider = function () {
76
+ return this.provider;
77
+ };
75
78
  /**
76
79
  * Function for connecting to blockchain using web socket
77
80
  * Needs to run this function before using events
@@ -21,7 +21,7 @@ declare class Offer {
21
21
  /**
22
22
  * Function for fetching offer status from blockchain
23
23
  */
24
- isEnabled(): Promise<number>;
24
+ isEnabled(): Promise<boolean>;
25
25
  /**
26
26
  * Updates name in offer info
27
27
  * @param name - new name
@@ -155,13 +155,15 @@ var Offer = /** @class */ (function () {
155
155
  */
156
156
  Offer.prototype.getInfo = function () {
157
157
  return __awaiter(this, void 0, void 0, function () {
158
- var _a, orderInfoParams;
158
+ var _a, offerInfoParams, enabled;
159
159
  return __generator(this, function (_b) {
160
160
  switch (_b.label) {
161
161
  case 0: return [4 /*yield*/, Offer.contract.methods.getValueOffer(this.id).call()];
162
162
  case 1:
163
- _a = _b.sent(), orderInfoParams = _a[2];
164
- return [2 /*return*/, (this.offerInfo = (0, utils_1.tupleToObject)(orderInfoParams, Offer_1.OfferInfoStructure))];
163
+ _a = _b.sent(), offerInfoParams = _a[2], enabled = _a[3];
164
+ this.offerInfo = (0, utils_1.tupleToObject)(offerInfoParams, Offer_1.OfferInfoStructure);
165
+ this.offerInfo.enabled = enabled;
166
+ return [2 /*return*/, this.offerInfo];
165
167
  }
166
168
  });
167
169
  });
@@ -102,13 +102,15 @@ var TeeOffer = /** @class */ (function () {
102
102
  */
103
103
  TeeOffer.prototype.getInfo = function () {
104
104
  return __awaiter(this, void 0, void 0, function () {
105
- var _a, teeOfferInfoParams;
105
+ var _a, teeOfferInfoParams, enabled;
106
106
  return __generator(this, function (_b) {
107
107
  switch (_b.label) {
108
108
  case 0: return [4 /*yield*/, TeeOffer.contract.methods.getTeeOffer(this.id).call()];
109
109
  case 1:
110
- _a = _b.sent(), teeOfferInfoParams = _a[2];
111
- return [2 /*return*/, (this.offerInfo = (0, utils_1.tupleToObject)(teeOfferInfoParams, TeeOffer_1.TeeOfferInfoStructure))];
110
+ _a = _b.sent(), teeOfferInfoParams = _a[2], enabled = _a[3];
111
+ this.offerInfo = (0, utils_1.tupleToObject)(teeOfferInfoParams, TeeOffer_1.TeeOfferInfoStructure);
112
+ this.offerInfo.enabled = enabled;
113
+ return [2 /*return*/, this.offerInfo];
112
114
  }
113
115
  });
114
116
  });
@@ -57,4 +57,5 @@ export type OfferInfo = {
57
57
  resultResource: string;
58
58
  linkage: string;
59
59
  hash: string;
60
+ enabled: boolean;
60
61
  };
@@ -21,4 +21,5 @@ export type TeeOfferInfo = {
21
21
  tlb: string;
22
22
  argsPublicKey: string;
23
23
  maxDurationTimeMinutes: string;
24
+ enabled: boolean;
24
25
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@super-protocol/sdk-js",
3
- "version": "0.12.5-beta.1",
3
+ "version": "0.12.7-beta.0",
4
4
  "main": "build/index.js",
5
5
  "license": "MIT",
6
6
  "files": [