Skip to content

Commit 5a57084

Browse files
authored
Release 2025-06-30 (#3414)
2 parents c79a6b7 + e4f1ec7 commit 5a57084

99 files changed

Lines changed: 3788 additions & 1546 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ yarn-error.log*
3838

3939
# IDE - IntelliJ
4040
.idea/
41+
*.iml
4142

4243
# OS
4344
.DS_Store
@@ -48,4 +49,5 @@ dist
4849
hardhat-dependency-compiler
4950

5051
# cache
51-
cache
52+
cache
53+

.husky/pre-commit

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
yarn dlx lint-staged
2-
yarn workspaces foreach --all -p run typecheck
32

43
# Format python file changes
54
cd packages/sdk/python/human-protocol-sdk

.husky/pre-push

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
echo "Running typecheck before push..."
2+
3+
if ! yarn workspaces foreach --all -p run typecheck; then
4+
echo ""
5+
echo "Typecheck failed! Please fix the errors above before pushing."
6+
exit 1
7+
fi

packages/apps/dashboard/client/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"clean": "tsc --build --clean && rm -rf dist",
1010
"start": "vite",
1111
"build": "tsc --build && vite build",
12-
"lint": "yarn typecheck && eslint . --report-unused-disable-directives --max-warnings 0",
12+
"lint": "eslint . --report-unused-disable-directives --max-warnings 0",
1313
"lint:fix": "eslint . --fix",
1414
"preview": "vite preview",
1515
"vercel-build": "yarn workspace human-protocol build:libs && yarn build",
@@ -24,7 +24,7 @@
2424
"@mui/material": "^5.15.18",
2525
"@mui/styled-engine-sc": "6.4.0",
2626
"@mui/system": "^5.15.14",
27-
"@mui/x-data-grid": "^7.23.2",
27+
"@mui/x-data-grid": "^8.5.2",
2828
"@mui/x-date-pickers": "^7.23.6",
2929
"@tanstack/react-query": "^5.67.2",
3030
"@types/react-router-dom": "^5.3.3",
@@ -60,7 +60,7 @@
6060
"eslint-plugin-react-refresh": "^0.4.11",
6161
"globals": "^16.2.0",
6262
"prettier": "^3.4.2",
63-
"sass": "^1.85.0",
63+
"sass": "^1.89.2",
6464
"typescript": "^5.6.3",
6565
"typescript-eslint": "^8.33.0",
6666
"vite": "^6.2.4"

packages/apps/dashboard/client/src/features/searchResults/model/addressDetailsSchema.ts

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -38,30 +38,20 @@ export type AddressDetailsWallet = z.infer<typeof walletSchema>;
3838
const escrowSchema = z.object({
3939
chainId: z.number().optional().nullable(),
4040
address: z.string().optional().nullable(),
41-
balance: z
42-
.string()
43-
.optional()
44-
.nullable()
45-
.transform(transformOptionalTokenAmount),
41+
balance: z.string().optional().nullable(),
4642
token: z.string().optional().nullable(),
4743
factoryAddress: z.string().optional().nullable(),
48-
totalFundedAmount: z
49-
.string()
50-
.optional()
51-
.nullable()
52-
.transform(transformOptionalTokenAmount),
53-
amountPaid: z
54-
.string()
55-
.optional()
56-
.nullable()
57-
.transform(transformOptionalTokenAmount),
44+
totalFundedAmount: z.string().optional().nullable(),
45+
amountPaid: z.string().optional().nullable(),
5846
status: z.string().optional().nullable(),
5947
manifest: z.string().optional().nullable(),
6048
launcher: z.string().optional().nullable(),
6149
exchangeOracle: z.string().optional().nullable(),
6250
recordingOracle: z.string().optional().nullable(),
6351
reputationOracle: z.string().optional().nullable(),
6452
finalResultsUrl: z.string().nullable(),
53+
tokenSymbol: z.string().optional().nullable(),
54+
tokenDecimals: z.number().optional().nullable(),
6555
});
6656

6757
export type AddressDetailsEscrow = z.infer<typeof escrowSchema>;

packages/apps/dashboard/client/src/features/searchResults/ui/EscrowAddress.tsx

Lines changed: 23 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ import { AddressDetailsEscrow } from '../model/addressDetailsSchema';
1010

1111
import HmtBalance from './HmtBalance';
1212
import TitleSectionWrapper from './TitleSectionWrapper';
13+
import TokenAmount from './TokenAmount';
1314

1415
type Props = {
1516
data: AddressDetailsEscrow;
1617
};
1718

1819
const EscrowAddress: FC<Props> = ({ data }) => {
1920
const {
20-
token,
2121
balance,
2222
factoryAddress,
2323
totalFundedAmount,
@@ -27,16 +27,26 @@ const EscrowAddress: FC<Props> = ({ data }) => {
2727
exchangeOracle,
2828
recordingOracle,
2929
reputationOracle,
30+
tokenSymbol,
3031
} = data;
32+
const isHmt = tokenSymbol === 'HMT';
3133
return (
3234
<SectionWrapper>
3335
<Stack gap={4}>
3436
<TitleSectionWrapper title="Token">
35-
<Typography variant="body2">{token}</Typography>
37+
<Typography variant="body2">{tokenSymbol}</Typography>
3638
</TitleSectionWrapper>
3739
{balance !== undefined && balance !== null ? (
3840
<TitleSectionWrapper title="Balance">
39-
<HmtBalance balance={balance} />
41+
{isHmt ? (
42+
<HmtBalance balance={balance} />
43+
) : (
44+
<TokenAmount
45+
amount={balance}
46+
tokenSymbol={tokenSymbol}
47+
alreadyParsed
48+
/>
49+
)}
4050
</TitleSectionWrapper>
4151
) : null}
4252
<TitleSectionWrapper
@@ -46,30 +56,18 @@ const EscrowAddress: FC<Props> = ({ data }) => {
4656
<Typography variant="body2">{factoryAddress}</Typography>
4757
</TitleSectionWrapper>
4858
<TitleSectionWrapper title="Total Funded Amount">
49-
<Stack direction="row" whiteSpace="nowrap">
50-
<Typography variant="body2">{totalFundedAmount}</Typography>
51-
<Typography
52-
component="span"
53-
variant="body2"
54-
ml={0.5}
55-
color="text.secondary"
56-
>
57-
HMT
58-
</Typography>
59-
</Stack>
59+
<TokenAmount
60+
amount={totalFundedAmount}
61+
tokenSymbol={tokenSymbol}
62+
alreadyParsed
63+
/>
6064
</TitleSectionWrapper>
6165
<TitleSectionWrapper title="Paid Amount">
62-
<Stack direction="row" whiteSpace="nowrap">
63-
<Typography variant="body2">{amountPaid}</Typography>
64-
<Typography
65-
component="span"
66-
variant="body2"
67-
ml={0.5}
68-
color="text.secondary"
69-
>
70-
HMT
71-
</Typography>
72-
</Stack>
66+
<TokenAmount
67+
amount={amountPaid}
68+
tokenSymbol={tokenSymbol}
69+
alreadyParsed
70+
/>
7371
</TitleSectionWrapper>
7472

7573
<TitleSectionWrapper title="Status">

packages/apps/dashboard/client/src/features/searchResults/ui/HmtBalance.tsx

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,15 @@ import Stack from '@mui/material/Stack';
44
import Typography from '@mui/material/Typography';
55

66
import useHmtPrice from '@/shared/api/useHmtPrice';
7-
import { useIsMobile } from '@/shared/hooks/useBreakpoints';
8-
import FormattedNumber from '@/shared/ui/FormattedNumber';
7+
8+
import TokenAmount from './TokenAmount';
99

1010
type Props = {
11-
balance?: number | null;
11+
balance?: number | string | null;
1212
};
1313

1414
const HmtBalance: FC<Props> = ({ balance }) => {
1515
const { data, isError, isPending } = useHmtPrice();
16-
const isMobile = useIsMobile();
1716

1817
if (isError) {
1918
return <span>N/A</span>;
@@ -29,16 +28,9 @@ const HmtBalance: FC<Props> = ({ balance }) => {
2928

3029
return (
3130
<Stack flexDirection="row" whiteSpace="nowrap">
32-
<Typography variant="body2">
33-
<FormattedNumber value={_balance} decimalScale={isMobile ? 4 : 9} />
34-
</Typography>
35-
<Typography
36-
component="span"
37-
variant="body2"
38-
ml={0.5}
39-
color="text.secondary"
40-
>
41-
{`HMT($${balanceInDollars})`}
31+
<TokenAmount amount={_balance} alreadyParsed />
32+
<Typography component="span" variant="body2" color="text.secondary">
33+
{`($${balanceInDollars})`}
4234
</Typography>
4335
</Stack>
4436
);

packages/apps/dashboard/client/src/features/searchResults/ui/StakeInfo.tsx

Lines changed: 5 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,43 +3,21 @@ import { FC } from 'react';
33
import Stack from '@mui/material/Stack';
44
import Typography from '@mui/material/Typography';
55

6-
import { useIsMobile } from '@/shared/hooks/useBreakpoints';
7-
import FormattedNumber from '@/shared/ui/FormattedNumber';
86
import SectionWrapper from '@/shared/ui/SectionWrapper';
97

8+
import TokenAmount from './TokenAmount';
9+
1010
type Props = {
1111
amountStaked?: number | null;
1212
amountLocked?: number | null;
1313
amountWithdrawable?: number | null;
1414
};
1515

16-
const renderAmount = (amount: number | null | undefined, isMobile: boolean) => {
17-
return (
18-
<Stack direction="row" whiteSpace="nowrap">
19-
<Typography variant="body2">
20-
<FormattedNumber
21-
value={(amount || 0) * 1e18}
22-
decimalScale={isMobile ? 4 : 9}
23-
/>
24-
</Typography>
25-
<Typography
26-
variant="body2"
27-
color="text.secondary"
28-
component="span"
29-
ml={0.5}
30-
>
31-
HMT
32-
</Typography>
33-
</Stack>
34-
);
35-
};
36-
3716
const StakeInfo: FC<Props> = ({
3817
amountStaked,
3918
amountLocked,
4019
amountWithdrawable,
4120
}) => {
42-
const isMobile = useIsMobile();
4321
if (!amountStaked && !amountLocked && !amountWithdrawable) return null;
4422

4523
return (
@@ -53,23 +31,23 @@ const StakeInfo: FC<Props> = ({
5331
<Typography variant="subtitle2" width={300}>
5432
Staked Tokens
5533
</Typography>
56-
{renderAmount(amountStaked, isMobile)}
34+
<TokenAmount amount={amountStaked} />
5735
</Stack>
5836
)}
5937
{Number.isFinite(amountLocked) && (
6038
<Stack gap={{ xs: 1, md: 0 }} direction={{ sm: 'column', md: 'row' }}>
6139
<Typography variant="subtitle2" width={300}>
6240
Locked Tokens
6341
</Typography>
64-
{renderAmount(amountLocked, isMobile)}
42+
<TokenAmount amount={amountLocked} />
6543
</Stack>
6644
)}
6745
{Number.isFinite(amountWithdrawable) && (
6846
<Stack gap={{ xs: 1, md: 0 }} direction={{ sm: 'column', md: 'row' }}>
6947
<Typography variant="subtitle2" width={300}>
7048
Withdrawable Tokens
7149
</Typography>
72-
{renderAmount(amountWithdrawable, isMobile)}
50+
<TokenAmount amount={amountWithdrawable} />
7351
</Stack>
7452
)}
7553
</Stack>
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import { FC } from 'react';
2+
3+
import Stack from '@mui/material/Stack';
4+
import Typography from '@mui/material/Typography';
5+
6+
import { useIsMobile } from '@/shared/hooks/useBreakpoints';
7+
import FormattedNumber from '@/shared/ui/FormattedNumber';
8+
9+
type Props = {
10+
amount: number | string | null | undefined;
11+
tokenSymbol?: string | null | undefined;
12+
alreadyParsed?: boolean;
13+
};
14+
15+
const TokenAmount: FC<Props> = ({
16+
amount,
17+
tokenSymbol = 'HMT',
18+
alreadyParsed = false,
19+
}) => {
20+
const isMobile = useIsMobile();
21+
22+
return (
23+
<Stack direction="row" whiteSpace="nowrap">
24+
<Typography variant="body2">
25+
<FormattedNumber
26+
value={(Number(amount) || 0) * (alreadyParsed ? 1 : 1e18)}
27+
decimalScale={isMobile ? 4 : 9}
28+
/>
29+
</Typography>
30+
<Typography
31+
variant="body2"
32+
color="text.secondary"
33+
component="span"
34+
ml={0.5}
35+
>
36+
{tokenSymbol}
37+
</Typography>
38+
</Stack>
39+
);
40+
};
41+
42+
export default TokenAmount;

packages/apps/dashboard/client/src/features/searchResults/ui/WalletAddress.tsx

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ import { FC } from 'react';
33
import Stack from '@mui/material/Stack';
44
import Typography from '@mui/material/Typography';
55

6-
import { useIsMobile } from '@/shared/hooks/useBreakpoints';
7-
import FormattedNumber from '@/shared/ui/FormattedNumber';
86
import SectionWrapper from '@/shared/ui/SectionWrapper';
97

108
import {
@@ -18,6 +16,7 @@ import KVStore from './KvStore';
1816
import ReputationScore from './ReputationScore';
1917
import StakeInfo from './StakeInfo';
2018
import TitleSectionWrapper from './TitleSectionWrapper';
19+
import TokenAmount from './TokenAmount';
2120

2221
type Props = {
2322
data: AddressDetailsWallet | AddressDetailsOperator;
@@ -31,7 +30,6 @@ const WalletAddress: FC<Props> = ({ data }) => {
3130
reputation,
3231
amountWithdrawable,
3332
} = data;
34-
const isMobile = useIsMobile();
3533
const isWallet = 'totalHMTAmountReceived' in data;
3634

3735
return (
@@ -56,20 +54,7 @@ const WalletAddress: FC<Props> = ({ data }) => {
5654
title="Earned Payouts"
5755
tooltip="Total amount earned by participating in jobs"
5856
>
59-
<Typography variant="body2">
60-
<FormattedNumber
61-
value={(data?.totalHMTAmountReceived || 0) * 1e18}
62-
decimalScale={isMobile ? 4 : 9}
63-
/>
64-
</Typography>
65-
<Typography
66-
component="span"
67-
variant="body2"
68-
ml={0.5}
69-
color="text.secondary"
70-
>
71-
HMT
72-
</Typography>
57+
<TokenAmount amount={data?.totalHMTAmountReceived} />
7358
</TitleSectionWrapper>
7459
)}
7560
</Stack>

0 commit comments

Comments
 (0)