zkcloudworker 0.7.15 → 0.8.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (34) hide show
  1. package/lib/ts/src/cloud/config.js +1 -1
  2. package/lib/ts/src/cloud/utils/hash.d.ts +7 -0
  3. package/lib/ts/src/cloud/utils/hash.js +101 -0
  4. package/lib/ts/src/cloud/utils/index.d.ts +1 -0
  5. package/lib/ts/src/cloud/utils/index.js +1 -0
  6. package/lib/ts/src/cloud/worker/cloud.d.ts +2 -1
  7. package/lib/ts/src/mina/api/api.d.ts +1 -1
  8. package/lib/ts/src/mina/api/api.js +9 -3
  9. package/lib/ts/src/mina/local/local.d.ts +3 -6
  10. package/lib/ts/src/mina/local/local.js +17 -14
  11. package/lib/ts/src/mina/utils/base64.d.ts +0 -6
  12. package/lib/ts/src/mina/utils/base64.js +6 -91
  13. package/lib/ts/tsconfig.tsbuildinfo +1 -1
  14. package/lib/web/src/cloud/config.js +1 -1
  15. package/lib/web/src/cloud/config.js.map +1 -1
  16. package/lib/web/src/cloud/utils/hash.d.ts +7 -0
  17. package/lib/web/src/cloud/utils/hash.js +89 -0
  18. package/lib/web/src/cloud/utils/hash.js.map +1 -0
  19. package/lib/web/src/cloud/utils/index.d.ts +1 -0
  20. package/lib/web/src/cloud/utils/index.js +1 -0
  21. package/lib/web/src/cloud/utils/index.js.map +1 -1
  22. package/lib/web/src/cloud/worker/cloud.d.ts +2 -1
  23. package/lib/web/src/cloud/worker/cloud.js.map +1 -1
  24. package/lib/web/src/mina/api/api.d.ts +1 -1
  25. package/lib/web/src/mina/api/api.js +9 -3
  26. package/lib/web/src/mina/api/api.js.map +1 -1
  27. package/lib/web/src/mina/local/local.d.ts +3 -6
  28. package/lib/web/src/mina/local/local.js +17 -14
  29. package/lib/web/src/mina/local/local.js.map +1 -1
  30. package/lib/web/src/mina/utils/base64.d.ts +0 -6
  31. package/lib/web/src/mina/utils/base64.js +1 -80
  32. package/lib/web/src/mina/utils/base64.js.map +1 -1
  33. package/lib/web/tsconfig.web.tsbuildinfo +1 -1
  34. package/package.json +1 -1
