Skip to content

Commit f923148

Browse files
committed
Merge branch 'develop'
2 parents eff8c1c + 3a29e10 commit f923148

File tree

37 files changed

+762
-55
lines changed

37 files changed

+762
-55
lines changed

apps/cli/src/commands/operator-control/operator-runtime.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import Vorpal from "vorpal";
2-
import { getSignerFromPrivateKey, operatorRuntime, listOwnersForOperator } from "@sentry/core";
2+
import { getSignerFromPrivateKey, operatorRuntime, listOwnersForOperator, Challenge, PublicNodeBucketInformation } from "@sentry/core";
33

44
/**
55
* Starts a runtime of the operator.
@@ -59,12 +59,21 @@ export function bootOperator(cli: Vorpal) {
5959
}
6060
}
6161

62-
6362
stopFunction = await operatorRuntime(
6463
signer,
6564
undefined,
66-
(log) => this.log(log),
65+
(log: string) => this.log(log),
6766
selectedOwners,
67+
(publicNodeData: PublicNodeBucketInformation | undefined, challenge: Challenge, message: string) => {
68+
const errorMessage = `The comparison between public node and challenge failed:\n` +
69+
`${message}\n\n` +
70+
`Public node data:\n` +
71+
`${JSON.stringify(publicNodeData, null, 2)}\n\n` +
72+
`Challenge data:\n` +
73+
`${JSON.stringify(challenge, null, 2)}\n`;
74+
75+
this.log(errorMessage)
76+
}
6877
);
6978

7079
return new Promise((resolve, reject) => { }); // Keep the command alive
1.35 MB
Binary file not shown.

apps/sentry-client-desktop/src/components/IconLabel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ interface IconLabelProps {
1616
export function IconLabel({icon: Icon, color, title, tooltip, header, body, body2, position}: IconLabelProps) {
1717

1818
return (
19-
<span className="flex flex-row gap-2 items-center font-semibold text-[14px]">
19+
<span className="flex flex-row gap-2 items-center font-semibold text-sm">
2020
<Icon
2121
// @ts-ignore
2222
size={20}

apps/sentry-client-desktop/src/features/drawer/DrawerManager.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export function DrawerManager() {
2525

2626
return (
2727
<div
28-
className={classNames("w-[28rem] min-w-[28rem] h-screen z-10 bg-white border border-gray-200 overflow-y-scroll", {
28+
className={classNames("fixed right-0 w-[28rem] min-w-[28rem] h-screen z-10 bg-white border border-gray-200 overflow-y-scroll", {
2929
"hidden": drawerState === null,
3030
})}
3131
>

apps/sentry-client-desktop/src/features/drawer/WhitelistDrawer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ export function WhitelistDrawer() {
113113
</div>
114114

115115
<div className="w-full flex-shrink-0 h-18 bg-white flex flex-col items-center justify-center px-2">
116-
<p className="text-[14px]">
116+
<p className="text-sm">
117117
Applying changes will restart your sentry
118118
</p>
119119

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import {SentryNodeStatusCard} from "@/features/home/dashboard/SentryNodeStatusCard";
2+
import {KeysCard} from "@/features/home/dashboard/KeysCard";
3+
import {WalletsCard} from "@/features/home/dashboard/WalletsCard";
4+
import {NetworkRewardsCard} from "@/features/home/dashboard/NetworkRewardsCard";
5+
6+
export function Dashboard() {
7+
return (
8+
<div className="w-full h-screen flex flex-row gap-4 p-4 bg-[#F5F5F5]">
9+
<div className="flex flex-col gap-4">
10+
<SentryNodeStatusCard/>
11+
12+
<div className="flex gap-4">
13+
<KeysCard/>
14+
<WalletsCard/>
15+
</div>
16+
</div>
17+
18+
<NetworkRewardsCard/>
19+
</div>
20+
)
21+
}

apps/sentry-client-desktop/src/features/home/SentryWallet.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ export function SentryWallet() {
219219
<div
220220
className="sticky top-0 flex flex-col items-center w-full h-auto bg-white z-10">
221221
<div
222-
className="flex flex-row justify-between items-center w-full py-2 gap-2 border-b border-gray-200 pl-10 pr-2">
222+
className="flex flex-row justify-between items-center w-full h-16 py-2 gap-2 border-b border-gray-200 pl-10 pr-2">
223223
<div className="flex flex-row items-center gap-2">
224224
<h2 className="text-lg font-semibold">Sentry Wallet</h2>
225225

@@ -379,7 +379,7 @@ export function SentryWallet() {
379379
<div>
380380
<div
381381
onClick={() => setIsOpen(!isOpen)}
382-
className={`flex items-center justify-between w-[538px] border-[#A3A3A3] border-r border-l border-t ${!isOpen ? "border-b" : null} border-[#A3A3A3] p-2`}
382+
className={`flex items-center justify-between w-[538px] border-[#A3A3A3] border-r border-l border-t ${!isOpen ? "border-b" : "pb-[9px]"} border-[#A3A3A3] p-2`}
383383
>
384384
<p>{selectedWallet || `All assigned wallets (${data?.whitelistedWallets ? data.whitelistedWallets.length : owners.length})`}</p>
385385
<IoIosArrowDown

apps/sentry-client-desktop/src/features/home/SentryWalletHeader.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {Tooltip} from "../../../../../packages/ui/src/features/tooltip/Tooltip";
1+
import {Tooltip} from "@sentry/ui";
22
import {AiOutlineInfoCircle} from "react-icons/ai";
33
import {FaEthereum} from "react-icons/fa";
44
import classNames from "classnames";
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import {PropsWithChildren} from "react";
2+
3+
interface CardProps extends PropsWithChildren {
4+
width: string;
5+
height: string;
6+
}
7+
8+
export function Card({width, height, children}: CardProps) {
9+
return (
10+
<div
11+
className="relative bg-white border border-[#00000005] shadow rounded-lg overflow-hidden"
12+
style={{width: width, height: height}}
13+
>
14+
<div>{children}</div>
15+
</div>
16+
)
17+
}
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
import {drawerStateAtom, DrawerView} from "@/features/drawer/DrawerManager";
2+
import {useAtomValue, useSetAtom} from "jotai";
3+
import {chainStateAtom} from "@/hooks/useChainDataWithCallback";
4+
import {Tooltip} from "@sentry/ui";
5+
import {AiFillWarning, AiOutlineInfoCircle} from "react-icons/ai";
6+
import {Card} from "@/features/home/cards/Card";
7+
import {RiKey2Line} from "react-icons/ri";
8+
import {accruingStateAtom} from "@/hooks/useAccruingInfo";
9+
10+
export function KeysCard() {
11+
const setDrawerState = useSetAtom(drawerStateAtom);
12+
const {owners, licensesList} = useAtomValue(chainStateAtom);
13+
const {accruing} = useAtomValue(accruingStateAtom);
14+
const keyCount = licensesList.length;
15+
16+
return (
17+
<Card width={"355px"} height={"188px"}>
18+
<div className="flex flex-row justify-between items-center py-2 px-4 border-b border-[#F5F5F5]">
19+
<div className="flex flex-row items-center gap-1 text-[#A3A3A3] text-[15px]">
20+
<h2 className="font-medium">Keys</h2>
21+
<Tooltip
22+
header={"Purchased keys must be assigned to Sentry Wallet"}
23+
body={"To assign keys, connect all wallets containing Sentry Keys."}
24+
body2={"The wallet containing the purchased keys will perform a gas transaction to assign the keys to the Sentry."}
25+
position={"start"}
26+
>
27+
<AiOutlineInfoCircle size={15} color={"#A3A3A3"}/>
28+
</Tooltip>
29+
</div>
30+
<div className="flex flex-row justify-between items-center gap-1">
31+
<button
32+
className="flex flex-row justify-center items-center gap-2 text-[#737373] text-sm font-medium bg-[#F5F5F5] rounded-md px-4 py-1"
33+
onClick={() => setDrawerState(DrawerView.BuyKeys)}
34+
>
35+
Buy keys
36+
</button>
37+
</div>
38+
</div>
39+
<div className="py-2 px-4">
40+
<div className="flex gap-2 items-center">
41+
<div className="flex items-center gap-2">
42+
<div
43+
className="w-[24px] h-[24px] flex justify-center items-center bg-[#F5F5F5] rounded-full">
44+
<RiKey2Line color={"#A3A3A3"} size={15}/>
45+
</div>
46+
</div>
47+
<p className="text-[32px] font-semibold">
48+
{keyCount}
49+
</p>
50+
</div>
51+
<p className="text-sm text-[#737373] ml-[2rem]">
52+
In {owners.length} wallet{owners.length === 1 ? "" : "s"}
53+
</p>
54+
</div>
55+
56+
{!accruing && (
57+
<div
58+
className="absolute bottom-3 left-3 m-auto max-w-[327px] h-[40px] flex justify-center items-center gap-1 rounded-lg text-sm text-[#F59E28] bg-[#FFFBEB] p-2">
59+
<div className="flex justify-center items-center gap-2">
60+
<AiFillWarning color={"#F59E28"} size={20}/>
61+
You have unassigned keys
62+
</div>
63+
</div>
64+
)}
65+
</Card>
66+
)
67+
}

0 commit comments

Comments
 (0)