mirror of
https://github.com/pezkuwichain/pwap.git
synced 2026-04-22 05:37:56 +00:00
Fix ESLint errors in governance screens, services, types, and utils
This commit is contained in:
@@ -72,8 +72,8 @@ const ForumScreen: React.FC = () => {
|
||||
setCategories([]);
|
||||
setDiscussions([]);
|
||||
|
||||
} catch (error) {
|
||||
console.error('Failed to load forum data:', error);
|
||||
} catch (_error) {
|
||||
if (__DEV__) console.error('Failed to load forum data:', _error);
|
||||
Alert.alert('Error', 'Failed to load forum data from database');
|
||||
} finally {
|
||||
setLoading(false);
|
||||
|
||||
@@ -78,8 +78,8 @@ const ProposalsScreen: React.FC = () => {
|
||||
|
||||
setProposals(parsedProposals);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Failed to load proposals:', error);
|
||||
} catch (_error) {
|
||||
if (__DEV__) console.error('Failed to load proposals:', _error);
|
||||
Alert.alert('Error', 'Failed to load proposals from blockchain');
|
||||
} finally {
|
||||
setLoading(false);
|
||||
@@ -91,6 +91,7 @@ const ProposalsScreen: React.FC = () => {
|
||||
fetchProposals();
|
||||
const interval = setInterval(fetchProposals, 30000);
|
||||
return () => clearInterval(interval);
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [api, isApiReady]);
|
||||
|
||||
const handleRefresh = () => {
|
||||
|
||||
@@ -73,8 +73,8 @@ const TreasuryScreen: React.FC = () => {
|
||||
});
|
||||
setProposals(parsedProposals);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Failed to load treasury data:', error);
|
||||
} catch (_error) {
|
||||
if (__DEV__) console.error('Failed to load treasury data:', _error);
|
||||
Alert.alert('Error', 'Failed to load treasury data from blockchain');
|
||||
} finally {
|
||||
setLoading(false);
|
||||
@@ -86,6 +86,7 @@ const TreasuryScreen: React.FC = () => {
|
||||
fetchTreasuryData();
|
||||
const interval = setInterval(fetchTreasuryData, 30000);
|
||||
return () => clearInterval(interval);
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [api, isApiReady]);
|
||||
|
||||
const handleRefresh = () => {
|
||||
|
||||
@@ -1,5 +1,16 @@
|
||||
import type { ApiPromise } from '@pezkuwi/api';
|
||||
import { decodeAddress } from '@pezkuwi/util-crypto';
|
||||
import { ImageSourcePropType } from 'react-native';
|
||||
|
||||
// Import token logos
|
||||
import hezLogo from '../../../shared/images/hez_token_512.png';
|
||||
import pezLogo from '../../../shared/images/pez_token_512.png';
|
||||
import usdtLogo from '../../../shared/images/USDT(hez)logo.png';
|
||||
import dotLogo from '../../../shared/images/dot.png';
|
||||
import btcLogo from '../../../shared/images/bitcoin.png';
|
||||
import ethLogo from '../../../shared/images/etherium.png';
|
||||
import bnbLogo from '../../../shared/images/BNB_logo.png';
|
||||
import adaLogo from '../../../shared/images/ADAlogo.png';
|
||||
|
||||
/**
|
||||
* Token metadata and balance information
|
||||
@@ -30,15 +41,15 @@ interface PriceData {
|
||||
}
|
||||
|
||||
// Known token logos mapping
|
||||
export const TOKEN_LOGOS: { [symbol: string]: any } = {
|
||||
HEZ: require('../../../shared/images/hez_token_512.png'),
|
||||
PEZ: require('../../../shared/images/pez_token_512.png'),
|
||||
USDT: require('../../../shared/images/USDT(hez)logo.png'),
|
||||
DOT: require('../../../shared/images/dot.png'),
|
||||
BTC: require('../../../shared/images/bitcoin.png'),
|
||||
ETH: require('../../../shared/images/etherium.png'),
|
||||
BNB: require('../../../shared/images/BNB_logo.png'),
|
||||
ADA: require('../../../shared/images/ADAlogo.png'),
|
||||
export const TOKEN_LOGOS: { [symbol: string]: ImageSourcePropType } = {
|
||||
HEZ: hezLogo,
|
||||
PEZ: pezLogo,
|
||||
USDT: usdtLogo,
|
||||
DOT: dotLogo,
|
||||
BTC: btcLogo,
|
||||
ETH: ethLogo,
|
||||
BNB: bnbLogo,
|
||||
ADA: adaLogo,
|
||||
};
|
||||
|
||||
// Predefined known tokens on PezkuwiChain
|
||||
|
||||
Vendored
+24
-24
@@ -11,31 +11,31 @@ declare module '@pezkuwi/types/types/codec' {
|
||||
isNone: boolean;
|
||||
isSome: boolean;
|
||||
isEmpty: boolean;
|
||||
unwrap(): any;
|
||||
unwrapOr<T>(defaultValue: T): any;
|
||||
unwrapOrDefault(): any;
|
||||
unwrap(): unknown;
|
||||
unwrapOr<T>(defaultValue: T): T | unknown;
|
||||
unwrapOrDefault(): unknown;
|
||||
|
||||
// Primitive conversions
|
||||
toNumber(): number;
|
||||
toBigInt(): bigint;
|
||||
toJSON(): any;
|
||||
toJSON(): unknown;
|
||||
toString(): string;
|
||||
toHex(): string;
|
||||
|
||||
// Common properties
|
||||
data?: any;
|
||||
free?: any;
|
||||
balance?: any;
|
||||
commission?: any;
|
||||
keys?: any;
|
||||
data?: { free?: Codec; balance?: Codec };
|
||||
free?: Codec;
|
||||
balance?: Codec;
|
||||
commission?: Codec;
|
||||
keys?: Codec[];
|
||||
|
||||
// Delegation checks
|
||||
isDelegating?: boolean;
|
||||
asDelegating?: any;
|
||||
asDelegating?: { target: Codec; balance: Codec; conviction: Codec };
|
||||
|
||||
// Iterator support
|
||||
[Symbol.iterator]?(): Iterator<any>;
|
||||
map?<T>(fn: (value: any) => T): T[];
|
||||
[Symbol.iterator]?(): Iterator<unknown>;
|
||||
map?<T>(fn: (value: unknown) => T): T[];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,22 +44,22 @@ declare module '@pezkuwi/types-codec' {
|
||||
isNone: boolean;
|
||||
isSome: boolean;
|
||||
isEmpty: boolean;
|
||||
unwrap(): any;
|
||||
unwrapOr<T>(defaultValue: T): any;
|
||||
unwrapOrDefault(): any;
|
||||
unwrap(): unknown;
|
||||
unwrapOr<T>(defaultValue: T): T | unknown;
|
||||
unwrapOrDefault(): unknown;
|
||||
toNumber(): number;
|
||||
toBigInt(): bigint;
|
||||
toJSON(): any;
|
||||
toJSON(): unknown;
|
||||
toString(): string;
|
||||
toHex(): string;
|
||||
data?: any;
|
||||
free?: any;
|
||||
balance?: any;
|
||||
commission?: any;
|
||||
keys?: any;
|
||||
data?: { free?: Codec; balance?: Codec };
|
||||
free?: Codec;
|
||||
balance?: Codec;
|
||||
commission?: Codec;
|
||||
keys?: Codec[];
|
||||
isDelegating?: boolean;
|
||||
asDelegating?: any;
|
||||
[Symbol.iterator]?(): Iterator<any>;
|
||||
map?<T>(fn: (value: any) => T): T[];
|
||||
asDelegating?: { target: Codec; balance: Codec; conviction: Codec };
|
||||
[Symbol.iterator]?(): Iterator<unknown>;
|
||||
map?<T>(fn: (value: unknown) => T): T[];
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+4
-2
@@ -28,9 +28,10 @@ declare module '@pezkuwi/extension-inject/types' {
|
||||
|
||||
declare module '@pezkuwi/extension-dapp' {
|
||||
import type { InjectedAccountWithMeta } from '@pezkuwi/extension-inject/types';
|
||||
import type { Signer } from '@pezkuwi/api/types';
|
||||
|
||||
interface InjectedWeb3 {
|
||||
signer: any;
|
||||
signer: Signer;
|
||||
name: string;
|
||||
version: string;
|
||||
}
|
||||
@@ -43,7 +44,8 @@ declare module '@pezkuwi/extension-dapp' {
|
||||
|
||||
// Path alias for shared lib - used in web context
|
||||
declare module '@/lib/supabase' {
|
||||
export const supabase: any;
|
||||
import type { SupabaseClient } from '@supabase/supabase-js';
|
||||
export const supabase: SupabaseClient;
|
||||
}
|
||||
|
||||
// Import.meta.env for Vite-like environments
|
||||
|
||||
@@ -53,7 +53,7 @@ export async function submitKycApplicationMobile(
|
||||
}
|
||||
|
||||
if (__DEV__) {
|
||||
console.log('[Citizenship] Submitting for:', address);
|
||||
console.warn('[Citizenship] Submitting for:', address);
|
||||
}
|
||||
|
||||
// Step 1: Set identity
|
||||
|
||||
Reference in New Issue
Block a user