@@ -81,13 +81,13 @@ export declare class LocalCloud extends Cloud {
81
81
  * @param transactions the transactions to add
82
82
  * @returns the transaction ids
83
83
  */
84
- sendTransactions(transactions: string[]): Promise<string[]>;
84
+ sendTransactions(transactions: string[]): Promise<CloudTransaction[]>;
85
85
  /**
86
86
  * Adds transactions to the local cloud
87
87
  * @param transactions the transactions to add
88
88
  * @returns the transaction ids
89
89
  */
90
- static addTransactions(transactions: string[] | CloudTransaction[]): Promise<string[]>;
90
+ static addTransactions(transactions: string[] | CloudTransaction[]): Promise<CloudTransaction[]>;
91
91
  /**
92
92
  * Deletes a transaction from the local cloud
93
93
  * @param txId the transaction id to delete
@@ -238,10 +238,7 @@ export declare class LocalStorage {
238
238
  [key: string]: string;
239
239
  };
240
240
  static transactions: {
241
- [key: string]: {
242
- transaction: string;
243
- timeReceived: number;
244
- };
241
+ [key: string]: CloudTransaction;
245
242
  };
246
243
  static tasks: {
247
244
  [key: string]: TaskData;
@@ -1,6 +1,7 @@
1
1
  import { Cloud } from "../../cloud";
2
2
  import { makeString } from "../../cloud";
3
3
  import { saveFile, loadFile, saveBinaryFile, loadBinaryFile, } from "../../cloud";
4
+ import { stringHash } from "../../cloud";
4
5
  /**
5
6
  * LocalCloud is a cloud that runs on the local machine for testing and development
6
7
  * It uses LocalStorage to store jobs, tasks, transactions, and data
@@ -112,8 +113,9 @@ export class LocalCloud extends Cloud {
112
113
  * Generates an id for local cloud
113
114
  * @returns generated unique id
114
115
  */
115
- static generateId() {
116
- return "local." + Date.now().toString() + "." + makeString(32);
116
+ static generateId(tx = undefined) {
117
+ const data = tx ?? JSON.stringify({ time: Date.now(), data: makeString(32) });
118
+ return stringHash(data);
117
119
  }
118
120
  /**
119
121
  * Send transactions to the local cloud
@@ -130,19 +132,25 @@ export class LocalCloud extends Cloud {
130
132
  */
131
133
  static async addTransactions(transactions) {
132
134
  const timeReceived = Date.now();
133
- const txId = [];
135
+ const txs = [];
134
136
  transactions.forEach((tx) => {
135
137
  if (typeof tx === "string") {
136
- const id = LocalCloud.generateId();
137
- LocalStorage.transactions[id] = { transaction: tx, timeReceived };
138
- txId.push(id);
138
+ const txId = LocalCloud.generateId(JSON.stringify({ tx, time: timeReceived }));
139
+ const transaction = {
140
+ txId,
141
+ transaction: tx,
142
+ timeReceived,
143
+ status: "accepted",
144
+ };
145
+ LocalStorage.transactions[txId] = transaction;
146
+ txs.push(transaction);
139
147
  }
140
148
  else {
141
149
  LocalStorage.transactions[tx.txId] = tx;
142
- txId.push(tx.txId);
150
+ txs.push(tx);
143
151
  }
144
152
  });
145
- return txId;
153
+ return txs;
146
154
  }
147
155
  /**
148
156
  * Deletes a transaction from the local cloud
@@ -155,12 +163,7 @@ export class LocalCloud extends Cloud {
155
163
  }
156
164
  async getTransactions() {
157
165
  const txs = Object.keys(LocalStorage.transactions).map((txId) => {
158
- const { transaction, timeReceived } = LocalStorage.transactions[txId];
159
- return {
160
- txId,
161
- transaction,
162
- timeReceived,
163
- };
166
+ return LocalStorage.transactions[txId];
164
167
  });
165
168
  return txs;
166
169
  }
@@ -1 +1 @@
1
- {"version":3,"file":"local.js","sourceRoot":"","sources":["../../../../../../src/mina/local/local.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAiB,MAAM,aAAa,CAAC;AAGnD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EACL,QAAQ,EACR,QAAQ,EACR,cAAc,EACd,cAAc,GACf,MAAM,aAAa,CAAC;AAIrB;;;;;;GAMG;AACH,MAAM,OAAO,UAAW,SAAQ,KAAK;IAGnC;;;;;;;;OAQG;IACH,YAAY,MAMX;QACC,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,CAAC;QAE1D,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAA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,IAAI;YACvB,IAAI,EAAE,YAAY,CAAC,IAAI;YACvB,YAAY,EAAE,YAAY,CAAC,YAAY;YACvC,KAAK,EAAE,YAAY,CAAC,KAAK;SAC1B,CAAC;QACF,MAAM,QAAQ,GAAG,IAAI,GAAG,QAAQ,CAAC;QACjC,MAAM,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;IACrC,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAY;QAChC,MAAM,QAAQ,GAAG,IAAI,GAAG,QAAQ,CAAC;QACjC,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACtC,IAAI,IAAI,KAAK,SAAS;YAAE,OAAO;QAC/B,YAAY,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QAC9B,YAAY,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QAC9B,YAAY,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;QAC9C,YAAY,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;IAClC,CAAC;;AAlCM,iBAAI,GAA+B,EAAE,CAAC;AACtC,iBAAI,GAA8B,EAAE,CAAC;AACrC,yBAAY,GAEf,EAAE,CAAC;AACA,kBAAK,GAAgC,EAAE,CAAC"}
@@ -1,11 +1,5 @@
1
1
  import { Field } from "o1js";
2
2
  export declare function fieldToBase56(field: Field): string;
3
- export declare function bigintToBase56(value: bigint): string;
4
3
  export declare function fieldFromBase56(str: string): Field;
5
- export declare function bigintFromBase56(str: string): bigint;
6
4
  export declare function fieldToBase64(field: Field): string;
7
- export declare function bigintToBase64(value: bigint): string;
8
5
  export declare function fieldFromBase64(str: string): Field;
9
- export declare function bigintFromBase64(str: string): bigint;
10
- export declare function fromBase(digits: bigint[], base: bigint): bigint;
11
- export declare function toBase(x: bigint, base: bigint): bigint[];
@@ -1,4 +1,5 @@
1
1
  import { Field } from "o1js";
2
+ import { toBase, fromBase } from "../../cloud/utils/hash";
2
3
  // URL friendly base64 encoding
3
4
  const TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
4
5
  export function fieldToBase56(field) {
@@ -8,23 +9,11 @@ export function fieldToBase56(field) {
8
9
  //console.log("str:", str);
9
10
  return str;
10
11
  }
11
- export function bigintToBase56(value) {
12
- const digits = toBase(value, 56n);
13
- //console.log("digits:", digits);
14
- const str = digits.map((x) => TABLE[Number(x)]).join("");
15
- //console.log("str:", str);
16
- return str;
17
- }
18
12
  export function fieldFromBase56(str) {
19
13
  const base56Digits = str.split("").map((x) => BigInt(TABLE.indexOf(x)));
20
14
  const x = fromBase(base56Digits, 56n);
21
15
  return Field(x);
22
16
  }
23
- export function bigintFromBase56(str) {
24
- const base56Digits = str.split("").map((x) => BigInt(TABLE.indexOf(x)));
25
- const x = fromBase(base56Digits, 56n);
26
- return x;
27
- }
28
17
  export function fieldToBase64(field) {
29
18
  const digits = toBase(field.toBigInt(), 64n);
30
19
  //console.log("digits:", digits);
@@ -32,77 +21,9 @@ export function fieldToBase64(field) {
32
21
  //console.log("str:", str);
33
22
  return str;
34
23
  }
35
- export function bigintToBase64(value) {
36
- const digits = toBase(value, 64n);
37
- //console.log("digits:", digits);
38
- const str = digits.map((x) => TABLE[Number(x)]).join("");
39
- //console.log("str:", str);
40
- return str;
41
- }
42
24
  export function fieldFromBase64(str) {
43
25
  const base64Digits = str.split("").map((x) => BigInt(TABLE.indexOf(x)));
44
26
  const x = fromBase(base64Digits, 64n);
45
27
  return Field(x);
46
28
  }
47
- export function bigintFromBase64(str) {
48
- const base64Digits = str.split("").map((x) => BigInt(TABLE.indexOf(x)));
49
- const x = fromBase(base64Digits, 64n);
50
- return x;
51
- }
52
- export function fromBase(digits, base) {
53
- if (base <= 0n)
54
- throw Error("fromBase: base must be positive");
55
- // compute powers base, base^2, base^4, ..., base^(2^k)
56
- // with largest k s.t. n = 2^k < digits.length
57
- let basePowers = [];
58
- for (let power = base, n = 1; n < digits.length; power **= 2n, n *= 2) {
59
- basePowers.push(power);
60
- }
61
- let k = basePowers.length;
62
- // pad digits array with zeros s.t. digits.length === 2^k
63
- digits = digits.concat(Array(2 ** k - digits.length).fill(0n));
64
- // accumulate [x0, x1, x2, x3, ...] -> [x0 + base*x1, x2 + base*x3, ...] -> [x0 + base*x1 + base^2*(x2 + base*x3), ...] -> ...
65
- // until we end up with a single element
66
- for (let i = 0; i < k; i++) {
67
- let newDigits = Array(digits.length >> 1);
68
- let basePower = basePowers[i];
69
- for (let j = 0; j < newDigits.length; j++) {
70
- newDigits[j] = digits[2 * j] + basePower * digits[2 * j + 1];
71
- }
72
- digits = newDigits;
73
- }
74
- console.assert(digits.length === 1);
75
- let [digit] = digits;
76
- return digit;
77
- }
78
- export function toBase(x, base) {
79
- if (base <= 0n)
80
- throw Error("toBase: base must be positive");
81
- // compute powers base, base^2, base^4, ..., base^(2^k)
82
- // with largest k s.t. base^(2^k) < x
83
- let basePowers = [];
84
- for (let power = base; power <= x; power **= 2n) {
85
- basePowers.push(power);
86
- }
87
- let digits = [x]; // single digit w.r.t base^(2^(k+1))
88
- // successively split digits w.r.t. base^(2^j) into digits w.r.t. base^(2^(j-1))
89
- // until we arrive at digits w.r.t. base
90
- let k = basePowers.length;
91
- for (let i = 0; i < k; i++) {
92
- let newDigits = Array(2 * digits.length);
93
- let basePower = basePowers[k - 1 - i];
94
- for (let j = 0; j < digits.length; j++) {
95
- let x = digits[j];
96
- let high = x / basePower;
97
- newDigits[2 * j + 1] = high;
98
- newDigits[2 * j] = x - high * basePower;
99
- }
100
- digits = newDigits;
101
- }
102
- // pop "leading" zero digits
103
- while (digits[digits.length - 1] === 0n) {
104
- digits.pop();
105
- }
106
- return digits;
107
- }
108
29
  //# sourceMappingURL=base64.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"base64.js","sourceRoot":"","sources":["../../../../../../src/mina/utils/base64.ts"],"names":[],"mappings":"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