Skip to content

Commit

Permalink
Revert "add realtime events using the solana rpc"
Browse files Browse the repository at this point in the history
This reverts commit c0d57a6.
  • Loading branch information
nibty committed May 11, 2024
1 parent a5bdc40 commit 4509316
Show file tree
Hide file tree
Showing 5 changed files with 149 additions and 909 deletions.
21 changes: 14 additions & 7 deletions app/leaderboard/StateStats.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
import React, { useEffect, useState } from "react";
import { useSearchParams } from "next/navigation";
import React, {useEffect, useState} from "react";
import {useSearchParams} from "next/navigation";

export interface State {
points: bigint;
interface State {
points: number;
hashes: number;
superHashes: number;
txs: number;
amp: number;
lastAmpSlot: bigint;
lastAmpSlot: number;
}

export default function StateStats({ state }: { state: State }) {
export default function StateStats({state}: { state: State }) {
const isLoading = () => state?.points === undefined;

const totalSupplyValue = () => {
if (isNaN(state?.points)) {
return null;
}
return Intl.NumberFormat("en-US").format(
parseInt(String(state.points / 1_000_000_000n)),
state?.points / 1_000_000_000,
);
};

Expand Down Expand Up @@ -48,6 +51,9 @@ export default function StateStats({ state }: { state: State }) {
};

const lastAmpSlotValue = () => {
if (isNaN(state?.lastAmpSlot)) {
return null;
}
return Intl.NumberFormat("en-US").format(state?.lastAmpSlot);
};

Expand Down Expand Up @@ -99,5 +105,6 @@ export default function StateStats({ state }: { state: State }) {
<div className="stat-value text-sm md:text-2xl">{txsValue()}</div>
</div>
</div>

);
}
Loading

0 comments on commit 4509316

Please sign in to comment.