auto-commit for bed65b0f-c949-4d15-b953-0bf08c7c9e55

This commit is contained in:
emergent-agent-e1
2025-10-24 02:45:21 +00:00
parent b734c7ac00
commit 208ae2176c
40 changed files with 9223 additions and 56 deletions
+197
View File
@@ -0,0 +1,197 @@
/**
* PezkuwiChain Mobile App - Type Definitions
*/
// User Types
export interface User {
id: string;
name: string;
email: string;
address: string;
trustScore: number;
kycLevel: number;
avatar?: string;
}
// Balance Types
export interface Balance {
hez: string;
pez: string;
hezStaked: string;
hezUsd: string;
pezUsd: string;
governancePower: string;
}
// Transaction Types
export enum TransactionType {
SEND = 'send',
RECEIVE = 'receive',
STAKE = 'stake',
UNSTAKE = 'unstake',
REWARD = 'reward',
GOVERNANCE = 'governance',
}
export interface Transaction {
id: string;
type: TransactionType;
amount: string;
token: 'HEZ' | 'PEZ';
from: string;
to: string;
timestamp: number;
blockNumber: number;
hash: string;
status: 'pending' | 'confirmed' | 'failed';
}
// Governance Types
export interface Proposal {
id: number;
title: string;
description: string;
proposer: string;
votingDeadline: number;
yesVotes: string;
noVotes: string;
status: 'active' | 'passed' | 'rejected' | 'executed';
}
export interface Vote {
proposalId: number;
voter: string;
vote: 'yes' | 'no';
amount: string;
conviction: number;
timestamp: number;
}
// Parliamentary NFT Types
export interface ParliamentaryNFT {
tokenId: number;
owner: string;
monthlySalary: string;
electionDate: number;
termEnd: number;
status: 'active' | 'inactive';
}
// Identity Types
export interface DigitalIdentity {
idNumber: string;
name: string;
photo: string;
trustScore: number;
kycLevel: number;
verifications: {
identity: boolean;
education: boolean;
kyc: boolean;
};
qrCode: string;
}
// Education Certificate Types
export interface Certificate {
id: string;
title: string;
institution: string;
issueDate: number;
certificateType: 'bachelor' | 'master' | 'phd' | 'diploma' | 'certificate';
verified: boolean;
nftId?: number;
qrCode: string;
}
// Referral Types
export interface Referral {
code: string;
totalReferrals: number;
activeReferrals: number;
rewardsEarned: string;
referrals: ReferralUser[];
}
export interface ReferralUser {
name: string;
avatar: string;
joinDate: number;
reward: string;
status: 'active' | 'inactive';
}
// Business Types
export interface MerchantDashboard {
monthlyRevenue: string;
transactions: number;
customers: number;
recentTransactions: MerchantTransaction[];
}
export interface MerchantTransaction {
customerName: string;
amount: string;
token: 'HEZ' | 'PEZ';
timestamp: number;
}
// Exchange Types
export interface ExchangeRate {
from: 'HEZ' | 'PEZ';
to: 'HEZ' | 'PEZ';
rate: number;
timestamp: number;
}
export interface SwapTransaction {
fromToken: 'HEZ' | 'PEZ';
toToken: 'HEZ' | 'PEZ';
fromAmount: string;
toAmount: string;
rate: number;
slippage: number;
timestamp: number;
}
// Navigation Types
export type RootStackParamList = {
LanguageSelection: undefined;
SignIn: undefined;
SignUp: undefined;
MainTabs: undefined;
Send: { token: 'HEZ' | 'PEZ' };
Receive: { token: 'HEZ' | 'PEZ' };
ProposalDetail: { proposalId: number };
CertificateDetail: { certificateId: string };
QRScanner: undefined;
};
export type MainTabsParamList = {
Home: undefined;
Wallet: undefined;
Governance: undefined;
Referral: undefined;
Profile: undefined;
};
// Blockchain Types
export interface ChainConfig {
name: string;
rpcUrl: string;
chainId: string;
genesisHash: string;
decimals: {
hez: number;
pez: number;
};
}
// API Response Types
export interface ApiResponse<T> {
success: boolean;
data?: T;
error?: string;
message?: string;
}
+89
View File
@@ -0,0 +1,89 @@
/**
* Identity KYC Types
*/
export type Region = 'basur' | 'bakur' | 'rojava' | 'rojhelat' | 'kurdistan_a_sor' | 'diaspora';
export type MaritalStatus = 'single' | 'married';
export interface Child {
name: string;
order: number; // 1st child, 2nd child, etc.
}
export interface KYCFormData {
// Personal Information
fullName: string;
fatherName: string;
grandfatherName: string;
greatGrandfatherName: string;
motherName: string;
// Marital Status
maritalStatus: MaritalStatus;
spouseName?: string;
numberOfChildren?: number;
children?: Child[];
// Region
region: Region;
// Photo (base64 or file URI)
photo?: string;
}
export interface KYCSubmission {
// Hash of the KYC data (sent to blockchain)
dataHash: string;
// Timestamp
submittedAt: number;
// Blockchain transaction hash
txHash?: string;
}
export interface KurdistanCitizen {
// Citizen ID (generated after KYC approval)
citizenId: string;
// Personal Info (stored locally, encrypted)
fullName: string;
photo: string;
region: Region;
// KYC Status
kycApproved: boolean;
approvedAt: number;
// Blockchain reference (only hash)
dataHash: string;
// QR Code for verification
qrCode: string;
}
export interface KYCStatus {
// Has user started KYC?
started: boolean;
// Has user submitted KYC?
submitted: boolean;
// Is KYC approved on blockchain?
approved: boolean;
// Citizen data (only if approved)
citizen?: KurdistanCitizen;
}
// Region labels for UI
export const REGION_LABELS: Record<Region, { en: string; ku: string }> = {
basur: { en: 'Başur (South Kurdistan)', ku: 'باشوور (کوردستانی باشوور)' },
bakur: { en: 'Bakur (North Kurdistan)', ku: 'باکوور (کوردستانی باکوور)' },
rojava: { en: 'Rojava (West Kurdistan)', ku: 'رۆژاڤا (کوردستانی رۆژاڤا)' },
rojhelat: { en: 'Rojhelat (East Kurdistan)', ku: 'رۆژهەڵات (کوردستانی رۆژهەڵات)' },
kurdistan_a_sor: { en: 'Kurdistan a Sor (Red Kurdistan)', ku: 'کوردستانا سور' },
diaspora: { en: 'Diaspora', ku: 'دیاسپۆرا' },
};