Skip to content
This repository was archived by the owner on Sep 8, 2025. It is now read-only.

Commit 5ab7fbb

Browse files
fix: fetch all baby validators (#1451)
1 parent a162dda commit 5ab7fbb

File tree

6 files changed

+13
-32
lines changed

6 files changed

+13
-32
lines changed

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"node": "24.2.0"
3030
},
3131
"dependencies": {
32-
"@babylonlabs-io/babylon-proto-ts": "1.9.0",
32+
"@babylonlabs-io/babylon-proto-ts": "1.10.3",
3333
"@babylonlabs-io/btc-staking-ts": "2.5.6",
3434
"@babylonlabs-io/core-ui": "1.24.0",
3535
"@babylonlabs-io/wallet-connector": "1.11.1",

src/ui/baby/hooks/api/useEpochPolling.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { useQuery, useQueryClient } from "@tanstack/react-query";
22
import { useEffect, useRef } from "react";
33

4-
import { getCurrentBabylonEpoch } from "@/ui/common/api/getCurrentEpoch";
4+
import babylon from "@/infrastructure/babylon";
55
import { ONE_MINUTE } from "@/ui/common/constants";
66

77
import { usePendingOperationsService } from "../services/usePendingOperationsService";
@@ -19,7 +19,11 @@ export function useEpochPolling(address?: string) {
1919

2020
const { data: currentEpoch } = useQuery<number, Error>({
2121
queryKey: [BABYLON_CURRENT_EPOCH_KEY],
22-
queryFn: () => getCurrentBabylonEpoch(),
22+
queryFn: async () => {
23+
const client = await babylon.client();
24+
const { currentEpoch } = await client.baby.getCurrentEpoch();
25+
return currentEpoch;
26+
},
2327
refetchInterval: ONE_MINUTE,
2428
// Only poll if we have an address (user is connected)
2529
enabled: Boolean(address),

src/ui/baby/widgets/StakingForm/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export default function StakingForm({
5050

5151
<SubmitButton disabled={loading} isGeoBlocked={isGeoBlocked} />
5252
<StakingModal />
53-
<FormAlert address={undefined} isGeoBlocked={isGeoBlocked} />
53+
<FormAlert isGeoBlocked={isGeoBlocked} />
5454
</Form>
5555
);
5656
}

src/ui/common/api/getCurrentEpoch.ts

Lines changed: 0 additions & 23 deletions
This file was deleted.

src/ui/common/components/Multistaking/MultistakingForm/FormAlert.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { STAKING_DISABLED } from "@/ui/common/constants";
55
import { GEO_BLOCK_MESSAGE } from "@/ui/common/types/services/healthCheck";
66

77
interface FormAlertProps {
8-
address: string | undefined;
8+
address?: string;
99
isGeoBlocked: boolean;
1010
}
1111

0 commit comments

Comments
 (0)