mirror of
https://github.com/logos-messaging/examples.waku.org.git
synced 2026-01-07 15:23:06 +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 =
|
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";
|
"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 { useStore } from "./useStore";
|
||||||
import { useRLN } from "./useRLN";
|
import { useRLN } from "./useRLN";
|
||||||
import { SEPOLIA_CONTRACT } from "@waku/rln";
|
import { SEPOLIA_CONTRACT } from "@waku/rln";
|
||||||
import { StatusEventPayload } from "@/services/rln";
|
import { StatusEventPayload } from "@/constants";
|
||||||
|
|
||||||
type UseKeystoreResult = {
|
type UseKeystoreResult = {
|
||||||
onReadCredentials: (hash: string, password: string) => void;
|
onReadCredentials: (hash: string, password: string) => void;
|
||||||
|
|||||||
@ -2,32 +2,18 @@ import { ethers } from "ethers";
|
|||||||
import {
|
import {
|
||||||
create,
|
create,
|
||||||
Keystore,
|
Keystore,
|
||||||
RLNDecoder,
|
|
||||||
RLNEncoder,
|
|
||||||
RLNContract,
|
RLNContract,
|
||||||
SEPOLIA_CONTRACT,
|
SEPOLIA_CONTRACT,
|
||||||
RLNInstance,
|
RLNInstance,
|
||||||
} from "@waku/rln";
|
} from "@waku/rln";
|
||||||
import { isBrowserProviderValid } from "@/utils/ethereum";
|
import { isBrowserProviderValid } from "@/utils/ethereum";
|
||||||
|
import { StatusEventPayload } from "@/constants";
|
||||||
|
|
||||||
export enum RLNEventsNames {
|
export enum RLNEventsNames {
|
||||||
Status = "status",
|
Status = "status",
|
||||||
Keystore = "keystore-changed",
|
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 EventListener = (event: CustomEvent) => void;
|
||||||
|
|
||||||
type IRLN = {
|
type IRLN = {
|
||||||
@ -135,7 +121,7 @@ export class RLN implements IRLN {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public async saveKeystore() {
|
public async saveKeystore() {
|
||||||
// localStorage.setItem("keystore", this.keystore.toString());
|
localStorage.setItem("keystore", this.keystore.toString());
|
||||||
this.emitKeystoreKeys();
|
this.emitKeystoreKeys();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user