@waku/rln 0.1.6-acc9100.0 → 0.1.6-b0a2e39.0
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/bundle/_virtual/utils.js +2 -2
- package/bundle/_virtual/utils2.js +2 -2
- package/bundle/index.js +1 -1
- package/bundle/node_modules/@chainsafe/bls-keystore/node_modules/@noble/hashes/_sha2.js +1 -1
- package/bundle/node_modules/@chainsafe/bls-keystore/node_modules/@noble/hashes/hmac.js +1 -1
- package/bundle/node_modules/@chainsafe/bls-keystore/node_modules/@noble/hashes/pbkdf2.js +1 -1
- package/bundle/node_modules/@chainsafe/bls-keystore/node_modules/@noble/hashes/scrypt.js +1 -1
- package/bundle/node_modules/@chainsafe/bls-keystore/node_modules/@noble/hashes/sha256.js +1 -1
- package/bundle/node_modules/@chainsafe/bls-keystore/node_modules/@noble/hashes/sha512.js +1 -1
- package/bundle/node_modules/@chainsafe/bls-keystore/node_modules/@noble/hashes/utils.js +1 -1
- package/bundle/node_modules/@chainsafe/bls-keystore/node_modules/ethereum-cryptography/random.js +1 -1
- package/bundle/node_modules/@chainsafe/bls-keystore/node_modules/ethereum-cryptography/utils.js +2 -2
- package/bundle/packages/core/dist/lib/connection_manager/connection_manager.js +1 -0
- package/bundle/packages/core/dist/lib/connection_manager/keep_alive_manager.js +1 -0
- package/bundle/packages/core/dist/lib/filter/filter.js +2 -0
- package/bundle/packages/core/dist/lib/light_push/light_push.js +12 -9
- package/bundle/packages/core/dist/lib/light_push/light_push_v3.js +30 -0
- package/bundle/packages/core/dist/lib/light_push/utils.js +18 -0
- package/bundle/packages/core/dist/lib/message/version_0.js +1 -0
- package/bundle/packages/core/dist/lib/metadata/metadata.js +2 -0
- package/bundle/packages/core/dist/lib/store/store.js +2 -0
- package/bundle/packages/interfaces/dist/light_push_v3.js +29 -0
- package/bundle/packages/interfaces/dist/protocols.js +10 -0
- package/bundle/packages/proto/dist/generated/light_push.js +3 -3
- package/bundle/packages/proto/dist/generated/light_push_v3.js +348 -0
- package/bundle/packages/rln/dist/codec.js +1 -0
- package/bundle/packages/rln/dist/contract/constants.js +1 -7
- package/bundle/packages/rln/dist/contract/rln_base_contract.js +7 -28
- package/bundle/packages/rln/dist/contract/rln_contract.js +1 -0
- package/bundle/packages/rln/dist/credentials_manager.js +15 -16
- package/bundle/packages/rln/dist/identity.js +8 -5
- package/bundle/packages/rln/dist/keystore/keystore.js +12 -15
- package/bundle/packages/rln/dist/message.js +2 -0
- package/bundle/packages/rln/dist/rln.js +2 -0
- package/bundle/packages/rln/dist/utils/bytes.js +16 -14
- package/bundle/packages/rln/dist/utils/epoch.js +1 -0
- package/bundle/packages/utils/dist/common/sharding/index.js +1 -0
- package/dist/.tsbuildinfo +1 -1
- package/dist/contract/constants.d.ts +0 -6
- package/dist/contract/constants.js +0 -6
- package/dist/contract/constants.js.map +1 -1
- package/dist/contract/rln_base_contract.d.ts +0 -6
- package/dist/contract/rln_base_contract.js +6 -28
- package/dist/contract/rln_base_contract.js.map +1 -1
- package/dist/contract/test-utils.d.ts +39 -0
- package/dist/contract/test-utils.js +118 -0
- package/dist/contract/test-utils.js.map +1 -0
- package/dist/credentials_manager.js +14 -16
- package/dist/credentials_manager.js.map +1 -1
- package/dist/identity.d.ts +2 -4
- package/dist/identity.js +6 -5
- package/dist/identity.js.map +1 -1
- package/dist/keystore/keystore.js +11 -15
- package/dist/keystore/keystore.js.map +1 -1
- package/dist/utils/bytes.d.ts +6 -2
- package/dist/utils/bytes.js +15 -13
- package/dist/utils/bytes.js.map +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/utils/index.js.map +1 -1
- package/package.json +1 -1
- package/src/contract/constants.ts +0 -9
- package/src/contract/rln_base_contract.ts +13 -41
- package/src/contract/test-utils.ts +179 -0
- package/src/credentials_manager.ts +21 -27
- package/src/identity.ts +7 -5
- package/src/keystore/keystore.ts +24 -28
- package/src/utils/bytes.ts +25 -21
- package/src/utils/index.ts +1 -1
package/src/utils/bytes.ts
CHANGED
@@ -17,13 +17,18 @@ export function concatenate(...input: Uint8Array[]): Uint8Array {
|
|
17
17
|
return result;
|
18
18
|
}
|
19
19
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
20
|
+
// Adapted from https://github.com/feross/buffer
|
21
|
+
function checkInt(
|
22
|
+
buf: Uint8Array,
|
23
|
+
value: number,
|
24
|
+
offset: number,
|
25
|
+
ext: number,
|
26
|
+
max: number,
|
27
|
+
min: number
|
28
|
+
): void {
|
29
|
+
if (value > max || value < min)
|
30
|
+
throw new RangeError('"value" argument is out of bounds');
|
31
|
+
if (offset + ext > buf.length) throw new RangeError("Index out of range");
|
27
32
|
}
|
28
33
|
|
29
34
|
export function writeUIntLE(
|
@@ -51,6 +56,19 @@ export function writeUIntLE(
|
|
51
56
|
return buf;
|
52
57
|
}
|
53
58
|
|
59
|
+
/**
|
60
|
+
* Transforms Uint8Array into BigInt
|
61
|
+
* @param array: Uint8Array
|
62
|
+
* @returns BigInt
|
63
|
+
*/
|
64
|
+
export function buildBigIntFromUint8Array(
|
65
|
+
array: Uint8Array,
|
66
|
+
byteOffset: number = 0
|
67
|
+
): bigint {
|
68
|
+
const dataView = new DataView(array.buffer);
|
69
|
+
return dataView.getBigUint64(byteOffset, true);
|
70
|
+
}
|
71
|
+
|
54
72
|
/**
|
55
73
|
* Fills with zeros to set length
|
56
74
|
* @param array little endian Uint8Array
|
@@ -64,17 +82,3 @@ export function zeroPadLE(array: Uint8Array, length: number): Uint8Array {
|
|
64
82
|
}
|
65
83
|
return result;
|
66
84
|
}
|
67
|
-
|
68
|
-
// Adapted from https://github.com/feross/buffer
|
69
|
-
function checkInt(
|
70
|
-
buf: Uint8Array,
|
71
|
-
value: number,
|
72
|
-
offset: number,
|
73
|
-
ext: number,
|
74
|
-
max: number,
|
75
|
-
min: number
|
76
|
-
): void {
|
77
|
-
if (value > max || value < min)
|
78
|
-
throw new RangeError('"value" argument is out of bounds');
|
79
|
-
if (offset + ext > buf.length) throw new RangeError("Index out of range");
|
80
|
-
}
|