zkcloudworker 0.5.2 → 0.5.4
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/ts/src/api/api.js +1 -1
- package/lib/ts/src/index.d.ts +3 -2
- package/lib/ts/src/index.js +3 -2
- package/lib/ts/src/utils/base64.d.ts +5 -0
- package/lib/ts/src/utils/base64.js +90 -0
- package/lib/ts/src/{fetch.js → utils/fetch.js} +24 -6
- package/lib/ts/src/utils/fields.d.ts +3 -0
- package/lib/ts/src/utils/fields.js +33 -0
- package/lib/ts/tsconfig.tsbuildinfo +1 -1
- package/lib/web/src/api/api.js +264 -287
- package/lib/web/src/api/api.js.map +1 -1
- package/lib/web/src/cloud/cloud.js +12 -25
- package/lib/web/src/cloud/cloud.js.map +1 -1
- package/lib/web/src/cloud/files.js +59 -68
- package/lib/web/src/cloud/files.js.map +1 -1
- package/lib/web/src/cloud/local.js +221 -259
- package/lib/web/src/cloud/local.js.map +1 -1
- package/lib/web/src/encryption/encryption.js +2 -5
- package/lib/web/src/encryption/encryption.js.map +1 -1
- package/lib/web/src/encryption/messages.js +24 -29
- package/lib/web/src/encryption/messages.js.map +1 -1
- package/lib/web/src/encryption/nats-client.js +67 -83
- package/lib/web/src/encryption/nats-client.js.map +1 -1
- package/lib/web/src/fee.js +3 -6
- package/lib/web/src/fee.js.map +1 -1
- package/lib/web/src/index.d.ts +3 -2
- package/lib/web/src/index.js +3 -2
- package/lib/web/src/index.js.map +1 -1
- package/lib/web/src/mina.js +60 -67
- package/lib/web/src/mina.js.map +1 -1
- package/lib/web/src/utils/base64.d.ts +5 -0
- package/lib/web/src/utils/base64.js +84 -0
- package/lib/web/src/utils/base64.js.map +1 -0
- package/lib/web/src/utils/fetch.js +79 -0
- package/lib/web/src/utils/fetch.js.map +1 -0
- package/lib/web/src/utils/fields.d.ts +3 -0
- package/lib/web/src/utils/fields.js +29 -0
- package/lib/web/src/utils/fields.js.map +1 -0
- package/lib/web/tsconfig.web.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/lib/ts/src/api/client-api.d.ts +0 -147
- package/lib/ts/src/api/client-api.js +0 -122
- package/lib/web/src/api/client-api.d.ts +0 -147
- package/lib/web/src/api/client-api.js +0 -134
- package/lib/web/src/api/client-api.js.map +0 -1
- package/lib/web/src/fetch.js +0 -68
- package/lib/web/src/fetch.js.map +0 -1
- /package/lib/ts/src/{fetch.d.ts → utils/fetch.d.ts} +0 -0
- /package/lib/web/src/{fetch.d.ts → utils/fetch.d.ts} +0 -0
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../../../../src/api/api.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../../../../src/api/api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAc,MAAM,OAAO,CAAC;AACnC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,MAAM,MAAM,WAAW,CAAC;AAG/B,MAAM,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,GAAG,MAAM,CAAC;AAUzD;;;;GAIG;AACH,MAAM,OAAO,mBAAmB;IAO9B;;;OAGG;IACH,YAAY,MAKX;QACC,MAAM,EAAE,GAAG,EAAE,aAAa,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC;QACtD,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,QAAQ,GAAG,iBAAiB,CAAC;QAClC,IAAI,CAAC,KAAK,GAAG,KAAK,IAAI,QAAQ,CAAC;QAC/B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,GAAG,KAAK,OAAO,EAAE,CAAC;YACpB,IAAI,aAAa,KAAK,SAAS;gBAC7B,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAC;YACvD,IAAI,CAAC,WAAW,GAAG,aA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KAAK,KAAK,SAAS;YAAE,OAAO,IAAI,CAAC;QAChE,OAAO,KAAK,CAAC;IACf,CAAC;CACF"}
|
@@ -1,4 +1,3 @@
|
|
1
|
-
import { __awaiter } from "tslib";
|
2
1
|
export class Cloud {
|
3
2
|
constructor(params) {
|
4
3
|
const { id, jobId, stepId, taskId, cache, developer, repo, task, userId, args, metadata, isLocalCloud, chain, } = params;
|
@@ -13,7 +12,7 @@ export class Cloud {
|
|
13
12
|
this.userId = userId;
|
14
13
|
this.args = args;
|
15
14
|
this.metadata = metadata;
|
16
|
-
this.isLocalCloud = isLocalCloud
|
15
|
+
this.isLocalCloud = isLocalCloud ?? false;
|
17
16
|
this.chain = chain;
|
18
17
|
}
|
19
18
|
}
|
@@ -22,37 +21,25 @@ export class zkCloudWorker {
|
|
22
21
|
this.cloud = cloud;
|
23
22
|
}
|
24
23
|
// To verify the SmartContract code
|
25
|
-
deployedContracts() {
|
26
|
-
return
|
27
|
-
return [];
|
28
|
-
});
|
24
|
+
async deployedContracts() {
|
25
|
+
return [];
|
29
26
|
}
|
30
27
|
// Those methods should be implemented for recursive proofs calculations
|
31
|
-
create(transaction) {
|
32
|
-
return
|
33
|
-
return undefined;
|
34
|
-
});
|
28
|
+
async create(transaction) {
|
29
|
+
return undefined;
|
35
30
|
}
|
36
|
-
merge(proof1, proof2) {
|
37
|
-
return
|
38
|
-
return undefined;
|
39
|
-
});
|
31
|
+
async merge(proof1, proof2) {
|
32
|
+
return undefined;
|
40
33
|
}
|
41
34
|
// Those methods should be implemented for anything except for recursive proofs
|
42
|
-
execute(transactions) {
|
43
|
-
return
|
44
|
-
return undefined;
|
45
|
-
});
|
35
|
+
async execute(transactions) {
|
36
|
+
return undefined;
|
46
37
|
}
|
47
38
|
// process the transactions received by the cloud
|
48
|
-
processTransactions(transactions) {
|
49
|
-
return __awaiter(this, void 0, void 0, function* () { });
|
50
|
-
}
|
39
|
+
async processTransactions(transactions) { }
|
51
40
|
// process the task defined by the developer
|
52
|
-
task() {
|
53
|
-
return
|
54
|
-
return undefined;
|
55
|
-
});
|
41
|
+
async task() {
|
42
|
+
return undefined;
|
56
43
|
}
|
57
44
|
}
|
58
45
|
//# sourceMappingURL=cloud.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"cloud.js","sourceRoot":"","sources":["../../../../../src/cloud/cloud.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"cloud.js","sourceRoot":"","sources":["../../../../../src/cloud/cloud.ts"],"names":[],"mappings":"AAeA,MAAM,OAAgB,KAAK;IAezB,YAAY,MAcX;QACC,MAAM,EACJ,EAAE,EACF,KAAK,EACL,MAAM,EACN,MAAM,EACN,KAAK,EACL,SAAS,EACT,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,QAAQ,EACR,YAAY,EACZ,KAAK,GACN,GAAG,MAAM,CAAC;QACX,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,YAAY,GAAG,YAAY,IAAI,KAAK,CAAC;QAC1C,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;CA2CF;AACD,MAAM,OAAgB,aAAa;IAGjC,YAAY,KAAY;QACtB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAED,mCAAmC;IACnC,KAAK,CAAC,iBAAiB;QACrB,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,wEAAwE;IACxE,KAAK,CAAC,MAAM,CAAC,WAAmB;QAC9B,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,KAAK,CAAC,KAAK,CAAC,MAAc,EAAE,MAAc;QACxC,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,+EAA+E;IAC/E,KAAK,CAAC,OAAO,CAAC,YAAsB;QAClC,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,iDAAiD;IACjD,KAAK,CAAC,mBAAmB,CAAC,YAAgC,IAAkB,CAAC;IAE7E,4CAA4C;IAC5C,KAAK,CAAC,IAAI;QACR,OAAO,SAAS,CAAC;IACnB,CAAC;CACF"}
|
@@ -1,74 +1,65 @@
|
|
1
|
-
import { __awaiter } from "tslib";
|
2
1
|
import fs from "fs/promises";
|
3
|
-
export function saveFile(params) {
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
}
|
23
|
-
});
|
2
|
+
export async function saveFile(params) {
|
3
|
+
const { data, filename } = params;
|
4
|
+
const folder = "./data/";
|
5
|
+
const name = folder + filename + ".json";
|
6
|
+
try {
|
7
|
+
await fs.access("./data");
|
8
|
+
}
|
9
|
+
catch (e) {
|
10
|
+
// if not, create it
|
11
|
+
await fs.mkdir("./data");
|
12
|
+
}
|
13
|
+
try {
|
14
|
+
await fs.writeFile(name, JSON.stringify(data, null, 2));
|
15
|
+
return name;
|
16
|
+
}
|
17
|
+
catch (e) {
|
18
|
+
console.error(`Error writing file ${name}`);
|
19
|
+
return undefined;
|
20
|
+
}
|
24
21
|
}
|
25
|
-
export function loadFile(filename) {
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
}
|
37
|
-
});
|
22
|
+
export async function loadFile(filename) {
|
23
|
+
const name = "./data/" + filename + ".json";
|
24
|
+
try {
|
25
|
+
const filedata = await fs.readFile(name, "utf8");
|
26
|
+
const data = JSON.parse(filedata);
|
27
|
+
return data;
|
28
|
+
}
|
29
|
+
catch (e) {
|
30
|
+
console.error(`File ${name} does not exist or has wrong format`);
|
31
|
+
return undefined;
|
32
|
+
}
|
38
33
|
}
|
39
|
-
export function saveBinaryFile(params) {
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
}
|
59
|
-
});
|
34
|
+
export async function saveBinaryFile(params) {
|
35
|
+
const { data, filename } = params;
|
36
|
+
const folder = "./data/";
|
37
|
+
const name = folder + filename + ".bin";
|
38
|
+
try {
|
39
|
+
await fs.access("./data");
|
40
|
+
}
|
41
|
+
catch (e) {
|
42
|
+
// if not, create it
|
43
|
+
await fs.mkdir("./data");
|
44
|
+
}
|
45
|
+
try {
|
46
|
+
await fs.writeFile(name, data);
|
47
|
+
return name;
|
48
|
+
}
|
49
|
+
catch (e) {
|
50
|
+
console.error(`Error writing file ${name}`);
|
51
|
+
return undefined;
|
52
|
+
}
|
60
53
|
}
|
61
|
-
export function loadBinaryFile(filename) {
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
}
|
72
|
-
});
|
54
|
+
export async function loadBinaryFile(filename) {
|
55
|
+
const name = "./data/" + filename + ".bin";
|
56
|
+
try {
|
57
|
+
const data = await fs.readFile(name);
|
58
|
+
return data;
|
59
|
+
}
|
60
|
+
catch (e) {
|
61
|
+
console.error(`File ${name} does not exist or has wrong format`);
|
62
|
+
return undefined;
|
63
|
+
}
|
73
64
|
}
|
74
65
|
//# sourceMappingURL=files.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"files.js","sourceRoot":"","sources":["../../../../../src/cloud/files.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"files.js","sourceRoot":"","sources":["../../../../../src/cloud/files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,aAAa,CAAC;AAE7B,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAC,MAI9B;IACC,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC;IAClC,MAAM,MAAM,GAAG,SAAS,CAAC;IACzB,MAAM,IAAI,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;IACzC,IAAI,CAAC;QACH,MAAM,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IAC5B,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,oBAAoB;QACpB,MAAM,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC3B,CAAC;IACD,IAAI,CAAC;QACH,MAAM,EAAE,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QACxD,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,OAAO,CAAC,KAAK,CAAC,sBAAsB,IAAI,EAAE,CAAC,CAAC;QAC5C,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAC,QAAgB;IAC7C,MAAM,IAAI,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,CAAC;IAC5C,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QACjD,MA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