Add functionality to create a validator #28

Merged
nabarun merged 14 commits from deep-stack/testnet-onboarding-app:ag-validator-ui into main 2024-08-09 10:18:14 +00:00
7 changed files with 1662 additions and 1717 deletions
Showing only changes of commit 8f5f48f3f0 - Show all commits

View File

@ -4,7 +4,6 @@
"private": true,
"dependencies": {
"@cerc-io/registry-sdk": "^0.2.5",
"@cosmjs/crypto": "^0.32.4",
"@cosmjs/encoding": "^0.32.4",
"@cosmjs/proto-signing": "^0.32.4",
"@cosmjs/stargate": "^0.32.4",

View File

@ -4,4 +4,4 @@ export const REDIRECT_EMAIL_MSG = 'Close this tab and the confirmation link in y
export const ENABLE_KYC = false;
export const SUBSCRIBER_ID_HASH_KEY = 'subscriberIdHash';
export const HASHED_SUBSCRIBER_ID_KEY = 'subscriberIdHash';

View File

@ -8,7 +8,7 @@ import SumsubWebSdk from "@sumsub/websdk-react";
import { MessageHandler } from "@sumsub/websdk";
import { config, fetchAccessToken, getAccessTokenExpirationHandler, options } from "../utils/sumsub";
import { ENABLE_KYC, SUBSCRIBER_ID_HASH_KEY } from "../constants";
import { ENABLE_KYC, HASHED_SUBSCRIBER_ID_KEY } from "../constants";
import { Participant } from "../types";
const registry = new Registry(
@ -42,7 +42,7 @@ const OnboardingSuccess = () => {
return;
}
localStorage.removeItem(SUBSCRIBER_ID_HASH_KEY);
localStorage.removeItem(HASHED_SUBSCRIBER_ID_KEY);
setParticipant(participant);
} catch (error) {

View File

@ -12,7 +12,7 @@ import { StargateClient } from "@cosmjs/stargate";
import { useWalletConnectContext } from "../context/WalletConnectContext";
import SelectRoleCard, {Role} from "../components/SelectRoleCard";
import { SUBSCRIBER_ID_HASH_KEY } from "../constants";
import { HASHED_SUBSCRIBER_ID_KEY } from "../constants";
const SignWithCosmos = () => {
const { session, signClient } = useWalletConnectContext();
@ -36,7 +36,7 @@ const SignWithCosmos = () => {
};
const ethAddress = innerMessage!.address;
const subscriberIdHash = localStorage.getItem(SUBSCRIBER_ID_HASH_KEY);
const subscriberIdHash = localStorage.getItem(HASHED_SUBSCRIBER_ID_KEY);
const createCosmosClient = useCallback(async (endpoint: string) => {
return await StargateClient.connect(endpoint);

View File

@ -13,7 +13,7 @@ import LoadingButton from '@mui/lab/LoadingButton';
import { utf8ToHex } from "@walletconnect/encoding";
import { useWalletConnectContext } from "../context/WalletConnectContext";
import { ENABLE_KYC, SUBSCRIBER_ID_HASH_KEY } from "../constants";
import { ENABLE_KYC, HASHED_SUBSCRIBER_ID_KEY } from "../constants";
const SignWithNitroKey = () => {
@ -39,7 +39,7 @@ const SignWithNitroKey = () => {
const [isLoading, setIsLoading] = useState(false);
const subscriberIdHash = useMemo(()=>{
return localStorage.getItem(SUBSCRIBER_ID_HASH_KEY);
return localStorage.getItem(HASHED_SUBSCRIBER_ID_KEY);
}, []);
useEffect(() => {

View File

@ -5,7 +5,7 @@ import { ethers } from 'ethers';
import { Box, colors, Typography } from '@mui/material';
import { SUBSCRIBER_ID_HASH_KEY } from '../constants';
import { HASHED_SUBSCRIBER_ID_KEY } from '../constants';
interface JwtPayload {
subscriber_id: string;
@ -43,7 +43,7 @@ const Thanks: React.FC = () => {
const subscriberIdBytes = ethers.utils.toUtf8Bytes(decoded.subscriber_id);
const subscriberIdHash = ethers.utils.sha256(subscriberIdBytes);
localStorage.setItem(SUBSCRIBER_ID_HASH_KEY, subscriberIdHash);
localStorage.setItem(HASHED_SUBSCRIBER_ID_KEY, subscriberIdHash);
navigate('/sign-with-nitro-key');
} catch (error) {

3360
yarn.lock

File diff suppressed because it is too large Load Diff