@super-protocol/sdk-js 0.15.0 → 0.15.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.js +129 -239
- package/build/connectors/BaseConnector.js +17 -47
- package/build/connectors/BlockchainConnector.js +222 -348
- package/build/connectors/BlockchainEventsListener.js +38 -92
- package/build/contracts/app.json +466 -35
- package/build/crypto/Crypto.js +63 -135
- package/build/crypto/index.js +1 -1
- package/build/crypto/nodejs/AES.js +62 -119
- package/build/crypto/nodejs/ARIA.js +61 -118
- package/build/crypto/nodejs/ECIES.js +51 -87
- package/build/crypto/nodejs/NativeCrypto.js +64 -118
- package/build/crypto/nodejs/RSA-Hybrid.js +54 -113
- package/build/index.d.ts +5 -0
- package/build/index.js +14 -2
- package/build/logger.d.ts +3 -1
- package/build/logger.js +2 -2
- package/build/models/EtlModel.js +65 -114
- package/build/models/Offer.js +227 -462
- package/build/models/Order.d.ts +4 -0
- package/build/models/Order.js +326 -559
- package/build/models/Provider.d.ts +2 -0
- package/build/models/Provider.js +74 -153
- package/build/models/TCB.js +67 -171
- package/build/models/TeeOffer.d.ts +1 -0
- package/build/models/TeeOffer.js +389 -731
- package/build/proto/Compression.js +20 -21
- package/build/proto/TRI.js +46 -50
- package/build/proto/TeeProperties.js +60 -66
- package/build/providers/storage/ChunksDownloadDecorator.js +125 -235
- package/build/providers/storage/S3StorageProvider.js +173 -298
- package/build/providers/storage/StorageAdapter.d.ts +60 -0
- package/build/providers/storage/StorageAdapter.js +317 -0
- package/build/providers/storage/StorageContentWriter.d.ts +39 -0
- package/build/providers/storage/StorageContentWriter.js +181 -0
- package/build/providers/storage/StorageKeyValueAdapter.d.ts +20 -0
- package/build/providers/storage/StorageKeyValueAdapter.js +152 -0
- package/build/providers/storage/StorageMetadataReader.d.ts +19 -0
- package/build/providers/storage/StorageMetadataReader.js +65 -0
- package/build/providers/storage/StorjAdapter.d.ts +19 -0
- package/build/providers/storage/StorjAdapter.js +62 -0
- package/build/providers/storage/StorjStorageProvider.js +138 -315
- package/build/providers/storage/getStorageProvider.js +7 -7
- package/build/providers/storage/types.d.ts +7 -0
- package/build/providers/storage/types.js +2 -0
- package/build/staticModels/ActiveOffers.js +32 -100
- package/build/staticModels/ActiveOrders.js +42 -120
- package/build/staticModels/BaseStaticModel.js +7 -10
- package/build/staticModels/Consensus.d.ts +4 -1
- package/build/staticModels/Consensus.js +164 -220
- package/build/staticModels/Deposits.js +109 -201
- package/build/staticModels/Marks.js +21 -82
- package/build/staticModels/ModelPackager.js +34 -84
- package/build/staticModels/Offers.js +140 -266
- package/build/staticModels/Orders.d.ts +1 -0
- package/build/staticModels/Orders.js +286 -429
- package/build/staticModels/ProviderRegistry.js +114 -225
- package/build/staticModels/Superpro.js +17 -63
- package/build/staticModels/SuperproToken.js +90 -169
- package/build/staticModels/TeeOffers.js +220 -416
- package/build/store.js +2 -2
- package/build/types/HardwareInfo.js +2 -2
- package/build/types/Order.js +4 -4
- package/build/types/Provider.js +1 -1
- package/build/types/TeeOfferInfo.js +1 -1
- package/build/types/TeeOfferOption.js +2 -2
- package/build/types/TeeOfferSlot.js +2 -2
- package/build/types/ValueOfferSlot.js +3 -3
- package/build/utils/Monitoring.js +24 -28
- package/build/utils/NonceTracker.js +56 -121
- package/build/utils/PubSub.d.ts +9 -0
- package/build/utils/PubSub.js +36 -0
- package/build/utils/TxManager.js +121 -215
- package/build/utils/compressors/GzipCompressor.js +13 -50
- package/build/utils/compressors/UncompressedCompressor.js +10 -13
- package/build/utils/helpers/tryWithInterval.js +34 -78
- package/build/utils/resourceLoaders/BaseResourceLoader.js +26 -78
- package/build/utils/resourceLoaders/StorageProviderLoader.js +33 -97
- package/build/utils/resourceLoaders/UrlResourceLoader.js +29 -93
- package/build/utils/resourceLoaders/getResourceLoader.js +6 -6
- package/build/utils.js +60 -105
- package/package.json +4 -1
|
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.Compression = exports.compression_TYPEToJSON = exports.compression_TYPEFromJSON = exports.Compression_TYPE = exports.protobufPackage = void 0;
|
|
7
7
|
/* eslint-disable */
|
|
8
|
-
|
|
8
|
+
const minimal_1 = __importDefault(require("protobufjs/minimal"));
|
|
9
9
|
exports.protobufPackage = "";
|
|
10
10
|
var Compression_TYPE;
|
|
11
11
|
(function (Compression_TYPE) {
|
|
@@ -40,8 +40,7 @@ function createBaseCompression() {
|
|
|
40
40
|
return { type: 0, data: new Uint8Array() };
|
|
41
41
|
}
|
|
42
42
|
exports.Compression = {
|
|
43
|
-
encode
|
|
44
|
-
if (writer === void 0) { writer = minimal_1.default.Writer.create(); }
|
|
43
|
+
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
45
44
|
if (message.type !== 0) {
|
|
46
45
|
writer.uint32(8).int32(message.type);
|
|
47
46
|
}
|
|
@@ -50,12 +49,12 @@ exports.Compression = {
|
|
|
50
49
|
}
|
|
51
50
|
return writer;
|
|
52
51
|
},
|
|
53
|
-
decode
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
52
|
+
decode(input, length) {
|
|
53
|
+
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
54
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
55
|
+
const message = createBaseCompression();
|
|
57
56
|
while (reader.pos < end) {
|
|
58
|
-
|
|
57
|
+
const tag = reader.uint32();
|
|
59
58
|
switch (tag >>> 3) {
|
|
60
59
|
case 1:
|
|
61
60
|
message.type = reader.int32();
|
|
@@ -70,28 +69,28 @@ exports.Compression = {
|
|
|
70
69
|
}
|
|
71
70
|
return message;
|
|
72
71
|
},
|
|
73
|
-
fromJSON
|
|
72
|
+
fromJSON(object) {
|
|
74
73
|
return {
|
|
75
74
|
type: isSet(object.type) ? compression_TYPEFromJSON(object.type) : 0,
|
|
76
75
|
data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(),
|
|
77
76
|
};
|
|
78
77
|
},
|
|
79
|
-
toJSON
|
|
80
|
-
|
|
78
|
+
toJSON(message) {
|
|
79
|
+
const obj = {};
|
|
81
80
|
message.type !== undefined && (obj.type = compression_TYPEToJSON(message.type));
|
|
82
81
|
message.data !== undefined &&
|
|
83
82
|
(obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array()));
|
|
84
83
|
return obj;
|
|
85
84
|
},
|
|
86
|
-
fromPartial
|
|
85
|
+
fromPartial(object) {
|
|
87
86
|
var _a, _b;
|
|
88
|
-
|
|
87
|
+
const message = createBaseCompression();
|
|
89
88
|
message.type = (_a = object.type) !== null && _a !== void 0 ? _a : 0;
|
|
90
89
|
message.data = (_b = object.data) !== null && _b !== void 0 ? _b : new Uint8Array();
|
|
91
90
|
return message;
|
|
92
91
|
},
|
|
93
92
|
};
|
|
94
|
-
var globalThis = (
|
|
93
|
+
var globalThis = (() => {
|
|
95
94
|
if (typeof globalThis !== "undefined")
|
|
96
95
|
return globalThis;
|
|
97
96
|
if (typeof self !== "undefined")
|
|
@@ -107,9 +106,9 @@ function bytesFromBase64(b64) {
|
|
|
107
106
|
return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
|
|
108
107
|
}
|
|
109
108
|
else {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
for (
|
|
109
|
+
const bin = globalThis.atob(b64);
|
|
110
|
+
const arr = new Uint8Array(bin.length);
|
|
111
|
+
for (let i = 0; i < bin.length; ++i) {
|
|
113
112
|
arr[i] = bin.charCodeAt(i);
|
|
114
113
|
}
|
|
115
114
|
return arr;
|
|
@@ -120,11 +119,11 @@ function base64FromBytes(arr) {
|
|
|
120
119
|
return globalThis.Buffer.from(arr).toString("base64");
|
|
121
120
|
}
|
|
122
121
|
else {
|
|
123
|
-
|
|
124
|
-
arr.forEach(
|
|
125
|
-
|
|
122
|
+
const bin = [];
|
|
123
|
+
arr.forEach((byte) => {
|
|
124
|
+
bin.push(String.fromCharCode(byte));
|
|
126
125
|
});
|
|
127
|
-
return globalThis.btoa(
|
|
126
|
+
return globalThis.btoa(bin.join(""));
|
|
128
127
|
}
|
|
129
128
|
}
|
|
130
129
|
function isSet(value) {
|
package/build/proto/TRI.js
CHANGED
|
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.TRI = exports.Hash = exports.Encryption = exports.protobufPackage = void 0;
|
|
7
7
|
/* eslint-disable */
|
|
8
|
-
|
|
8
|
+
const minimal_1 = __importDefault(require("protobufjs/minimal"));
|
|
9
9
|
exports.protobufPackage = "";
|
|
10
10
|
function createBaseEncryption() {
|
|
11
11
|
return {
|
|
@@ -19,8 +19,7 @@ function createBaseEncryption() {
|
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
21
|
exports.Encryption = {
|
|
22
|
-
encode
|
|
23
|
-
if (writer === void 0) { writer = minimal_1.default.Writer.create(); }
|
|
22
|
+
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
24
23
|
if (message.algo !== "") {
|
|
25
24
|
writer.uint32(10).string(message.algo);
|
|
26
25
|
}
|
|
@@ -44,12 +43,12 @@ exports.Encryption = {
|
|
|
44
43
|
}
|
|
45
44
|
return writer;
|
|
46
45
|
},
|
|
47
|
-
decode
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
46
|
+
decode(input, length) {
|
|
47
|
+
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
48
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
49
|
+
const message = createBaseEncryption();
|
|
51
50
|
while (reader.pos < end) {
|
|
52
|
-
|
|
51
|
+
const tag = reader.uint32();
|
|
53
52
|
switch (tag >>> 3) {
|
|
54
53
|
case 1:
|
|
55
54
|
message.algo = reader.string();
|
|
@@ -79,7 +78,7 @@ exports.Encryption = {
|
|
|
79
78
|
}
|
|
80
79
|
return message;
|
|
81
80
|
},
|
|
82
|
-
fromJSON
|
|
81
|
+
fromJSON(object) {
|
|
83
82
|
return {
|
|
84
83
|
algo: isSet(object.algo) ? String(object.algo) : "",
|
|
85
84
|
key: isSet(object.key) ? bytesFromBase64(object.key) : undefined,
|
|
@@ -90,8 +89,8 @@ exports.Encryption = {
|
|
|
90
89
|
encoding: isSet(object.encoding) ? String(object.encoding) : "",
|
|
91
90
|
};
|
|
92
91
|
},
|
|
93
|
-
toJSON
|
|
94
|
-
|
|
92
|
+
toJSON(message) {
|
|
93
|
+
const obj = {};
|
|
95
94
|
message.algo !== undefined && (obj.algo = message.algo);
|
|
96
95
|
message.key !== undefined && (obj.key = message.key !== undefined ? base64FromBytes(message.key) : undefined);
|
|
97
96
|
message.cipher !== undefined && (obj.cipher = message.cipher);
|
|
@@ -102,9 +101,9 @@ exports.Encryption = {
|
|
|
102
101
|
message.encoding !== undefined && (obj.encoding = message.encoding);
|
|
103
102
|
return obj;
|
|
104
103
|
},
|
|
105
|
-
fromPartial
|
|
104
|
+
fromPartial(object) {
|
|
106
105
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
107
|
-
|
|
106
|
+
const message = createBaseEncryption();
|
|
108
107
|
message.algo = (_a = object.algo) !== null && _a !== void 0 ? _a : "";
|
|
109
108
|
message.key = (_b = object.key) !== null && _b !== void 0 ? _b : undefined;
|
|
110
109
|
message.cipher = (_c = object.cipher) !== null && _c !== void 0 ? _c : undefined;
|
|
@@ -119,8 +118,7 @@ function createBaseHash() {
|
|
|
119
118
|
return { algo: "", hash: new Uint8Array() };
|
|
120
119
|
}
|
|
121
120
|
exports.Hash = {
|
|
122
|
-
encode
|
|
123
|
-
if (writer === void 0) { writer = minimal_1.default.Writer.create(); }
|
|
121
|
+
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
124
122
|
if (message.algo !== "") {
|
|
125
123
|
writer.uint32(10).string(message.algo);
|
|
126
124
|
}
|
|
@@ -129,12 +127,12 @@ exports.Hash = {
|
|
|
129
127
|
}
|
|
130
128
|
return writer;
|
|
131
129
|
},
|
|
132
|
-
decode
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
130
|
+
decode(input, length) {
|
|
131
|
+
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
132
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
133
|
+
const message = createBaseHash();
|
|
136
134
|
while (reader.pos < end) {
|
|
137
|
-
|
|
135
|
+
const tag = reader.uint32();
|
|
138
136
|
switch (tag >>> 3) {
|
|
139
137
|
case 1:
|
|
140
138
|
message.algo = reader.string();
|
|
@@ -149,22 +147,22 @@ exports.Hash = {
|
|
|
149
147
|
}
|
|
150
148
|
return message;
|
|
151
149
|
},
|
|
152
|
-
fromJSON
|
|
150
|
+
fromJSON(object) {
|
|
153
151
|
return {
|
|
154
152
|
algo: isSet(object.algo) ? String(object.algo) : "",
|
|
155
153
|
hash: isSet(object.hash) ? bytesFromBase64(object.hash) : new Uint8Array(),
|
|
156
154
|
};
|
|
157
155
|
},
|
|
158
|
-
toJSON
|
|
159
|
-
|
|
156
|
+
toJSON(message) {
|
|
157
|
+
const obj = {};
|
|
160
158
|
message.algo !== undefined && (obj.algo = message.algo);
|
|
161
159
|
message.hash !== undefined &&
|
|
162
160
|
(obj.hash = base64FromBytes(message.hash !== undefined ? message.hash : new Uint8Array()));
|
|
163
161
|
return obj;
|
|
164
162
|
},
|
|
165
|
-
fromPartial
|
|
163
|
+
fromPartial(object) {
|
|
166
164
|
var _a, _b;
|
|
167
|
-
|
|
165
|
+
const message = createBaseHash();
|
|
168
166
|
message.algo = (_a = object.algo) !== null && _a !== void 0 ? _a : "";
|
|
169
167
|
message.hash = (_b = object.hash) !== null && _b !== void 0 ? _b : new Uint8Array();
|
|
170
168
|
return message;
|
|
@@ -174,10 +172,8 @@ function createBaseTRI() {
|
|
|
174
172
|
return { solutionHashes: [], mrenclave: new Uint8Array(), args: "", encryption: undefined };
|
|
175
173
|
}
|
|
176
174
|
exports.TRI = {
|
|
177
|
-
encode
|
|
178
|
-
|
|
179
|
-
for (var _i = 0, _a = message.solutionHashes; _i < _a.length; _i++) {
|
|
180
|
-
var v = _a[_i];
|
|
175
|
+
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
176
|
+
for (const v of message.solutionHashes) {
|
|
181
177
|
exports.Hash.encode(v, writer.uint32(10).fork()).ldelim();
|
|
182
178
|
}
|
|
183
179
|
if (message.mrenclave.length !== 0) {
|
|
@@ -191,12 +187,12 @@ exports.TRI = {
|
|
|
191
187
|
}
|
|
192
188
|
return writer;
|
|
193
189
|
},
|
|
194
|
-
decode
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
190
|
+
decode(input, length) {
|
|
191
|
+
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
192
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
193
|
+
const message = createBaseTRI();
|
|
198
194
|
while (reader.pos < end) {
|
|
199
|
-
|
|
195
|
+
const tag = reader.uint32();
|
|
200
196
|
switch (tag >>> 3) {
|
|
201
197
|
case 1:
|
|
202
198
|
message.solutionHashes.push(exports.Hash.decode(reader, reader.uint32()));
|
|
@@ -217,20 +213,20 @@ exports.TRI = {
|
|
|
217
213
|
}
|
|
218
214
|
return message;
|
|
219
215
|
},
|
|
220
|
-
fromJSON
|
|
216
|
+
fromJSON(object) {
|
|
221
217
|
return {
|
|
222
218
|
solutionHashes: Array.isArray(object === null || object === void 0 ? void 0 : object.solutionHashes)
|
|
223
|
-
? object.solutionHashes.map(
|
|
219
|
+
? object.solutionHashes.map((e) => exports.Hash.fromJSON(e))
|
|
224
220
|
: [],
|
|
225
221
|
mrenclave: isSet(object.mrenclave) ? bytesFromBase64(object.mrenclave) : new Uint8Array(),
|
|
226
222
|
args: isSet(object.args) ? String(object.args) : "",
|
|
227
223
|
encryption: isSet(object.encryption) ? exports.Encryption.fromJSON(object.encryption) : undefined,
|
|
228
224
|
};
|
|
229
225
|
},
|
|
230
|
-
toJSON
|
|
231
|
-
|
|
226
|
+
toJSON(message) {
|
|
227
|
+
const obj = {};
|
|
232
228
|
if (message.solutionHashes) {
|
|
233
|
-
obj.solutionHashes = message.solutionHashes.map(
|
|
229
|
+
obj.solutionHashes = message.solutionHashes.map((e) => (e ? exports.Hash.toJSON(e) : undefined));
|
|
234
230
|
}
|
|
235
231
|
else {
|
|
236
232
|
obj.solutionHashes = [];
|
|
@@ -242,10 +238,10 @@ exports.TRI = {
|
|
|
242
238
|
(obj.encryption = message.encryption ? exports.Encryption.toJSON(message.encryption) : undefined);
|
|
243
239
|
return obj;
|
|
244
240
|
},
|
|
245
|
-
fromPartial
|
|
241
|
+
fromPartial(object) {
|
|
246
242
|
var _a, _b, _c;
|
|
247
|
-
|
|
248
|
-
message.solutionHashes = ((_a = object.solutionHashes) === null || _a === void 0 ? void 0 : _a.map(
|
|
243
|
+
const message = createBaseTRI();
|
|
244
|
+
message.solutionHashes = ((_a = object.solutionHashes) === null || _a === void 0 ? void 0 : _a.map((e) => exports.Hash.fromPartial(e))) || [];
|
|
249
245
|
message.mrenclave = (_b = object.mrenclave) !== null && _b !== void 0 ? _b : new Uint8Array();
|
|
250
246
|
message.args = (_c = object.args) !== null && _c !== void 0 ? _c : "";
|
|
251
247
|
message.encryption =
|
|
@@ -255,7 +251,7 @@ exports.TRI = {
|
|
|
255
251
|
return message;
|
|
256
252
|
},
|
|
257
253
|
};
|
|
258
|
-
var globalThis = (
|
|
254
|
+
var globalThis = (() => {
|
|
259
255
|
if (typeof globalThis !== "undefined")
|
|
260
256
|
return globalThis;
|
|
261
257
|
if (typeof self !== "undefined")
|
|
@@ -271,9 +267,9 @@ function bytesFromBase64(b64) {
|
|
|
271
267
|
return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
|
|
272
268
|
}
|
|
273
269
|
else {
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
for (
|
|
270
|
+
const bin = globalThis.atob(b64);
|
|
271
|
+
const arr = new Uint8Array(bin.length);
|
|
272
|
+
for (let i = 0; i < bin.length; ++i) {
|
|
277
273
|
arr[i] = bin.charCodeAt(i);
|
|
278
274
|
}
|
|
279
275
|
return arr;
|
|
@@ -284,11 +280,11 @@ function base64FromBytes(arr) {
|
|
|
284
280
|
return globalThis.Buffer.from(arr).toString("base64");
|
|
285
281
|
}
|
|
286
282
|
else {
|
|
287
|
-
|
|
288
|
-
arr.forEach(
|
|
289
|
-
|
|
283
|
+
const bin = [];
|
|
284
|
+
arr.forEach((byte) => {
|
|
285
|
+
bin.push(String.fromCharCode(byte));
|
|
290
286
|
});
|
|
291
|
-
return globalThis.btoa(
|
|
287
|
+
return globalThis.btoa(bin.join(""));
|
|
292
288
|
}
|
|
293
289
|
}
|
|
294
290
|
function isSet(value) {
|
|
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.TeeProperties = exports.TeeRunMemoryBenchmark = exports.TeeRunCpuBenchmark = exports.TeeDeviceInfo = exports.Cpus = exports.protobufPackage = void 0;
|
|
7
7
|
/* eslint-disable */
|
|
8
|
-
|
|
8
|
+
const minimal_1 = __importDefault(require("protobufjs/minimal"));
|
|
9
9
|
exports.protobufPackage = "";
|
|
10
10
|
function createBaseCpus() {
|
|
11
11
|
return {
|
|
@@ -20,8 +20,7 @@ function createBaseCpus() {
|
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
22
|
exports.Cpus = {
|
|
23
|
-
encode
|
|
24
|
-
if (writer === void 0) { writer = minimal_1.default.Writer.create(); }
|
|
23
|
+
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
25
24
|
if (message.vendorId !== "") {
|
|
26
25
|
writer.uint32(10).string(message.vendorId);
|
|
27
26
|
}
|
|
@@ -48,12 +47,12 @@ exports.Cpus = {
|
|
|
48
47
|
}
|
|
49
48
|
return writer;
|
|
50
49
|
},
|
|
51
|
-
decode
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
50
|
+
decode(input, length) {
|
|
51
|
+
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
52
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
53
|
+
const message = createBaseCpus();
|
|
55
54
|
while (reader.pos < end) {
|
|
56
|
-
|
|
55
|
+
const tag = reader.uint32();
|
|
57
56
|
switch (tag >>> 3) {
|
|
58
57
|
case 1:
|
|
59
58
|
message.vendorId = reader.string();
|
|
@@ -86,7 +85,7 @@ exports.Cpus = {
|
|
|
86
85
|
}
|
|
87
86
|
return message;
|
|
88
87
|
},
|
|
89
|
-
fromJSON
|
|
88
|
+
fromJSON(object) {
|
|
90
89
|
return {
|
|
91
90
|
vendorId: isSet(object.vendorId) ? String(object.vendorId) : "",
|
|
92
91
|
cpuFamily: isSet(object.cpuFamily) ? Number(object.cpuFamily) : 0,
|
|
@@ -98,8 +97,8 @@ exports.Cpus = {
|
|
|
98
97
|
maxFreq: isSet(object.maxFreq) ? Number(object.maxFreq) : 0,
|
|
99
98
|
};
|
|
100
99
|
},
|
|
101
|
-
toJSON
|
|
102
|
-
|
|
100
|
+
toJSON(message) {
|
|
101
|
+
const obj = {};
|
|
103
102
|
message.vendorId !== undefined && (obj.vendorId = message.vendorId);
|
|
104
103
|
message.cpuFamily !== undefined && (obj.cpuFamily = Math.round(message.cpuFamily));
|
|
105
104
|
message.model !== undefined && (obj.model = Math.round(message.model));
|
|
@@ -110,9 +109,9 @@ exports.Cpus = {
|
|
|
110
109
|
message.maxFreq !== undefined && (obj.maxFreq = Math.round(message.maxFreq));
|
|
111
110
|
return obj;
|
|
112
111
|
},
|
|
113
|
-
fromPartial
|
|
112
|
+
fromPartial(object) {
|
|
114
113
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
115
|
-
|
|
114
|
+
const message = createBaseCpus();
|
|
116
115
|
message.vendorId = (_a = object.vendorId) !== null && _a !== void 0 ? _a : "";
|
|
117
116
|
message.cpuFamily = (_b = object.cpuFamily) !== null && _b !== void 0 ? _b : 0;
|
|
118
117
|
message.model = (_c = object.model) !== null && _c !== void 0 ? _c : 0;
|
|
@@ -128,10 +127,8 @@ function createBaseTeeDeviceInfo() {
|
|
|
128
127
|
return { cpus: [], memSize: 0, totalPhysicalCores: 0, totalLogicalCores: 0 };
|
|
129
128
|
}
|
|
130
129
|
exports.TeeDeviceInfo = {
|
|
131
|
-
encode
|
|
132
|
-
|
|
133
|
-
for (var _i = 0, _a = message.cpus; _i < _a.length; _i++) {
|
|
134
|
-
var v = _a[_i];
|
|
130
|
+
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
131
|
+
for (const v of message.cpus) {
|
|
135
132
|
exports.Cpus.encode(v, writer.uint32(10).fork()).ldelim();
|
|
136
133
|
}
|
|
137
134
|
if (message.memSize !== 0) {
|
|
@@ -145,12 +142,12 @@ exports.TeeDeviceInfo = {
|
|
|
145
142
|
}
|
|
146
143
|
return writer;
|
|
147
144
|
},
|
|
148
|
-
decode
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
145
|
+
decode(input, length) {
|
|
146
|
+
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
147
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
148
|
+
const message = createBaseTeeDeviceInfo();
|
|
152
149
|
while (reader.pos < end) {
|
|
153
|
-
|
|
150
|
+
const tag = reader.uint32();
|
|
154
151
|
switch (tag >>> 3) {
|
|
155
152
|
case 1:
|
|
156
153
|
message.cpus.push(exports.Cpus.decode(reader, reader.uint32()));
|
|
@@ -171,18 +168,18 @@ exports.TeeDeviceInfo = {
|
|
|
171
168
|
}
|
|
172
169
|
return message;
|
|
173
170
|
},
|
|
174
|
-
fromJSON
|
|
171
|
+
fromJSON(object) {
|
|
175
172
|
return {
|
|
176
|
-
cpus: Array.isArray(object === null || object === void 0 ? void 0 : object.cpus) ? object.cpus.map(
|
|
173
|
+
cpus: Array.isArray(object === null || object === void 0 ? void 0 : object.cpus) ? object.cpus.map((e) => exports.Cpus.fromJSON(e)) : [],
|
|
177
174
|
memSize: isSet(object.memSize) ? Number(object.memSize) : 0,
|
|
178
175
|
totalPhysicalCores: isSet(object.totalPhysicalCores) ? Number(object.totalPhysicalCores) : 0,
|
|
179
176
|
totalLogicalCores: isSet(object.totalLogicalCores) ? Number(object.totalLogicalCores) : 0,
|
|
180
177
|
};
|
|
181
178
|
},
|
|
182
|
-
toJSON
|
|
183
|
-
|
|
179
|
+
toJSON(message) {
|
|
180
|
+
const obj = {};
|
|
184
181
|
if (message.cpus) {
|
|
185
|
-
obj.cpus = message.cpus.map(
|
|
182
|
+
obj.cpus = message.cpus.map((e) => (e ? exports.Cpus.toJSON(e) : undefined));
|
|
186
183
|
}
|
|
187
184
|
else {
|
|
188
185
|
obj.cpus = [];
|
|
@@ -192,10 +189,10 @@ exports.TeeDeviceInfo = {
|
|
|
192
189
|
message.totalLogicalCores !== undefined && (obj.totalLogicalCores = Math.round(message.totalLogicalCores));
|
|
193
190
|
return obj;
|
|
194
191
|
},
|
|
195
|
-
fromPartial
|
|
192
|
+
fromPartial(object) {
|
|
196
193
|
var _a, _b, _c, _d;
|
|
197
|
-
|
|
198
|
-
message.cpus = ((_a = object.cpus) === null || _a === void 0 ? void 0 : _a.map(
|
|
194
|
+
const message = createBaseTeeDeviceInfo();
|
|
195
|
+
message.cpus = ((_a = object.cpus) === null || _a === void 0 ? void 0 : _a.map((e) => exports.Cpus.fromPartial(e))) || [];
|
|
199
196
|
message.memSize = (_b = object.memSize) !== null && _b !== void 0 ? _b : 0;
|
|
200
197
|
message.totalPhysicalCores = (_c = object.totalPhysicalCores) !== null && _c !== void 0 ? _c : 0;
|
|
201
198
|
message.totalLogicalCores = (_d = object.totalLogicalCores) !== null && _d !== void 0 ? _d : 0;
|
|
@@ -206,8 +203,7 @@ function createBaseTeeRunCpuBenchmark() {
|
|
|
206
203
|
return { cpuScore: 0, cpuBenchmark: "", cpuCoresCount: 0 };
|
|
207
204
|
}
|
|
208
205
|
exports.TeeRunCpuBenchmark = {
|
|
209
|
-
encode
|
|
210
|
-
if (writer === void 0) { writer = minimal_1.default.Writer.create(); }
|
|
206
|
+
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
211
207
|
if (message.cpuScore !== 0) {
|
|
212
208
|
writer.uint32(8).int32(message.cpuScore);
|
|
213
209
|
}
|
|
@@ -219,12 +215,12 @@ exports.TeeRunCpuBenchmark = {
|
|
|
219
215
|
}
|
|
220
216
|
return writer;
|
|
221
217
|
},
|
|
222
|
-
decode
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
218
|
+
decode(input, length) {
|
|
219
|
+
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
220
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
221
|
+
const message = createBaseTeeRunCpuBenchmark();
|
|
226
222
|
while (reader.pos < end) {
|
|
227
|
-
|
|
223
|
+
const tag = reader.uint32();
|
|
228
224
|
switch (tag >>> 3) {
|
|
229
225
|
case 1:
|
|
230
226
|
message.cpuScore = reader.int32();
|
|
@@ -242,23 +238,23 @@ exports.TeeRunCpuBenchmark = {
|
|
|
242
238
|
}
|
|
243
239
|
return message;
|
|
244
240
|
},
|
|
245
|
-
fromJSON
|
|
241
|
+
fromJSON(object) {
|
|
246
242
|
return {
|
|
247
243
|
cpuScore: isSet(object.cpuScore) ? Number(object.cpuScore) : 0,
|
|
248
244
|
cpuBenchmark: isSet(object.cpuBenchmark) ? String(object.cpuBenchmark) : "",
|
|
249
245
|
cpuCoresCount: isSet(object.cpuCoresCount) ? Number(object.cpuCoresCount) : 0,
|
|
250
246
|
};
|
|
251
247
|
},
|
|
252
|
-
toJSON
|
|
253
|
-
|
|
248
|
+
toJSON(message) {
|
|
249
|
+
const obj = {};
|
|
254
250
|
message.cpuScore !== undefined && (obj.cpuScore = Math.round(message.cpuScore));
|
|
255
251
|
message.cpuBenchmark !== undefined && (obj.cpuBenchmark = message.cpuBenchmark);
|
|
256
252
|
message.cpuCoresCount !== undefined && (obj.cpuCoresCount = Math.round(message.cpuCoresCount));
|
|
257
253
|
return obj;
|
|
258
254
|
},
|
|
259
|
-
fromPartial
|
|
255
|
+
fromPartial(object) {
|
|
260
256
|
var _a, _b, _c;
|
|
261
|
-
|
|
257
|
+
const message = createBaseTeeRunCpuBenchmark();
|
|
262
258
|
message.cpuScore = (_a = object.cpuScore) !== null && _a !== void 0 ? _a : 0;
|
|
263
259
|
message.cpuBenchmark = (_b = object.cpuBenchmark) !== null && _b !== void 0 ? _b : "";
|
|
264
260
|
message.cpuCoresCount = (_c = object.cpuCoresCount) !== null && _c !== void 0 ? _c : 0;
|
|
@@ -269,8 +265,7 @@ function createBaseTeeRunMemoryBenchmark() {
|
|
|
269
265
|
return { memBandwidth: 0, meConfirmedSize: 0 };
|
|
270
266
|
}
|
|
271
267
|
exports.TeeRunMemoryBenchmark = {
|
|
272
|
-
encode
|
|
273
|
-
if (writer === void 0) { writer = minimal_1.default.Writer.create(); }
|
|
268
|
+
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
274
269
|
if (message.memBandwidth !== 0) {
|
|
275
270
|
writer.uint32(8).int32(message.memBandwidth);
|
|
276
271
|
}
|
|
@@ -279,12 +274,12 @@ exports.TeeRunMemoryBenchmark = {
|
|
|
279
274
|
}
|
|
280
275
|
return writer;
|
|
281
276
|
},
|
|
282
|
-
decode
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
277
|
+
decode(input, length) {
|
|
278
|
+
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
279
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
280
|
+
const message = createBaseTeeRunMemoryBenchmark();
|
|
286
281
|
while (reader.pos < end) {
|
|
287
|
-
|
|
282
|
+
const tag = reader.uint32();
|
|
288
283
|
switch (tag >>> 3) {
|
|
289
284
|
case 1:
|
|
290
285
|
message.memBandwidth = reader.int32();
|
|
@@ -299,21 +294,21 @@ exports.TeeRunMemoryBenchmark = {
|
|
|
299
294
|
}
|
|
300
295
|
return message;
|
|
301
296
|
},
|
|
302
|
-
fromJSON
|
|
297
|
+
fromJSON(object) {
|
|
303
298
|
return {
|
|
304
299
|
memBandwidth: isSet(object.memBandwidth) ? Number(object.memBandwidth) : 0,
|
|
305
300
|
meConfirmedSize: isSet(object.meConfirmedSize) ? Number(object.meConfirmedSize) : 0,
|
|
306
301
|
};
|
|
307
302
|
},
|
|
308
|
-
toJSON
|
|
309
|
-
|
|
303
|
+
toJSON(message) {
|
|
304
|
+
const obj = {};
|
|
310
305
|
message.memBandwidth !== undefined && (obj.memBandwidth = Math.round(message.memBandwidth));
|
|
311
306
|
message.meConfirmedSize !== undefined && (obj.meConfirmedSize = Math.round(message.meConfirmedSize));
|
|
312
307
|
return obj;
|
|
313
308
|
},
|
|
314
|
-
fromPartial
|
|
309
|
+
fromPartial(object) {
|
|
315
310
|
var _a, _b;
|
|
316
|
-
|
|
311
|
+
const message = createBaseTeeRunMemoryBenchmark();
|
|
317
312
|
message.memBandwidth = (_a = object.memBandwidth) !== null && _a !== void 0 ? _a : 0;
|
|
318
313
|
message.meConfirmedSize = (_b = object.meConfirmedSize) !== null && _b !== void 0 ? _b : 0;
|
|
319
314
|
return message;
|
|
@@ -323,8 +318,7 @@ function createBaseTeeProperties() {
|
|
|
323
318
|
return { teeDeviceInfo: undefined, teeRunCpuBenchmark: undefined, teeRunMemoryBenchmark: undefined };
|
|
324
319
|
}
|
|
325
320
|
exports.TeeProperties = {
|
|
326
|
-
encode
|
|
327
|
-
if (writer === void 0) { writer = minimal_1.default.Writer.create(); }
|
|
321
|
+
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
328
322
|
if (message.teeDeviceInfo !== undefined) {
|
|
329
323
|
exports.TeeDeviceInfo.encode(message.teeDeviceInfo, writer.uint32(10).fork()).ldelim();
|
|
330
324
|
}
|
|
@@ -336,12 +330,12 @@ exports.TeeProperties = {
|
|
|
336
330
|
}
|
|
337
331
|
return writer;
|
|
338
332
|
},
|
|
339
|
-
decode
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
333
|
+
decode(input, length) {
|
|
334
|
+
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
335
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
336
|
+
const message = createBaseTeeProperties();
|
|
343
337
|
while (reader.pos < end) {
|
|
344
|
-
|
|
338
|
+
const tag = reader.uint32();
|
|
345
339
|
switch (tag >>> 3) {
|
|
346
340
|
case 1:
|
|
347
341
|
message.teeDeviceInfo = exports.TeeDeviceInfo.decode(reader, reader.uint32());
|
|
@@ -359,7 +353,7 @@ exports.TeeProperties = {
|
|
|
359
353
|
}
|
|
360
354
|
return message;
|
|
361
355
|
},
|
|
362
|
-
fromJSON
|
|
356
|
+
fromJSON(object) {
|
|
363
357
|
return {
|
|
364
358
|
teeDeviceInfo: isSet(object.teeDeviceInfo) ? exports.TeeDeviceInfo.fromJSON(object.teeDeviceInfo) : undefined,
|
|
365
359
|
teeRunCpuBenchmark: isSet(object.teeRunCpuBenchmark)
|
|
@@ -370,8 +364,8 @@ exports.TeeProperties = {
|
|
|
370
364
|
: undefined,
|
|
371
365
|
};
|
|
372
366
|
},
|
|
373
|
-
toJSON
|
|
374
|
-
|
|
367
|
+
toJSON(message) {
|
|
368
|
+
const obj = {};
|
|
375
369
|
message.teeDeviceInfo !== undefined &&
|
|
376
370
|
(obj.teeDeviceInfo = message.teeDeviceInfo ? exports.TeeDeviceInfo.toJSON(message.teeDeviceInfo) : undefined);
|
|
377
371
|
message.teeRunCpuBenchmark !== undefined &&
|
|
@@ -384,8 +378,8 @@ exports.TeeProperties = {
|
|
|
384
378
|
: undefined);
|
|
385
379
|
return obj;
|
|
386
380
|
},
|
|
387
|
-
fromPartial
|
|
388
|
-
|
|
381
|
+
fromPartial(object) {
|
|
382
|
+
const message = createBaseTeeProperties();
|
|
389
383
|
message.teeDeviceInfo =
|
|
390
384
|
object.teeDeviceInfo !== undefined && object.teeDeviceInfo !== null
|
|
391
385
|
? exports.TeeDeviceInfo.fromPartial(object.teeDeviceInfo)
|