mirror of
https://github.com/logos-messaging/js-rln.git
synced 2026-01-02 13:43:06 +00:00
chore: update @waku/* packages (#77)
* update @waku/* packages * fix typing * remove type
This commit is contained in:
parent
fa49e29856
commit
7e8cb899be
11540
package-lock.json
generated
11540
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -72,9 +72,9 @@
|
||||
"@types/uuid": "^8.3.0",
|
||||
"@typescript-eslint/eslint-plugin": "^5.8.1",
|
||||
"@typescript-eslint/parser": "^5.8.1",
|
||||
"@waku/core": "^0.0.18",
|
||||
"@waku/interfaces": "^0.0.13",
|
||||
"@waku/message-encryption": "^0.0.16",
|
||||
"@waku/core": "^0.0.24",
|
||||
"@waku/interfaces": "^0.0.19",
|
||||
"@waku/message-encryption": "^0.0.22",
|
||||
"@web/rollup-plugin-import-meta-assets": "^1.0.7",
|
||||
"ajv": "^8.12.0",
|
||||
"ajv-formats": "^2.1.1",
|
||||
@ -140,7 +140,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@chainsafe/bls-keystore": "^3.0.0",
|
||||
"@waku/utils": "^0.0.11",
|
||||
"@waku/utils": "^0.0.12",
|
||||
"@waku/zerokit-rln-wasm": "^0.0.10",
|
||||
"ethereum-cryptography": "^2.1.2",
|
||||
"ethers": "^5.7.2",
|
||||
|
||||
12
src/codec.ts
12
src/codec.ts
@ -56,6 +56,10 @@ export class RLNEncoder implements IEncoder {
|
||||
return proof;
|
||||
}
|
||||
|
||||
get pubsubTopic(): string {
|
||||
return this.encoder.pubsubTopic;
|
||||
}
|
||||
|
||||
get contentTopic(): string {
|
||||
return this.encoder.contentTopic;
|
||||
}
|
||||
@ -86,6 +90,10 @@ export class RLNDecoder<T extends IDecodedMessage>
|
||||
{
|
||||
constructor(private rlnInstance: RLNInstance, private decoder: IDecoder<T>) {}
|
||||
|
||||
get pubsubTopic(): string {
|
||||
return this.decoder.pubsubTopic;
|
||||
}
|
||||
|
||||
get contentTopic(): string {
|
||||
return this.decoder.contentTopic;
|
||||
}
|
||||
@ -97,11 +105,11 @@ export class RLNDecoder<T extends IDecodedMessage>
|
||||
}
|
||||
|
||||
async fromProtoObj(
|
||||
pubSubTopic: string,
|
||||
pubsubTopic: string,
|
||||
proto: IProtoMessage
|
||||
): Promise<RlnMessage<T> | undefined> {
|
||||
const msg: T | undefined = await this.decoder.fromProtoObj(
|
||||
pubSubTopic,
|
||||
pubsubTopic,
|
||||
proto
|
||||
);
|
||||
if (!msg) return;
|
||||
|
||||
@ -14,7 +14,7 @@ export function toRLNSignal(contentTopic: string, msg: IMessage): Uint8Array {
|
||||
}
|
||||
|
||||
export class RlnMessage<T extends IDecodedMessage> implements IDecodedMessage {
|
||||
public pubSubTopic = "";
|
||||
public pubsubTopic = "";
|
||||
|
||||
constructor(
|
||||
public rlnInstance: RLNInstance,
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import type { IRateLimitProof } from "@waku/interfaces";
|
||||
import { default as init } from "@waku/zerokit-rln-wasm";
|
||||
import init from "@waku/zerokit-rln-wasm";
|
||||
import * as zerokitRLN from "@waku/zerokit-rln-wasm";
|
||||
|
||||
import { buildBigIntFromUint8Array, writeUIntLE } from "./byte_utils.js";
|
||||
@ -48,7 +48,7 @@ async function loadZkey(): Promise<Uint8Array> {
|
||||
* @returns RLNInstance
|
||||
*/
|
||||
export async function create(): Promise<RLNInstance> {
|
||||
await init();
|
||||
await (init as any)?.();
|
||||
zerokitRLN.init_panic_hook();
|
||||
const witnessCalculator = await loadWitnessCalculator();
|
||||
const zkey = await loadZkey();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user