mirror of
https://github.com/logos-messaging/examples.waku.org.git
synced 2026-01-02 12:53:08 +00:00
move const
This commit is contained in:
parent
78c54cee68
commit
1cd12339e3
@ -15,3 +15,16 @@ export const CONTENT_TOPIC = "/toy-chat/2/luzhou/proto";
|
||||
|
||||
export const SIGNATURE_MESSAGE =
|
||||
"The signature of this message will be used to generate your RLN credentials. Anyone accessing it may send messages on your behalf, please only share with the RLN dApp";
|
||||
|
||||
export enum StatusEventPayload {
|
||||
WASM_LOADING = "WASM Blob download in progress...",
|
||||
WASM_FAILED = "Failed to download WASM, check console",
|
||||
CONTRACT_LOADING = "Connecting to RLN contract",
|
||||
CONTRACT_FAILED = "Failed to connect to RLN contract",
|
||||
RLN_INITIALIZED = "RLN dependencies initialized",
|
||||
KEYSTORE_LOCAL = "Keystore initialized from localStore",
|
||||
KEYSTORE_NEW = "New Keystore was initialized",
|
||||
CREDENTIALS_REGISTERING = "Registering credentials...",
|
||||
CREDENTIALS_REGISTERED = "Registered credentials",
|
||||
CREDENTIALS_FAILURE = "Failed to register credentials, check console",
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@ import React from "react";
|
||||
import { useStore } from "./useStore";
|
||||
import { useRLN } from "./useRLN";
|
||||
import { SEPOLIA_CONTRACT } from "@waku/rln";
|
||||
import { StatusEventPayload } from "@/services/rln";
|
||||
import { StatusEventPayload } from "@/constants";
|
||||
|
||||
type UseKeystoreResult = {
|
||||
onReadCredentials: (hash: string, password: string) => void;
|
||||
|
||||
@ -2,32 +2,18 @@ import { ethers } from "ethers";
|
||||
import {
|
||||
create,
|
||||
Keystore,
|
||||
RLNDecoder,
|
||||
RLNEncoder,
|
||||
RLNContract,
|
||||
SEPOLIA_CONTRACT,
|
||||
RLNInstance,
|
||||
} from "@waku/rln";
|
||||
import { isBrowserProviderValid } from "@/utils/ethereum";
|
||||
import { StatusEventPayload } from "@/constants";
|
||||
|
||||
export enum RLNEventsNames {
|
||||
Status = "status",
|
||||
Keystore = "keystore-changed",
|
||||
}
|
||||
|
||||
export enum StatusEventPayload {
|
||||
WASM_LOADING = "WASM Blob download in progress...",
|
||||
WASM_FAILED = "Failed to download WASM, check console",
|
||||
CONTRACT_LOADING = "Connecting to RLN contract",
|
||||
CONTRACT_FAILED = "Failed to connect to RLN contract",
|
||||
RLN_INITIALIZED = "RLN dependencies initialized",
|
||||
KEYSTORE_LOCAL = "Keystore initialized from localStore",
|
||||
KEYSTORE_NEW = "New Keystore was initialized",
|
||||
CREDENTIALS_REGISTERING = "Registering credentials...",
|
||||
CREDENTIALS_REGISTERED = "Registered credentials",
|
||||
CREDENTIALS_FAILURE = "Failed to register credentials, check console",
|
||||
}
|
||||
|
||||
type EventListener = (event: CustomEvent) => void;
|
||||
|
||||
type IRLN = {
|
||||
@ -135,7 +121,7 @@ export class RLN implements IRLN {
|
||||
}
|
||||
|
||||
public async saveKeystore() {
|
||||
// localStorage.setItem("keystore", this.keystore.toString());
|
||||
localStorage.setItem("keystore", this.keystore.toString());
|
||||
this.emitKeystoreKeys();
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user