diff --git a/mobile/assets/adaptive-icon.png b/mobile/assets/adaptive-icon.png index 445f8f22..1c1fe218 100644 Binary files a/mobile/assets/adaptive-icon.png and b/mobile/assets/adaptive-icon.png differ diff --git a/mobile/assets/icon.png b/mobile/assets/icon.png index 445f8f22..1c1fe218 100644 Binary files a/mobile/assets/icon.png and b/mobile/assets/icon.png differ diff --git a/mobile/metro.config.cjs b/mobile/metro.config.cjs index 64603a57..b013aa49 100644 --- a/mobile/metro.config.cjs +++ b/mobile/metro.config.cjs @@ -23,22 +23,23 @@ const projectRoot = __dirname; // FILE EXTENSIONS // ============================================ +// Extend default extensions instead of replacing them config.resolver.sourceExts = [ + ...config.resolver.sourceExts, 'expo.ts', 'expo.tsx', 'expo.js', 'expo.jsx', - 'ts', - 'tsx', - 'js', - 'jsx', - 'json', 'wasm', - 'svg', - 'cjs', - 'mjs', ]; +// SVG should be handled as source file for react-native-svg transformer +// Remove svg from assetExts if present, add to sourceExts +config.resolver.assetExts = config.resolver.assetExts.filter(ext => ext !== 'svg'); +if (!config.resolver.sourceExts.includes('svg')) { + config.resolver.sourceExts.push('svg'); +} + // ============================================ // NODE POLYFILLS // ============================================ diff --git a/mobile/package.json b/mobile/package.json index ee3353ab..e6f205a3 100644 --- a/mobile/package.json +++ b/mobile/package.json @@ -38,7 +38,7 @@ "@pezkuwi/util": "14.0.11", "@pezkuwi/util-crypto": "14.0.11", "@react-native-async-storage/async-storage": "^2.2.0", - "@react-native-picker/picker": "^2.9.2", + "@react-native-picker/picker": "2.11.1", "@react-navigation/bottom-tabs": "^7.8.5", "@react-navigation/native": "^7.1.20", "@react-navigation/stack": "^7.6.4", @@ -88,9 +88,9 @@ "@pezkuwi/util-crypto": "14.0.11" }, "devDependencies": { + "@expo/ngrok": "^4.1.0", "@pezkuwi/extension-dapp": "0.62.14", "@pezkuwi/extension-inject": "0.62.14", - "@expo/ngrok": "^4.1.0", "@testing-library/jest-native": "^5.4.3", "@testing-library/react-native": "^13.3.3", "@types/invariant": "^2", @@ -110,5 +110,10 @@ "typescript": "~5.9.2", "typescript-eslint": "^8.47.0" }, - "private": true + "private": true, + "expo": { + "install": { + "exclude": ["@types/react"] + } + } } diff --git a/mobile/src/components/Card.tsx b/mobile/src/components/Card.tsx index a2307888..660c1702 100644 --- a/mobile/src/components/Card.tsx +++ b/mobile/src/components/Card.tsx @@ -47,7 +47,12 @@ export const Card: React.FC = ({ testID={testID} onPress={onPress} style={({ pressed }) => [ - ...cardStyle, + styles.card, + variant === 'elevated' && styles.elevated, + variant === 'outlined' && styles.outlined, + variant === 'filled' && styles.filled, + elevation ? { elevation } : null, + style, pressed && styles.pressed, ]} > @@ -56,7 +61,7 @@ export const Card: React.FC = ({ ); } - return {content}; + return {content}; }; const styles = StyleSheet.create({ diff --git a/mobile/src/components/ChangePasswordModal.tsx b/mobile/src/components/ChangePasswordModal.tsx index 7a607c78..213ea406 100644 --- a/mobile/src/components/ChangePasswordModal.tsx +++ b/mobile/src/components/ChangePasswordModal.tsx @@ -90,7 +90,7 @@ const ChangePasswordModal: React.FC = ({ { text: 'Send Reset Link', onPress: async () => { - const { error } = await resetPassword(user.email); + const { error } = await resetPassword(user.email!); if (error) { Alert.alert('Error', error.message || 'Failed to send reset email'); } else { diff --git a/mobile/src/components/Input.tsx b/mobile/src/components/Input.tsx index 31c1451a..0b35c441 100644 --- a/mobile/src/components/Input.tsx +++ b/mobile/src/components/Input.tsx @@ -16,6 +16,7 @@ interface InputProps extends TextInputProps { leftIcon?: React.ReactNode; rightIcon?: React.ReactNode; onRightIconPress?: () => void; + disabled?: boolean; } /** @@ -30,6 +31,7 @@ export const Input: React.FC = ({ rightIcon, onRightIconPress, style, + disabled, ...props }) => { const [isFocused, setIsFocused] = useState(false); @@ -58,8 +60,8 @@ export const Input: React.FC = ({ {leftIcon && {leftIcon}} { setIsFocused(true); props.onFocus?.(e); @@ -94,7 +96,6 @@ const styles = StyleSheet.create({ fontWeight: '500', color: AppColors.textSecondary, marginBottom: 8, - transition: 'all 0.2s', }, labelFocused: { color: KurdistanColors.kesk, @@ -115,7 +116,6 @@ const styles = StyleSheet.create({ inputContainerFocused: { borderColor: KurdistanColors.kesk, borderWidth: 2, - boxShadow: '0px 2px 4px rgba(0, 128, 0, 0.1)', elevation: 2, }, inputContainerError: { diff --git a/mobile/src/components/LoadingSkeleton.tsx b/mobile/src/components/LoadingSkeleton.tsx index 9a9b5ad5..46bfe267 100644 --- a/mobile/src/components/LoadingSkeleton.tsx +++ b/mobile/src/components/LoadingSkeleton.tsx @@ -49,7 +49,7 @@ export const Skeleton: React.FC = ({ diff --git a/mobile/src/components/ValidatorSelectionSheet.tsx b/mobile/src/components/ValidatorSelectionSheet.tsx index a520337e..fbf557f5 100644 --- a/mobile/src/components/ValidatorSelectionSheet.tsx +++ b/mobile/src/components/ValidatorSelectionSheet.tsx @@ -56,11 +56,11 @@ export function ValidatorSelectionSheet({ } } else { // Fallback to general staking validators if validatorPool pallet is not found/used - const rawStakingValidators = await api.query.staking.validators(); - for (const validatorAddress of rawStakingValidators.keys) { + const rawStakingValidators = await api.query.staking.validators() as any; + for (const validatorAddress of (rawStakingValidators.keys || [])) { const address = validatorAddress.args[0].toString(); // Fetch more details about each validator if needed, e.g., commission, total stake - const validatorPrefs = await api.query.staking.validators(address); + const validatorPrefs = await api.query.staking.validators(address) as any; const commission = validatorPrefs.commission.toNumber() / 10_000_000; // Assuming 10^7 for percentage // For simplicity, total stake and nominators are placeholders for now diff --git a/mobile/src/components/navigation/SharedHeader.tsx b/mobile/src/components/navigation/SharedHeader.tsx index c84cbf53..5c194151 100644 --- a/mobile/src/components/navigation/SharedHeader.tsx +++ b/mobile/src/components/navigation/SharedHeader.tsx @@ -3,11 +3,16 @@ import { View, Text, TouchableOpacity, StyleSheet } from 'react-native'; import { LinearGradient } from 'expo-linear-gradient'; import { KurdistanColors } from '../../theme/colors'; import type { StackHeaderProps } from '@react-navigation/stack'; +import type { BottomTabHeaderProps } from '@react-navigation/bottom-tabs'; -interface GradientHeaderProps extends StackHeaderProps { +type HeaderPropsBase = StackHeaderProps | BottomTabHeaderProps; + +interface GradientHeaderProps extends Omit { subtitle?: string; rightButtons?: React.ReactNode; gradientColors?: [string, string]; + progress?: unknown; + styleInterpolator?: unknown; } export const GradientHeader: React.FC = ({ @@ -18,11 +23,12 @@ export const GradientHeader: React.FC = ({ rightButtons, gradientColors = [KurdistanColors.kesk, '#008f43'], }) => { - const title = options.headerTitle !== undefined - ? options.headerTitle - : options.title !== undefined - ? options.title - : route.name; + const getTitle = () => { + if (typeof options.headerTitle === 'string') return options.headerTitle; + if (typeof options.title === 'string') return options.title; + return route.name; + }; + const title = getTitle(); const canGoBack = navigation.canGoBack(); @@ -51,8 +57,10 @@ export const GradientHeader: React.FC = ({ ); }; -interface SimpleHeaderProps extends StackHeaderProps { +interface SimpleHeaderProps extends Omit { rightButtons?: React.ReactNode; + progress?: unknown; + styleInterpolator?: unknown; } export const SimpleHeader: React.FC = ({ @@ -61,11 +69,12 @@ export const SimpleHeader: React.FC = ({ route, rightButtons, }) => { - const title = options.headerTitle !== undefined - ? options.headerTitle - : options.title !== undefined - ? options.title - : route.name; + const getTitle = () => { + if (typeof options.headerTitle === 'string') return options.headerTitle; + if (typeof options.title === 'string') return options.title; + return route.name; + }; + const title = getTitle(); const canGoBack = navigation.canGoBack(); @@ -104,8 +113,10 @@ export const BackButton: React.FC<{ onPress?: () => void; color?: string }> = ({ ); }; -interface AppBarHeaderProps extends StackHeaderProps { +interface AppBarHeaderProps extends Omit { rightButtons?: React.ReactNode; + progress?: unknown; + styleInterpolator?: unknown; } export const AppBarHeader: React.FC = ({ @@ -114,11 +125,12 @@ export const AppBarHeader: React.FC = ({ route, rightButtons, }) => { - const title = options.headerTitle !== undefined - ? options.headerTitle - : options.title !== undefined - ? options.title - : route.name; + const getTitle = () => { + if (typeof options.headerTitle === 'string') return options.headerTitle; + if (typeof options.title === 'string') return options.title; + return route.name; + }; + const title = getTitle(); const canGoBack = navigation.canGoBack(); diff --git a/mobile/src/contexts/PezkuwiContext.tsx b/mobile/src/contexts/PezkuwiContext.tsx index 0c09e23a..0c4b21a1 100644 --- a/mobile/src/contexts/PezkuwiContext.tsx +++ b/mobile/src/contexts/PezkuwiContext.tsx @@ -173,7 +173,7 @@ export const PezkuwiProvider: React.FC = ({ children }) => newApi.registry.setChainProperties( newApi.registry.createType('ChainProperties', { ss58Format: networkConfig.ss58Format, - }) + }) as any ); console.log(`✅ [Pezkuwi] API created with SS58 format: ${networkConfig.ss58Format}`); diff --git a/mobile/src/screens/AuthScreen.tsx b/mobile/src/screens/AuthScreen.tsx index def07439..526e67bb 100644 --- a/mobile/src/screens/AuthScreen.tsx +++ b/mobile/src/screens/AuthScreen.tsx @@ -52,7 +52,7 @@ const AuthScreen: React.FC = () => { setLoading(true); try { - const { error: signInError } = await signIn(loginEmail, loginPassword, rememberMe); + const { error: signInError } = await signIn(loginEmail, loginPassword); if (signInError) { if (signInError.message?.includes('Invalid login credentials')) { diff --git a/mobile/src/screens/DashboardScreen.tsx b/mobile/src/screens/DashboardScreen.tsx index 8aee8c63..ae745c92 100644 --- a/mobile/src/screens/DashboardScreen.tsx +++ b/mobile/src/screens/DashboardScreen.tsx @@ -411,7 +411,7 @@ const DashboardScreen: React.FC = () => { {kycStatus === 'NotStarted' && ( navigation.navigate('BeCitizen')} + onPress={() => navigation.navigate('BeCitizenChoice')} > Apply @@ -454,7 +454,7 @@ const DashboardScreen: React.FC = () => { {renderAppIcon('Justice', '⚖️', () => showComingSoon('Dad / Justice'), true, true)} {renderAppIcon('Proposals', '📜', () => showComingSoon('Proposals'), true, true)} {renderAppIcon('Polls', '📊', () => showComingSoon('Public Polls'), true, true)} - {renderAppIcon('Identity', '🆔', () => navigation.navigate('BeCitizen'), true)} + {renderAppIcon('Identity', '🆔', () => navigation.navigate('BeCitizenChoice'), true)} diff --git a/mobile/src/screens/NFTGalleryScreen.tsx b/mobile/src/screens/NFTGalleryScreen.tsx index 2db1e3c7..2d3f5945 100644 --- a/mobile/src/screens/NFTGalleryScreen.tsx +++ b/mobile/src/screens/NFTGalleryScreen.tsx @@ -68,7 +68,7 @@ export default function NFTGalleryScreen() { description: 'Official citizenship NFT of Digital Kurdistan. This NFT represents your verified status as a citizen of the Pezkuwi nation.', image: '🪪', // Will use emoji/icon for now rarity: 'legendary', - mintDate: new Date(nftData?.mintedAt || Date.now()).toISOString(), + mintDate: new Date((nftData?.mintedAt as number | string | undefined) || Date.now()).toISOString(), attributes: [ { trait: 'Type', value: 'Citizenship' }, { trait: 'Nation', value: 'Kurdistan' }, diff --git a/mobile/src/screens/PoolBrowserScreen.tsx b/mobile/src/screens/PoolBrowserScreen.tsx index 3a397a5f..0dee029d 100644 --- a/mobile/src/screens/PoolBrowserScreen.tsx +++ b/mobile/src/screens/PoolBrowserScreen.tsx @@ -91,18 +91,18 @@ const PoolBrowserScreen: React.FC = () => { try { if (asset1 === 0) { // Native token (wHEZ) - const balance1 = await api.query.system.account(poolAccount); + const balance1 = await api.query.system.account(poolAccount) as any; reserve1 = balance1.data.free.toString(); } else { - const balance1 = await api.query.assets.account(asset1, poolAccount); + const balance1 = await api.query.assets.account(asset1, poolAccount) as any; reserve1 = balance1.isSome ? balance1.unwrap().balance.toString() : '0'; } if (asset2 === 0) { - const balance2 = await api.query.system.account(poolAccount); + const balance2 = await api.query.system.account(poolAccount) as any; reserve2 = balance2.data.free.toString(); } else { - const balance2 = await api.query.assets.account(asset2, poolAccount); + const balance2 = await api.query.assets.account(asset2, poolAccount) as any; reserve2 = balance2.isSome ? balance2.unwrap().balance.toString() : '0'; } } catch (error) { diff --git a/mobile/src/screens/SettingsScreen.tsx b/mobile/src/screens/SettingsScreen.tsx index 6aa91ca9..e6d368b9 100644 --- a/mobile/src/screens/SettingsScreen.tsx +++ b/mobile/src/screens/SettingsScreen.tsx @@ -18,7 +18,8 @@ import { import AsyncStorage from '@react-native-async-storage/async-storage'; import * as SecureStore from 'expo-secure-store'; import { Clipboard } from 'react-native'; -import { useNavigation } from '@react-navigation/native'; +import { useNavigation, NavigationProp } from '@react-navigation/native'; +import { RootStackParamList } from '../navigation/AppNavigator'; import { KurdistanColors } from '../theme/colors'; import { useTheme } from '../contexts/ThemeContext'; import { useBiometricAuth } from '../contexts/BiometricAuthContext'; @@ -152,7 +153,7 @@ const SettingToggle = ({ // --- MAIN SCREEN --- const SettingsScreen: React.FC = () => { - const navigation = useNavigation(); + const navigation = useNavigation>(); const { isDarkMode, toggleDarkMode, colors, fontSize, setFontSize } = useTheme(); const { isBiometricEnabled, enableBiometric, disableBiometric, biometricType, autoLockTimer, setAutoLockTimer } = useBiometricAuth(); const { signOut, user } = useAuth(); diff --git a/mobile/src/screens/StakingScreen.tsx b/mobile/src/screens/StakingScreen.tsx index 561dd944..7171df2f 100644 --- a/mobile/src/screens/StakingScreen.tsx +++ b/mobile/src/screens/StakingScreen.tsx @@ -70,7 +70,7 @@ export default function StakingScreen() { const scores = await getAllScores(api, selectedAccount.address); // 3. Get Current Era - const currentEraOpt = await api.query.staking.currentEra(); + const currentEraOpt = await api.query.staking.currentEra() as any; const currentEra = currentEraOpt.unwrapOrDefault().toNumber(); // Calculations diff --git a/mobile/src/screens/SwapScreen.tsx b/mobile/src/screens/SwapScreen.tsx index 6f142bd7..8923d61f 100644 --- a/mobile/src/screens/SwapScreen.tsx +++ b/mobile/src/screens/SwapScreen.tsx @@ -78,10 +78,10 @@ const SwapScreen: React.FC = () => { // Fetch From Token Balance try { if (fromToken.symbol === 'HEZ') { - const accountInfo = await api.query.system.account(selectedAccount.address); + const accountInfo = await api.query.system.account(selectedAccount.address) as any; setFromBalance(accountInfo.data.free.toString()); } else { - const balanceData = await api.query.assets.account(fromToken.assetId, selectedAccount.address); + const balanceData = await api.query.assets.account(fromToken.assetId, selectedAccount.address) as any; setFromBalance(balanceData.isSome ? balanceData.unwrap().balance.toString() : '0'); } } catch (error) { @@ -92,10 +92,10 @@ const SwapScreen: React.FC = () => { // Fetch To Token Balance try { if (toToken.symbol === 'HEZ') { - const accountInfo = await api.query.system.account(selectedAccount.address); + const accountInfo = await api.query.system.account(selectedAccount.address) as any; setToBalance(accountInfo.data.free.toString()); } else { - const balanceData = await api.query.assets.account(toToken.assetId, selectedAccount.address); + const balanceData = await api.query.assets.account(toToken.assetId, selectedAccount.address) as any; setToBalance(balanceData.isSome ? balanceData.unwrap().balance.toString() : '0'); } } catch (error) { diff --git a/mobile/src/screens/WalletScreen.tsx b/mobile/src/screens/WalletScreen.tsx index ff1dc872..0ce5572a 100644 --- a/mobile/src/screens/WalletScreen.tsx +++ b/mobile/src/screens/WalletScreen.tsx @@ -205,13 +205,13 @@ const WalletScreen: React.FC = () => { accountId = selectedAccount.address as any; } - const accountInfo = await api.query.system.account(accountId); + const accountInfo = await api.query.system.account(accountId) as any; const hezBalance = (Number(accountInfo.data.free.toString()) / 1e12).toFixed(2); let pezBalance = '0.00'; try { if (api.query.assets?.account) { - const pezAsset = await api.query.assets.account(1, accountId); + const pezAsset = await api.query.assets.account(1, accountId) as any; if (pezAsset.isSome) pezBalance = (Number(pezAsset.unwrap().balance.toString()) / 1e12).toFixed(2); } } catch (e) { @@ -222,9 +222,9 @@ const WalletScreen: React.FC = () => { try { if (api.query.assets?.account) { // Check ID 1000 first (as per constants), fallback to 2 just in case - let usdtAsset = await api.query.assets.account(1000, accountId); + let usdtAsset = await api.query.assets.account(1000, accountId) as any; if (usdtAsset.isNone) { - usdtAsset = await api.query.assets.account(2, accountId); + usdtAsset = await api.query.assets.account(2, accountId) as any; } if (usdtAsset.isSome) { diff --git a/mobile/src/screens/governance/DelegationScreen.tsx b/mobile/src/screens/governance/DelegationScreen.tsx index 839e4380..8655b9c7 100644 --- a/mobile/src/screens/governance/DelegationScreen.tsx +++ b/mobile/src/screens/governance/DelegationScreen.tsx @@ -114,7 +114,7 @@ const DelegationScreen: React.FC = () => { // Fetch user's delegations if (selectedAccount) { - const userVoting = await api.query.democracy.voting(selectedAccount.address); + const userVoting = await api.query.democracy.voting(selectedAccount.address) as any; if (userVoting.isDelegating) { const delegating = userVoting.asDelegating; setUserDelegations([{ diff --git a/mobile/src/screens/governance/ElectionsScreen.tsx b/mobile/src/screens/governance/ElectionsScreen.tsx index 57630314..8e9b6875 100644 --- a/mobile/src/screens/governance/ElectionsScreen.tsx +++ b/mobile/src/screens/governance/ElectionsScreen.tsx @@ -47,12 +47,12 @@ const ElectionsScreen: React.FC = () => { // Fetch commission proposals (acting as elections) if (api.query.dynamicCommissionCollective?.proposals) { - const proposalHashes = await api.query.dynamicCommissionCollective.proposals(); + const proposalHashes = await api.query.dynamicCommissionCollective.proposals() as any; const electionsData: ElectionInfo[] = []; - for (const hash of proposalHashes) { - const voting = await api.query.dynamicCommissionCollective.voting(hash); + for (const hash of (proposalHashes || [])) { + const voting = await api.query.dynamicCommissionCollective.voting(hash) as any; if (voting.isSome) { const voteData = voting.unwrap(); electionsData.push({ diff --git a/mobile/src/screens/governance/ForumScreen.tsx b/mobile/src/screens/governance/ForumScreen.tsx index 395abf19..ebd9add1 100644 --- a/mobile/src/screens/governance/ForumScreen.tsx +++ b/mobile/src/screens/governance/ForumScreen.tsx @@ -111,7 +111,7 @@ const ForumScreen: React.FC = () => { }; const getCategoryById = (categoryId: string): Category | undefined => { - return CATEGORIES.find(c => c.id === categoryId); + return categories.find((c: Category) => c.id === categoryId); }; const getTimeAgo = (dateString: string): string => { @@ -209,7 +209,7 @@ const ForumScreen: React.FC = () => { 📋 All Topics - {CATEGORIES.map((category) => ( + {categories.map((category) => ( (defaultValue: T): any; + unwrapOrDefault(): any; + + // Primitive conversions + toNumber(): number; + toBigInt(): bigint; + toJSON(): any; + toString(): string; + toHex(): string; + + // Common properties + data?: any; + free?: any; + balance?: any; + commission?: any; + keys?: any; + + // Delegation checks + isDelegating?: boolean; + asDelegating?: any; + + // Iterator support + [Symbol.iterator]?(): Iterator; + map?(fn: (value: any) => T): T[]; + } +} + +declare module '@pezkuwi/types-codec' { + interface Codec { + isNone: boolean; + isSome: boolean; + isEmpty: boolean; + unwrap(): any; + unwrapOr(defaultValue: T): any; + unwrapOrDefault(): any; + toNumber(): number; + toBigInt(): bigint; + toJSON(): any; + toString(): string; + toHex(): string; + data?: any; + free?: any; + balance?: any; + commission?: any; + keys?: any; + isDelegating?: boolean; + asDelegating?: any; + [Symbol.iterator]?(): Iterator; + map?(fn: (value: any) => T): T[]; + } +} diff --git a/mobile/src/types/modules.d.ts b/mobile/src/types/modules.d.ts new file mode 100644 index 00000000..28bdada2 --- /dev/null +++ b/mobile/src/types/modules.d.ts @@ -0,0 +1,58 @@ +/** + * Type declarations for external modules + */ + +// Pezkuwi extension types +declare module '@pezkuwi/extension-inject/types' { + import type { Signer } from '@pezkuwi/api/types'; + + export interface InjectedAccountWithMeta { + address: string; + meta: { + name?: string; + source: string; + genesisHash?: string; + }; + } + + export interface InjectedExtension { + name: string; + version: string; + accounts: { + get: () => Promise; + subscribe: (cb: (accounts: InjectedAccountWithMeta[]) => void) => () => void; + }; + signer: Signer; + } +} + +declare module '@pezkuwi/extension-dapp' { + import type { InjectedAccountWithMeta } from '@pezkuwi/extension-inject/types'; + + interface InjectedWeb3 { + signer: any; + name: string; + version: string; + } + + export function web3Enable(appName: string): Promise; + export function web3Accounts(): Promise; + export function web3FromAddress(address: string): Promise; + export function web3FromSource(source: string): Promise; +} + +// Path alias for shared lib - used in web context +declare module '@/lib/supabase' { + export const supabase: any; +} + +// Import.meta.env for Vite-like environments +interface ImportMetaEnv { + readonly VITE_PINATA_API_KEY?: string; + readonly VITE_PINATA_SECRET_KEY?: string; + [key: string]: string | undefined; +} + +interface ImportMeta { + readonly env: ImportMetaEnv; +} diff --git a/mobile/tsconfig.json b/mobile/tsconfig.json index 29c8138d..1b971654 100644 --- a/mobile/tsconfig.json +++ b/mobile/tsconfig.json @@ -8,7 +8,10 @@ "@pezkuwi/utils/*": ["../shared/utils/*"], "@pezkuwi/theme/*": ["../shared/theme/*"], "@pezkuwi/types/*": ["../shared/types/*"], - "@pezkuwi/i18n": ["../shared/i18n"] - } - } + "@pezkuwi/i18n": ["../shared/i18n"], + "@/*": ["src/*"] + }, + "typeRoots": ["./src/types", "./node_modules/@types"] + }, + "include": ["src/**/*.ts", "src/**/*.tsx", "shared/**/*.ts"] } diff --git a/shared/lib/citizenship-workflow.ts b/shared/lib/citizenship-workflow.ts index ff74a683..cccd43cf 100644 --- a/shared/lib/citizenship-workflow.ts +++ b/shared/lib/citizenship-workflow.ts @@ -261,7 +261,7 @@ export async function isStakingScoreTracking( return false; } - const startBlock = await api.query.stakingScore.stakingStartBlock(address); + const startBlock = await api.query.stakingScore.stakingStartBlock(address) as any; return !startBlock.isNone; } catch (error) { console.error('Error checking staking score tracking:', error); @@ -281,7 +281,7 @@ export async function isStaking( return false; } - const ledger = await api.query.staking.ledger(address); + const ledger = await api.query.staking.ledger(address) as any; return !ledger.isNone; } catch (error) { console.error('Error checking staking status:', error); @@ -370,7 +370,7 @@ export async function getCitizenDataCid( // Try to get from identity storage // This assumes the pallet stores IPFS CID somewhere // Adjust based on actual pallet storage structure - const identity = await api.query.identityKyc.identities(address); + const identity = await api.query.identityKyc.identities(address) as any; if (identity.isNone) { return null; diff --git a/shared/lib/guards.ts b/shared/lib/guards.ts index f89f9efa..5985fef4 100644 --- a/shared/lib/guards.ts +++ b/shared/lib/guards.ts @@ -289,7 +289,7 @@ export async function checkStakingScoreTracking( return false; } - const startBlock = await api.query.stakingScore.stakingStartBlock(address); + const startBlock = await api.query.stakingScore.stakingStartBlock(address) as any; return !startBlock.isNone; } catch (error) { console.error('Error checking staking score tracking:', error); diff --git a/shared/lib/multisig.ts b/shared/lib/multisig.ts index 552721cc..af26821a 100644 --- a/shared/lib/multisig.ts +++ b/shared/lib/multisig.ts @@ -50,7 +50,7 @@ export async function getMultisigMembers( if (memberConfig.isUnique) { // Query from chain for unique roles try { - const holder = await api.query.tiki.tikiHolder(memberConfig.tiki); + const holder = await api.query.tiki.tikiHolder(memberConfig.tiki) as any; if (holder.isSome) { const address = holder.unwrap().toString(); members.push(address); @@ -137,7 +137,7 @@ export async function getMultisigMemberInfo( if (memberConfig.isUnique) { try { - const holder = await api.query.tiki.tikiHolder(memberConfig.tiki); + const holder = await api.query.tiki.tikiHolder(memberConfig.tiki) as any; if (holder.isSome) { address = holder.unwrap().toString(); }