Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions .github/workflows/build_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ jobs:
run: npx semantic-release

- name: Configure AWS credentials
if: github.ref == 'refs/heads/pre-stage' || github.ref == 'refs/heads/stage' || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/bapps-prod'
if: github.ref == 'refs/heads/pre-stage' || github.ref == 'refs/heads/stage' || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/bapps-prod' || github.ref == 'refs/heads/temporary-hoodi-deploy'
uses: aws-actions/configure-aws-credentials@50ac8dd1e1b10d09dac7b8727528b91bed831ac0 # v3
with:
role-to-assume: ${{ secrets.SSV_WEB_AWS_IAM_ROLE }}
Expand All @@ -124,10 +124,9 @@ jobs:
run: |
aws s3 cp ./build s3://${{ secrets.SSV_WEB_STAGE_AWS_S3_BUCKET }} --recursive
# </app.stage.ssv.network>

# <app.ssv.network>
- name: Run prod webapp build
if: github.ref == 'refs/heads/main'
if: github.ref == 'refs/heads/temporary-hoodi-deploy'
run: >
GAS_PRICE="${{ env.GAS_PRICE }}"
GAS_LIMIT="${{ env.GAS_LIMIT }}"
Expand All @@ -144,7 +143,7 @@ jobs:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}

- name: Upload files to S3
if: github.ref == 'refs/heads/main'
if: github.ref == 'refs/heads/temporary-hoodi-deploy'
run: |
aws s3 cp ./build s3://${{ secrets.SSV_WEB_PROD_HOODI_AWS_S3_BUCKET }} --recursive
# </app.ssv.network>
# </app.ssv.network>
10 changes: 8 additions & 2 deletions scripts/generate-hook-exports.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,14 @@ function generate() {
const outputPath = path.join(HOOKS_DIR, `${name}.ts`);
const content = generateExportFile(name, hookNames);

fs.writeFileSync(outputPath, content, "utf-8");
console.log(` Generated: ${outputPath}`);
const existing = fs.existsSync(outputPath) ? fs.readFileSync(outputPath, "utf-8") : "";
const normalize = (s) => s.replace(/\s/g, "");
if (normalize(existing) === normalize(content)) {
console.log(` Unchanged: ${outputPath}`);
} else {
fs.writeFileSync(outputPath, content, "utf-8");
console.log(` Generated: ${outputPath}`);
}
}

console.log("Done!");
Expand Down
5 changes: 3 additions & 2 deletions src/app/layouts/dashboard/navbar-dvt.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { HiOutlineExternalLink, HiOutlineGlobeAlt } from "react-icons/hi";
import { TbDots } from "react-icons/tb";

