@super-protocol/sdk-js 0.12.0-beta.0 → 0.12.1-beta.1
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/TIIGenerator.d.ts +2 -9
- package/build/TIIGenerator.js +28 -19
- package/build/connectors/BaseConnector.d.ts +1 -1
- package/build/connectors/BaseConnector.js +1 -1
- package/build/connectors/BlockchainConnector.js +1 -1
- package/build/connectors/BlockchainEventsListener.js +1 -1
- package/build/crypto/Crypto.js +1 -1
- package/build/crypto/nodejs/AES.js +1 -1
- package/build/crypto/nodejs/ARIA.js +1 -1
- package/build/crypto/nodejs/ECIES.js +1 -1
- package/build/crypto/nodejs/NativeCrypto.js +1 -1
- package/build/crypto/nodejs/RSA-Hybrid.js +1 -1
- package/build/models/Ballot.js +1 -1
- package/build/models/EtlModel.js +1 -1
- package/build/models/Offer.js +40 -1
- package/build/models/Order.d.ts +2 -2
- package/build/models/Order.js +83 -2
- package/build/models/Provider.js +1 -1
- package/build/models/TCB.js +1 -1
- package/build/models/TeeOffer.js +43 -1
- package/build/proto/Compression.d.ts +4 -4
- package/build/proto/TRI.d.ts +4 -4
- package/build/proto/TeeProperties.d.ts +4 -4
- package/build/providers/storage/ChunksDownloadDecorator.d.ts +3 -3
- package/build/providers/storage/ChunksDownloadDecorator.js +30 -23
- package/build/providers/storage/IStorageProvider.d.ts +1 -1
- package/build/providers/storage/StorjStorageProvider.js +56 -48
- package/build/staticModels/ActiveOffers.js +1 -1
- package/build/staticModels/ActiveOrders.js +14 -1
- package/build/staticModels/Consensus.js +1 -1
- package/build/staticModels/Marks.js +1 -1
- package/build/staticModels/ModelPackager.js +1 -1
- package/build/staticModels/OffersFactory.d.ts +3 -3
- package/build/staticModels/OffersFactory.js +1 -1
- package/build/staticModels/OrdersFactory.d.ts +12 -12
- package/build/staticModels/OrdersFactory.js +16 -1
- package/build/staticModels/ProviderRegistry.d.ts +6 -6
- package/build/staticModels/ProviderRegistry.js +2 -3
- package/build/staticModels/Staking.js +1 -1
- package/build/staticModels/Superpro.js +1 -1
- package/build/staticModels/SuperproToken.d.ts +2 -2
- package/build/staticModels/SuperproToken.js +1 -1
- package/build/staticModels/TeeOffersFactory.d.ts +2 -2
- package/build/staticModels/TeeOffersFactory.js +1 -1
- package/build/staticModels/Voting.js +1 -1
- package/build/store.d.ts +1 -1
- package/build/types/Ballot.d.ts +3 -3
- package/build/types/Consensus.d.ts +6 -6
- package/build/types/EtlModel.d.ts +1 -1
- package/build/types/Events.d.ts +4 -4
- package/build/types/Offer.d.ts +2 -2
- package/build/types/Order.d.ts +6 -7
- package/build/types/Order.js +0 -1
- package/build/types/Origins.d.ts +1 -1
- package/build/types/Provider.d.ts +2 -2
- package/build/types/Staking.d.ts +2 -2
- package/build/types/TeeOffer.d.ts +1 -1
- package/build/types/Web3.d.ts +5 -5
- package/build/types/blockchainConnector/StorageAccess.d.ts +1 -1
- package/build/types/storage/StorageAccess.d.ts +1 -1
- package/build/types/storage/StorageFileAccess.d.ts +1 -1
- package/build/types/storage/StorageObject.d.ts +1 -1
- package/build/utils/Monitoring.d.ts +9 -0
- package/build/utils/Monitoring.js +42 -0
- package/build/utils/NonceTracker.js +1 -1
- package/build/utils/TxManager.d.ts +2 -2
- package/build/utils/TxManager.js +1 -1
- package/build/utils/compressors/GzipCompressor.js +1 -1
- package/build/utils/resourceLoaders/BaseResourceLoader.js +26 -19
- package/build/utils/resourceLoaders/StorageProviderLoader.js +1 -1
- package/build/utils/resourceLoaders/UrlResourceLoader.js +1 -1
- package/build/utils.d.ts +4 -4
- package/build/utils.js +25 -16
- package/package.json +2 -2
package/build/TIIGenerator.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import {
|
|
3
|
-
import { Encryption, Hash, Linkage, Resource } from "@super-protocol/dto-js";
|
|
2
|
+
import { Encryption, Hash, Resource, TeeRunInfo } from "@super-protocol/dto-js";
|
|
4
3
|
declare class TIIGenerator {
|
|
5
4
|
static generateByOffer(offerId: string, solutionHashes: Hash[], linkageString: string | undefined, resource: Resource, args: any, encryption: Encryption): Promise<string>;
|
|
6
5
|
static generate(orderId: string, resource: Resource, args: any, encryption: Encryption): Promise<string>;
|
|
@@ -8,14 +7,8 @@ declare class TIIGenerator {
|
|
|
8
7
|
hashes: Hash[];
|
|
9
8
|
linkage?: string;
|
|
10
9
|
}>;
|
|
11
|
-
static getTRI(tii: string, decryptionKey: Buffer): Promise<
|
|
10
|
+
static getTRI(tii: string, decryptionKey: Buffer): Promise<TeeRunInfo>;
|
|
12
11
|
static getUrl(tii: string, decryptionKey: Buffer): Promise<string>;
|
|
13
12
|
static getResource<T>(tii: string, decryptionKey: Buffer): Promise<T>;
|
|
14
13
|
}
|
|
15
|
-
export declare type TeeRunInfo = {
|
|
16
|
-
solutionHashes: Hash[];
|
|
17
|
-
linkage: Linkage;
|
|
18
|
-
args: any;
|
|
19
|
-
encryption: Encryption;
|
|
20
|
-
};
|
|
21
14
|
export default TIIGenerator;
|
package/build/TIIGenerator.js
CHANGED
|
@@ -25,7 +25,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
25
25
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
26
|
function step(op) {
|
|
27
27
|
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
-
while (_) try {
|
|
28
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
29
29
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
30
30
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
31
|
switch (op[0]) {
|
|
@@ -179,40 +179,49 @@ var TIIGenerator = /** @class */ (function () {
|
|
|
179
179
|
});
|
|
180
180
|
};
|
|
181
181
|
TIIGenerator.getTRI = function (tii, decryptionKey) {
|
|
182
|
-
var _a, _b, _c;
|
|
183
182
|
return __awaiter(this, void 0, void 0, function () {
|
|
184
|
-
var tiiObj, tri, compression, decompressed,
|
|
185
|
-
return __generator(this, function (
|
|
186
|
-
switch (
|
|
183
|
+
var tiiObj, tri, compression, decompressed, _a, decoded;
|
|
184
|
+
return __generator(this, function (_b) {
|
|
185
|
+
switch (_b.label) {
|
|
187
186
|
case 0:
|
|
188
187
|
tiiObj = JSON.parse(tii);
|
|
189
188
|
tiiObj.tri.key = decryptionKey.toString(tiiObj.tri.encoding);
|
|
190
189
|
return [4 /*yield*/, crypto_1.default.decrypt(tiiObj.tri)];
|
|
191
190
|
case 1:
|
|
192
|
-
tri =
|
|
191
|
+
tri = _b.sent();
|
|
193
192
|
compression = Compression_1.Compression.decode(Buffer.from(tri, tiiObj.tri.encoding));
|
|
194
|
-
|
|
195
|
-
switch (
|
|
193
|
+
_a = compression.type;
|
|
194
|
+
switch (_a) {
|
|
196
195
|
case Compression_1.Compression_TYPE.GZIP: return [3 /*break*/, 2];
|
|
197
196
|
}
|
|
198
197
|
return [3 /*break*/, 4];
|
|
199
198
|
case 2: return [4 /*yield*/, (0, node_gzip_1.ungzip)(compression.data)];
|
|
200
199
|
case 3:
|
|
201
|
-
decompressed =
|
|
200
|
+
decompressed = _b.sent();
|
|
202
201
|
return [3 /*break*/, 5];
|
|
203
202
|
case 4: throw Error('Unknown compression method');
|
|
204
203
|
case 5:
|
|
205
204
|
decoded = TRI_1.TRI.decode(decompressed);
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
205
|
+
return [2 /*return*/, {
|
|
206
|
+
solutionHashes: decoded.solutionHashes.map(function (hash) { return ({
|
|
207
|
+
hash: Buffer.from(hash.hash).toString(dto_js_1.Encoding.base64),
|
|
208
|
+
algo: hash.algo,
|
|
209
|
+
encoding: dto_js_1.Encoding.base64,
|
|
210
|
+
}); }),
|
|
211
|
+
linkage: {
|
|
212
|
+
encoding: dto_js_1.Encoding.base64,
|
|
213
|
+
mrenclave: Buffer.from(decoded.mrenclave).toString(dto_js_1.Encoding.base64),
|
|
214
|
+
},
|
|
215
|
+
args: decoded.args,
|
|
216
|
+
encryption: {
|
|
217
|
+
algo: decoded.encryption.algo,
|
|
218
|
+
cipher: decoded.encryption.cipher,
|
|
219
|
+
encoding: dto_js_1.Encoding.base64,
|
|
220
|
+
key: Buffer.from(decoded.encryption.key).toString(dto_js_1.Encoding.base64),
|
|
221
|
+
iv: (decoded.encryption.iv && Buffer.from(decoded.encryption.iv).toString(dto_js_1.Encoding.base64)),
|
|
222
|
+
mac: (decoded.encryption.mac && Buffer.from(decoded.encryption.mac).toString(dto_js_1.Encoding.base64)),
|
|
223
|
+
}
|
|
224
|
+
}];
|
|
216
225
|
}
|
|
217
226
|
});
|
|
218
227
|
});
|
|
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
18
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
19
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
20
|
switch (op[0]) {
|
|
@@ -40,7 +40,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
40
40
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
41
41
|
function step(op) {
|
|
42
42
|
if (f) throw new TypeError("Generator is already executing.");
|
|
43
|
-
while (_) try {
|
|
43
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
44
44
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
45
45
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
46
46
|
switch (op[0]) {
|
|
@@ -29,7 +29,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
29
29
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
30
|
function step(op) {
|
|
31
31
|
if (f) throw new TypeError("Generator is already executing.");
|
|
32
|
-
while (_) try {
|
|
32
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
33
33
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
34
34
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
35
35
|
switch (op[0]) {
|
package/build/crypto/Crypto.js
CHANGED
|
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
18
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
19
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
20
|
switch (op[0]) {
|
|
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
18
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
19
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
20
|
switch (op[0]) {
|
|
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
18
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
19
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
20
|
switch (op[0]) {
|
|
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
18
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
19
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
20
|
switch (op[0]) {
|
|
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
18
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
19
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
20
|
switch (op[0]) {
|
|
@@ -25,7 +25,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
25
25
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
26
|
function step(op) {
|
|
27
27
|
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
-
while (_) try {
|
|
28
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
29
29
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
30
30
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
31
|
switch (op[0]) {
|
package/build/models/Ballot.js
CHANGED
|
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
18
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
19
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
20
|
switch (op[0]) {
|
package/build/models/EtlModel.js
CHANGED
|
@@ -37,7 +37,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
37
37
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
38
38
|
function step(op) {
|
|
39
39
|
if (f) throw new TypeError("Generator is already executing.");
|
|
40
|
-
while (_) try {
|
|
40
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
41
41
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
42
42
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
43
43
|
switch (op[0]) {
|
package/build/models/Offer.js
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
2
8
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
9
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
10
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -14,7 +20,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
14
20
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
21
|
function step(op) {
|
|
16
22
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
23
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
24
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
25
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
26
|
switch (op[0]) {
|
|
@@ -347,6 +353,39 @@ var Offer = /** @class */ (function () {
|
|
|
347
353
|
});
|
|
348
354
|
});
|
|
349
355
|
};
|
|
356
|
+
__decorate([
|
|
357
|
+
(0, utils_1.incrementMethodCall)()
|
|
358
|
+
], Offer.prototype, "isEnabled", null);
|
|
359
|
+
__decorate([
|
|
360
|
+
(0, utils_1.incrementMethodCall)()
|
|
361
|
+
], Offer.prototype, "getInfo", null);
|
|
362
|
+
__decorate([
|
|
363
|
+
(0, utils_1.incrementMethodCall)()
|
|
364
|
+
], Offer.prototype, "getProvider", null);
|
|
365
|
+
__decorate([
|
|
366
|
+
(0, utils_1.incrementMethodCall)()
|
|
367
|
+
], Offer.prototype, "getOfferType", null);
|
|
368
|
+
__decorate([
|
|
369
|
+
(0, utils_1.incrementMethodCall)()
|
|
370
|
+
], Offer.prototype, "getProviderAuthority", null);
|
|
371
|
+
__decorate([
|
|
372
|
+
(0, utils_1.incrementMethodCall)()
|
|
373
|
+
], Offer.prototype, "getOrigins", null);
|
|
374
|
+
__decorate([
|
|
375
|
+
(0, utils_1.incrementMethodCall)()
|
|
376
|
+
], Offer.prototype, "getHoldDeposit", null);
|
|
377
|
+
__decorate([
|
|
378
|
+
(0, utils_1.incrementMethodCall)()
|
|
379
|
+
], Offer.prototype, "getClosingPrice", null);
|
|
380
|
+
__decorate([
|
|
381
|
+
(0, utils_1.incrementMethodCall)()
|
|
382
|
+
], Offer.prototype, "isOfferExists", null);
|
|
383
|
+
__decorate([
|
|
384
|
+
(0, utils_1.incrementMethodCall)()
|
|
385
|
+
], Offer.prototype, "isRestrictionsPermitThatOffer", null);
|
|
386
|
+
__decorate([
|
|
387
|
+
(0, utils_1.incrementMethodCall)()
|
|
388
|
+
], Offer.prototype, "isRestrictedByOfferType", null);
|
|
350
389
|
return Offer;
|
|
351
390
|
}());
|
|
352
391
|
exports.default = Offer;
|
package/build/models/Order.d.ts
CHANGED
|
@@ -86,7 +86,7 @@ declare class Order {
|
|
|
86
86
|
/**
|
|
87
87
|
* Function for updating status of contract
|
|
88
88
|
*/
|
|
89
|
-
updateStatus(status: OrderStatus,
|
|
89
|
+
updateStatus(status: OrderStatus, transactionOptions?: TransactionOptions): Promise<void>;
|
|
90
90
|
/**
|
|
91
91
|
* Function for updating status of contract
|
|
92
92
|
*/
|
|
@@ -136,5 +136,5 @@ declare class Order {
|
|
|
136
136
|
*/
|
|
137
137
|
onOrderStatusUpdated(callback: onOrderStatusUpdatedCallback): () => void;
|
|
138
138
|
}
|
|
139
|
-
export
|
|
139
|
+
export type onOrderStatusUpdatedCallback = (status: OrderStatus) => void;
|
|
140
140
|
export default Order;
|
package/build/models/Order.js
CHANGED
|
@@ -10,6 +10,12 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
};
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
14
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
15
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
16
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
17
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
18
|
+
};
|
|
13
19
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
20
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
21
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -25,7 +31,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
25
31
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
32
|
function step(op) {
|
|
27
33
|
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
-
while (_) try {
|
|
34
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
29
35
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
30
36
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
37
|
switch (op[0]) {
|
|
@@ -320,7 +326,7 @@ var Order = /** @class */ (function () {
|
|
|
320
326
|
/**
|
|
321
327
|
* Function for updating status of contract
|
|
322
328
|
*/
|
|
323
|
-
Order.prototype.updateStatus = function (status,
|
|
329
|
+
Order.prototype.updateStatus = function (status, transactionOptions) {
|
|
324
330
|
return __awaiter(this, void 0, void 0, function () {
|
|
325
331
|
return __generator(this, function (_a) {
|
|
326
332
|
switch (_a.label) {
|
|
@@ -578,6 +584,81 @@ var Order = /** @class */ (function () {
|
|
|
578
584
|
});
|
|
579
585
|
return function () { return subscription.unsubscribe(); };
|
|
580
586
|
};
|
|
587
|
+
__decorate([
|
|
588
|
+
(0, utils_1.incrementMethodCall)()
|
|
589
|
+
], Order.prototype, "getOrderInfo", null);
|
|
590
|
+
__decorate([
|
|
591
|
+
(0, utils_1.incrementMethodCall)()
|
|
592
|
+
], Order.prototype, "getConsumer", null);
|
|
593
|
+
__decorate([
|
|
594
|
+
(0, utils_1.incrementMethodCall)()
|
|
595
|
+
], Order.prototype, "getOrderResult", null);
|
|
596
|
+
__decorate([
|
|
597
|
+
(0, utils_1.incrementMethodCall)()
|
|
598
|
+
], Order.prototype, "getSubOrders", null);
|
|
599
|
+
__decorate([
|
|
600
|
+
(0, utils_1.incrementMethodCall)()
|
|
601
|
+
], Order.prototype, "getParentOrder", null);
|
|
602
|
+
__decorate([
|
|
603
|
+
(0, utils_1.incrementMethodCall)()
|
|
604
|
+
], Order.prototype, "getDepositSpent", null);
|
|
605
|
+
__decorate([
|
|
606
|
+
(0, utils_1.incrementMethodCall)()
|
|
607
|
+
], Order.prototype, "calculateTotalHoldDeposit", null);
|
|
608
|
+
__decorate([
|
|
609
|
+
(0, utils_1.incrementMethodCall)()
|
|
610
|
+
], Order.prototype, "calculateOrderOutputReserve", null);
|
|
611
|
+
__decorate([
|
|
612
|
+
(0, utils_1.incrementMethodCall)()
|
|
613
|
+
], Order.prototype, "calculateTotalDepositSpent", null);
|
|
614
|
+
__decorate([
|
|
615
|
+
(0, utils_1.incrementMethodCall)()
|
|
616
|
+
], Order.prototype, "calculateTotalDepositUnspent", null);
|
|
617
|
+
__decorate([
|
|
618
|
+
(0, utils_1.incrementMethodCall)()
|
|
619
|
+
], Order.prototype, "getOrigins", null);
|
|
620
|
+
__decorate([
|
|
621
|
+
(0, utils_1.incrementMethodCall)()
|
|
622
|
+
], Order.prototype, "getAwaitingPayment", null);
|
|
623
|
+
__decorate([
|
|
624
|
+
(0, utils_1.incrementMethodCall)()
|
|
625
|
+
], Order.prototype, "getStartDate", null);
|
|
626
|
+
__decorate([
|
|
627
|
+
(0, utils_1.incrementMethodCall)()
|
|
628
|
+
], Order.prototype, "setAwaitingPayment", null);
|
|
629
|
+
__decorate([
|
|
630
|
+
(0, utils_1.incrementMethodCall)()
|
|
631
|
+
], Order.prototype, "updateOrderPrice", null);
|
|
632
|
+
__decorate([
|
|
633
|
+
(0, utils_1.incrementMethodCall)()
|
|
634
|
+
], Order.prototype, "setDepositSpent", null);
|
|
635
|
+
__decorate([
|
|
636
|
+
(0, utils_1.incrementMethodCall)()
|
|
637
|
+
], Order.prototype, "updateStatus", null);
|
|
638
|
+
__decorate([
|
|
639
|
+
(0, utils_1.incrementMethodCall)()
|
|
640
|
+
], Order.prototype, "cancelOrder", null);
|
|
641
|
+
__decorate([
|
|
642
|
+
(0, utils_1.incrementMethodCall)()
|
|
643
|
+
], Order.prototype, "start", null);
|
|
644
|
+
__decorate([
|
|
645
|
+
(0, utils_1.incrementMethodCall)()
|
|
646
|
+
], Order.prototype, "updateOrderResult", null);
|
|
647
|
+
__decorate([
|
|
648
|
+
(0, utils_1.incrementMethodCall)()
|
|
649
|
+
], Order.prototype, "complete", null);
|
|
650
|
+
__decorate([
|
|
651
|
+
(0, utils_1.incrementMethodCall)()
|
|
652
|
+
], Order.prototype, "createSubOrder", null);
|
|
653
|
+
__decorate([
|
|
654
|
+
(0, utils_1.incrementMethodCall)()
|
|
655
|
+
], Order.prototype, "createSubOrders", null);
|
|
656
|
+
__decorate([
|
|
657
|
+
(0, utils_1.incrementMethodCall)()
|
|
658
|
+
], Order.prototype, "getSubOrder", null);
|
|
659
|
+
__decorate([
|
|
660
|
+
(0, utils_1.incrementMethodCall)()
|
|
661
|
+
], Order.prototype, "withdrawProfit", null);
|
|
581
662
|
return Order;
|
|
582
663
|
}());
|
|
583
664
|
exports.default = Order;
|
package/build/models/Provider.js
CHANGED
|
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
18
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
19
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
20
|
switch (op[0]) {
|
package/build/models/TCB.js
CHANGED
|
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
18
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
19
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
20
|
switch (op[0]) {
|
package/build/models/TeeOffer.js
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
2
8
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
9
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
10
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -14,7 +20,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
14
20
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
21
|
function step(op) {
|
|
16
22
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
23
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
24
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
25
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
26
|
switch (op[0]) {
|
|
@@ -455,6 +461,42 @@ var TeeOffer = /** @class */ (function () {
|
|
|
455
461
|
});
|
|
456
462
|
});
|
|
457
463
|
};
|
|
464
|
+
__decorate([
|
|
465
|
+
(0, utils_1.incrementMethodCall)()
|
|
466
|
+
], TeeOffer.prototype, "isEnabled", null);
|
|
467
|
+
__decorate([
|
|
468
|
+
(0, utils_1.incrementMethodCall)()
|
|
469
|
+
], TeeOffer.prototype, "isOfferCancelable", null);
|
|
470
|
+
__decorate([
|
|
471
|
+
(0, utils_1.incrementMethodCall)()
|
|
472
|
+
], TeeOffer.prototype, "checkInitTeeOffer", null);
|
|
473
|
+
__decorate([
|
|
474
|
+
(0, utils_1.incrementMethodCall)()
|
|
475
|
+
], TeeOffer.prototype, "getInfo", null);
|
|
476
|
+
__decorate([
|
|
477
|
+
(0, utils_1.incrementMethodCall)()
|
|
478
|
+
], TeeOffer.prototype, "getProvider", null);
|
|
479
|
+
__decorate([
|
|
480
|
+
(0, utils_1.incrementMethodCall)()
|
|
481
|
+
], TeeOffer.prototype, "getProviderAuthority", null);
|
|
482
|
+
__decorate([
|
|
483
|
+
(0, utils_1.incrementMethodCall)()
|
|
484
|
+
], TeeOffer.prototype, "getOfferType", null);
|
|
485
|
+
__decorate([
|
|
486
|
+
(0, utils_1.incrementMethodCall)()
|
|
487
|
+
], TeeOffer.prototype, "isTeeOfferVerifying", null);
|
|
488
|
+
__decorate([
|
|
489
|
+
(0, utils_1.incrementMethodCall)()
|
|
490
|
+
], TeeOffer.prototype, "getTlb", null);
|
|
491
|
+
__decorate([
|
|
492
|
+
(0, utils_1.incrementMethodCall)()
|
|
493
|
+
], TeeOffer.prototype, "getClosingPrice", null);
|
|
494
|
+
__decorate([
|
|
495
|
+
(0, utils_1.incrementMethodCall)()
|
|
496
|
+
], TeeOffer.prototype, "getOrigins", null);
|
|
497
|
+
__decorate([
|
|
498
|
+
(0, utils_1.incrementMethodCall)()
|
|
499
|
+
], TeeOffer.prototype, "addTlb", null);
|
|
458
500
|
return TeeOffer;
|
|
459
501
|
}());
|
|
460
502
|
exports.default = TeeOffer;
|
|
@@ -23,12 +23,12 @@ export declare const Compression: {
|
|
|
23
23
|
data?: Uint8Array | undefined;
|
|
24
24
|
} & { [K in Exclude<keyof I, keyof Compression>]: never; }>(object: I): Compression;
|
|
25
25
|
};
|
|
26
|
-
|
|
27
|
-
export
|
|
26
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
27
|
+
export type DeepPartial<T> = T extends Builtin ? T : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
|
|
28
28
|
[K in keyof T]?: DeepPartial<T[K]>;
|
|
29
29
|
} : Partial<T>;
|
|
30
|
-
|
|
31
|
-
export
|
|
30
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
31
|
+
export type Exact<P, I extends P> = P extends Builtin ? P : P & {
|
|
32
32
|
[K in keyof P]: Exact<P[K], I[K]>;
|
|
33
33
|
} & {
|
|
34
34
|
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
package/build/proto/TRI.d.ts
CHANGED
|
@@ -111,12 +111,12 @@ export declare const TRI: {
|
|
|
111
111
|
} & { [K_2 in Exclude<keyof I["encryption"], keyof Encryption>]: never; }) | undefined;
|
|
112
112
|
} & { [K_3 in Exclude<keyof I, keyof TRI>]: never; }>(object: I): TRI;
|
|
113
113
|
};
|
|
114
|
-
|
|
115
|
-
export
|
|
114
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
115
|
+
export type DeepPartial<T> = T extends Builtin ? T : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
|
|
116
116
|
[K in keyof T]?: DeepPartial<T[K]>;
|
|
117
117
|
} : Partial<T>;
|
|
118
|
-
|
|
119
|
-
export
|
|
118
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
119
|
+
export type Exact<P, I extends P> = P extends Builtin ? P : P & {
|
|
120
120
|
[K in keyof P]: Exact<P[K], I[K]>;
|
|
121
121
|
} & {
|
|
122
122
|
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
|
@@ -250,12 +250,12 @@ export declare const TeeProperties: {
|
|
|
250
250
|
} & { [K_4 in Exclude<keyof I["teeRunMemoryBenchmark"], keyof TeeRunMemoryBenchmark>]: never; }) | undefined;
|
|
251
251
|
} & { [K_5 in Exclude<keyof I, keyof TeeProperties>]: never; }>(object: I): TeeProperties;
|
|
252
252
|
};
|
|
253
|
-
|
|
254
|
-
export
|
|
253
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
254
|
+
export type DeepPartial<T> = T extends Builtin ? T : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
|
|
255
255
|
[K in keyof T]?: DeepPartial<T[K]>;
|
|
256
256
|
} : Partial<T>;
|
|
257
|
-
|
|
258
|
-
export
|
|
257
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
258
|
+
export type Exact<P, I extends P> = P extends Builtin ? P : P & {
|
|
259
259
|
[K in keyof P]: Exact<P[K], I[K]>;
|
|
260
260
|
} & {
|
|
261
261
|
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
|
@@ -4,13 +4,13 @@ import { Readable } from "stream";
|
|
|
4
4
|
import Offer from "../../models/Offer";
|
|
5
5
|
import StorageObject from "../../types/storage/StorageObject";
|
|
6
6
|
import IStorageProvider, { DownloadConfig } from "./IStorageProvider";
|
|
7
|
-
export
|
|
8
|
-
export
|
|
7
|
+
export type DownloadChunkMethodType = (provider: IStorageProvider, objectPath: string, chunk: ChunkType) => Promise<Buffer>;
|
|
8
|
+
export type RetryDownloadChunkOptions = {
|
|
9
9
|
retryMaxCount?: number;
|
|
10
10
|
onRetry?: (error: unknown, chunk: ChunkType, attemptLeft: number) => void;
|
|
11
11
|
retryWaitTimeFactory?: () => () => number;
|
|
12
12
|
};
|
|
13
|
-
export
|
|
13
|
+
export type ChunkType = {
|
|
14
14
|
offset: bigint;
|
|
15
15
|
length: number;
|
|
16
16
|
dataSize: bigint;
|