@super-protocol/sdk-js 0.10.2-beta.1 → 0.10.2-beta.3
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/build/staticModels/OffersFactory.js +1 -1
- package/build/staticModels/OrdersFactory.d.ts +5 -0
- package/build/staticModels/OrdersFactory.js +17 -0
- package/build/staticModels/ProviderRegistry.js +2 -2
- package/build/staticModels/TeeOffersFactory.d.ts +1 -2
- package/build/staticModels/TeeOffersFactory.js +2 -2
- package/package.json +1 -1
|
@@ -158,7 +158,7 @@ var OffersFactory = /** @class */ (function () {
|
|
|
158
158
|
.OfferCreated()
|
|
159
159
|
.on("data", function (event) { return __awaiter(_this, void 0, void 0, function () {
|
|
160
160
|
return __generator(this, function (_a) {
|
|
161
|
-
callback(event.returnValues.offerId, event.returnValues.creator, event.returnValues.externalId, {
|
|
161
|
+
callback(event.returnValues.offerId, event.returnValues.creator, (0, utils_2.parseBytes32String)(event.returnValues.externalId), {
|
|
162
162
|
index: event.blockNumber,
|
|
163
163
|
hash: event.blockHash,
|
|
164
164
|
});
|
|
@@ -19,6 +19,11 @@ declare class OrdersFactory {
|
|
|
19
19
|
* @param orderId - order for fetching hold deposit
|
|
20
20
|
*/
|
|
21
21
|
static getOrderHoldDeposit(orderId: string): Promise<string>;
|
|
22
|
+
/**
|
|
23
|
+
* Function for fetching status of order change
|
|
24
|
+
* @param orderId - order for fetching hold deposit
|
|
25
|
+
*/
|
|
26
|
+
static getOrderChangeWithdrawn(orderId: string): Promise<boolean>;
|
|
22
27
|
/**
|
|
23
28
|
* Function for creating orders
|
|
24
29
|
* @param orderInfo - order info for new order
|
|
@@ -127,6 +127,23 @@ var OrdersFactory = /** @class */ (function () {
|
|
|
127
127
|
});
|
|
128
128
|
});
|
|
129
129
|
};
|
|
130
|
+
/**
|
|
131
|
+
* Function for fetching status of order change
|
|
132
|
+
* @param orderId - order for fetching hold deposit
|
|
133
|
+
*/
|
|
134
|
+
OrdersFactory.getOrderChangeWithdrawn = function (orderId) {
|
|
135
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
136
|
+
var contract;
|
|
137
|
+
return __generator(this, function (_a) {
|
|
138
|
+
switch (_a.label) {
|
|
139
|
+
case 0:
|
|
140
|
+
contract = BlockchainConnector_1.default.getContractInstance();
|
|
141
|
+
return [4 /*yield*/, contract.methods.getOrderChangeWithdrawn(orderId).call()];
|
|
142
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
});
|
|
146
|
+
};
|
|
130
147
|
/**
|
|
131
148
|
* Function for creating orders
|
|
132
149
|
* @param orderInfo - order info for new order
|
|
@@ -182,10 +182,10 @@ var ProviderRegistry = /** @class */ (function () {
|
|
|
182
182
|
var contract = BlockchainConnector_1.default.getContractInstance();
|
|
183
183
|
var logger = this.logger.child({ method: "onProviderRegistered" });
|
|
184
184
|
var subscription = contract.events
|
|
185
|
-
.
|
|
185
|
+
.ProviderRegistered()
|
|
186
186
|
.on("data", function (event) { return __awaiter(_this, void 0, void 0, function () {
|
|
187
187
|
return __generator(this, function (_a) {
|
|
188
|
-
callback(event.returnValues.
|
|
188
|
+
callback(event.returnValues.auth, {
|
|
189
189
|
index: event.blockNumber,
|
|
190
190
|
hash: event.blockHash,
|
|
191
191
|
});
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { BlockInfo, TransactionOptions } from "../types/Web3";
|
|
2
2
|
import { TeeOfferInfo } from "../types/TeeOffer";
|
|
3
|
-
import { OfferType } from "../types/Offer";
|
|
4
3
|
import { OfferCreatedEvent } from "../types/Events";
|
|
5
4
|
declare class TeeOffersFactory {
|
|
6
5
|
private static readonly logger;
|
|
@@ -32,6 +31,6 @@ declare class TeeOffersFactory {
|
|
|
32
31
|
static onTeeOfferCreated(callback: onTeeOfferCreatedCallback): () => void;
|
|
33
32
|
static onTeeOfferViolationRateChanged(callback: onTeeOfferViolationRateChangedCallback): () => void;
|
|
34
33
|
}
|
|
35
|
-
export declare type onTeeOfferCreatedCallback = (offerId: string,
|
|
34
|
+
export declare type onTeeOfferCreatedCallback = (offerId: string, creator: string, externalId: string, block?: BlockInfo) => void;
|
|
36
35
|
export declare type onTeeOfferViolationRateChangedCallback = (offerId: string, providerAuth: string, violationRate: number, block?: BlockInfo) => void;
|
|
37
36
|
export default TeeOffersFactory;
|
|
@@ -162,10 +162,10 @@ var TeeOffersFactory = /** @class */ (function () {
|
|
|
162
162
|
var contract = BlockchainConnector_1.default.getContractInstance();
|
|
163
163
|
var logger = this.logger.child({ method: "onTeeOfferCreated" });
|
|
164
164
|
var subscription = contract.events
|
|
165
|
-
.
|
|
165
|
+
.TeeOfferCreated()
|
|
166
166
|
.on("data", function (event) { return __awaiter(_this, void 0, void 0, function () {
|
|
167
167
|
return __generator(this, function (_a) {
|
|
168
|
-
callback(event.returnValues.offerId, event.returnValues.
|
|
168
|
+
callback(event.returnValues.offerId, event.returnValues.creator, (0, utils_2.parseBytes32String)(event.returnValues.externalId), {
|
|
169
169
|
index: event.blockNumber,
|
|
170
170
|
hash: event.blockHash,
|
|
171
171
|
});
|