import { ConnectWalletBtn } from "@/components/connect-wallet/connect-wallet-btn";
import { NetworkSwitchBtn } from "@/components/connect-wallet/network-switch-btn";
import { Button } from "@/components/ui/button";
import {
DropdownMenu,
Expand All @@ -23,6 +22,7 @@ import { ThemeSwitcher } from "@/components/ui/theme-switcher";
import { Link } from "react-router-dom";
import { useLinks } from "@/hooks/use-links";
import { useAccountState } from "@/hooks/account/use-account-state";
import { NetworkSwitcher } from "@/components/connect-wallet/network-switcher-hotfix";

export type NavbarProps = {
// TODO: Add props or remove this type
Expand Down Expand Up @@ -130,7 +130,8 @@ export const NavbarDVT: FCProps = ({ className, ...props }) => {

<Spacer />
<div className="flex items-center gap-3">
<NetworkSwitchBtn />
{/* <NetworkSwitchBtn /> */}
<NetworkSwitcher />
<ConnectWalletBtn />
<ThemeSwitcher />
</div>
Expand Down
14 changes: 14 additions & 0 deletions src/app/layouts/dashboard/navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,20 @@ export const Navbar: FCProps = ({ className, ...props }) => {
</DropdownMenu>
<div className="flex items-center gap-3">
<NetworkSwitchBtn />
<Button
as="a"
href="https://app.ssv.network/"
target="_blank"
size="wallet"
variant="secondary"
colorScheme="wallet"
className={textVariants({
variant: "body-3-medium",
className: "flex items-center h-12 px-4 rounded-xl",
})}
>
Mainnet App
</Button>
<ConnectWalletBtn />
</div>
<ThemeSwitcher className="ml-3" />
Expand Down
7 changes: 4 additions & 3 deletions src/app/routes/create-cluster/additional-funding.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ export const AdditionalFunding: FC = () => {
});

const context = useRegisterValidatorContext();
const deltaValidators = BigInt(context.shares.length);

const deltaEffectiveBalance = context.effectiveBalance;

const form = useForm({
defaultValues: { depositAmount: context.depositAmount, topUp: true },
Expand All @@ -53,7 +54,7 @@ export const AdditionalFunding: FC = () => {

const { data: clusterRunway } = useClusterRunway(params.clusterHash!, {
deltaBalance: topUp ? depositAmount : 0n,
deltaValidators,
deltaEffectiveBalance,
});

const submit = form.handleSubmit((data) => {
Expand All @@ -80,7 +81,7 @@ export const AdditionalFunding: FC = () => {
<Divider />
<EstimatedOperationalRunway
withAlerts={false}
deltaValidators={deltaValidators}
deltaEffectiveBalance={deltaEffectiveBalance}
deltaBalance={topUp ? depositAmount : 0n}
/>
</Card>
Expand Down
4 changes: 1 addition & 3 deletions src/app/routes/create-cluster/preparation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,7 @@ export const Preparation: FCProps = ({ className, ...props }) => {
</div>
<div className="flex items-center gap-2">
<BiCheck className="size-5 text-green-500" />
<Text variant="body-2-medium">
SSV tokens to cover operational fees
</Text>
<Text variant="body-2-medium">ETH to cover operational fees</Text>
</div>
</div>
<div className="flex flex-col w-full gap-3">
Expand Down
1 change: 1 addition & 0 deletions src/app/routes/dashboard/clusters/cluster/cluster.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export const Cluster: FC = () => {
<div className="grid grid-cols-4 gap-6 w-full">
{cluster.data?.operators.map((operatorId) => (
<OperatorStatCard
isClusterMigrated={isMigrated}
key={operatorId}
className="w-full"
operatorId={operatorId}
Expand Down
14 changes: 8 additions & 6 deletions src/components/cluster/estimated-operational-runway.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { FC, ComponentPropsWithoutRef } from "react";
import type { ComponentPropsWithoutRef, FC } from "react";
import { cn } from "@/lib/utils/tw";
import { Span, Text } from "@/components/ui/text";
import { FaCircleInfo } from "react-icons/fa6";
Expand All @@ -13,7 +13,7 @@ import { humanizeFundingDuration } from "@/lib/utils/date";
export type EstimatedOperationalRunwayProps = {
clusterHash?: string;
deltaBalance?: bigint;
deltaValidators?: bigint;
deltaEffectiveBalance?: bigint;
withAlerts?: boolean;
};

Expand All @@ -25,7 +25,7 @@ type EstimatedOperationalRunwayFC = FC<
export const EstimatedOperationalRunway: EstimatedOperationalRunwayFC = ({
className,
clusterHash,
deltaValidators = 0n,
deltaEffectiveBalance = 0n,
deltaBalance = 0n,
withAlerts = true,
...props
Expand All @@ -37,7 +37,7 @@ export const EstimatedOperationalRunway: EstimatedOperationalRunwayFC = ({

const { data: clusterRunway } = useClusterRunway(hash!, {
deltaBalance,
deltaValidators,
deltaEffectiveBalance,
watch: true,
});

Expand Down Expand Up @@ -81,10 +81,12 @@ export const EstimatedOperationalRunway: EstimatedOperationalRunwayFC = ({
{withAlerts && (
<EstimatedOperationalRunwayAlert
isLiquidated={isLiquidated.data ?? false}
hasDeltaValidators={deltaValidators !== 0n}
hasDeltaValidators={deltaEffectiveBalance !== 0n}
isAtRisk={clusterRunway?.isAtRisk ?? false}
runway={clusterRunway?.runway ?? 0n}
isWithdrawing={clusterRunway?.isDecreasing && !deltaValidators}
isWithdrawing={
clusterRunway?.isDecreasing && deltaEffectiveBalance === 0n
}
/>
)}
</div>
Expand Down
30 changes: 2 additions & 28 deletions src/components/connect-wallet/connect-wallet-btn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { textVariants } from "@/components/ui/text";
import { useAccount } from "@/hooks/account/use-account";
import { shortenAddress } from "@/lib/utils/strings";
import { ConnectButton } from "@rainbow-me/rainbowkit";
import { ChevronDown } from "lucide-react";
import type { FC } from "react";

type WalletType = "ledger" | "trezor" | "walletconnect" | "metamask";
Expand Down Expand Up @@ -40,15 +39,9 @@ export const ConnectWalletBtn: FC<ButtonProps> = (props) => {

return (
<ConnectButton.Custom>
{({
chain,
openAccountModal,
openChainModal,
openConnectModal,
mounted,
}) => {
{({ chain, openAccountModal, openConnectModal, mounted }) => {
const connected = mounted && account && chain;
if (!mounted) return null;
if (!mounted || chain?.unsupported) return null;

if (!connected) {
return (
Expand All @@ -64,25 +57,6 @@ export const ConnectWalletBtn: FC<ButtonProps> = (props) => {
);
}

if (chain.unsupported) {
return (
<Button
size="lg"
variant="destructive"
onClick={openChainModal}
className={textVariants({
variant: "body-3-medium",
className: "flex items-center gap-3 h-12 px-4 rounded-xl",
})}
{...props}
>
<div className="flex gap-1 items-center">
<span>Wrong Network</span> <ChevronDown className="size-5" />
</div>
</Button>
);
}

return (
<Button
data-cy="wallet-button"
Expand Down
Loading