refactor(scores): remove frontend fallback, read all scores from blockchain

Remove all frontend staking/trust score calculation and localStorage
fallback code. All scores now read directly from People Chain pallets
(pezpallet-trust, pezpallet-referral, pezpallet-tiki). Trust pallet
computes composite score on-chain.
This commit is contained in:
2026-02-13 03:14:57 +03:00
parent 910114d9f0
commit b378aeb171
5 changed files with 28 additions and 546 deletions
+4 -7
View File
@@ -4,7 +4,7 @@ import { ChevronRight, Shield } from 'lucide-react';
import { usePezkuwi } from '../contexts/PezkuwiContext';
import { useWallet } from '../contexts/WalletContext'; // Import useWallet
import { formatBalance } from '@pezkuwi/lib/wallet';
import { getTrustScoreWithFallback } from '@pezkuwi/lib/scores';
import { getTrustScore } from '@pezkuwi/lib/scores';
const HeroSection: React.FC = () => {
const { t } = useTranslation();
@@ -25,12 +25,9 @@ const HeroSection: React.FC = () => {
if (selectedAccount?.address) {
try {
// Use frontend fallback for trust score
const trustResult = await getTrustScoreWithFallback(
peopleApi || null,
api,
selectedAccount.address
);
currentTrustScore = trustResult.trustScore;
if (peopleApi) {
currentTrustScore = await getTrustScore(peopleApi, selectedAccount.address);
}
} catch (err) {
if (import.meta.env.DEV) console.warn('Failed to fetch trust score:', err);
currentTrustScore = 0;