Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 84 additions & 1 deletion dist/core/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,20 @@ export interface Identity {
citizenship?: boolean;
publicKey?: string;
biometricHash?: string;
wallets?: Wallet[];
wallets?: {
primary: WalletInfo;
ubi: WalletInfo;
savings: WalletInfo;
};
daoMembership?: {
votingPower: number;
soulboundNftIssued: boolean;
};
seedPhrases?: {
primary: string[];
ubi: string[];
savings: string[];
};
votingPower?: number;
ubiEarned?: number;
}
Expand All @@ -21,6 +34,14 @@ export interface Wallet {
balance: number;
address: string;
}
export interface WalletInfo {
id: string;
wallet_type: string;
name: string;
balance: number;
staked_balance: number;
pending_rewards: number;
}
export interface NetworkStatus {
peers: number;
meshConnected: boolean;
Expand Down Expand Up @@ -165,4 +186,66 @@ export interface Proof {
timestamp: string;
signature?: string;
}
export interface SignupRequest {
display_name: string;
identity_type?: string;
recovery_options?: string[];
password: string;
}
export interface LoginRequest {
identity_id: string;
password: string;
}
export interface SignupResponse {
status: string;
identity_id: string;
identity_type: string;
access_level: string;
created_at: number;
citizenship_result?: CitizenshipResult;
}
export interface LoginResponse {
status: string;
identity_id: string;
display_name: string;
identity_type: string;
access_level: string;
wallets: {
primary: WalletInfo;
ubi: WalletInfo;
savings: WalletInfo;
};
}
export interface CitizenshipResult {
identity_id: string;
primary_wallet_id: string;
ubi_wallet_id: string;
savings_wallet_id: string;
wallet_seed_phrases: {
primary_wallet_seeds: {
words: string[];
};
ubi_wallet_seeds: {
words: string[];
};
savings_wallet_seeds: {
words: string[];
};
};
dao_registration: {
voting_power: number;
soulbound_nft_issued: boolean;
registered_at: number;
};
ubi_registration: {
ubi_wallet_id: string;
ubi_enabled: boolean;
};
web4_access: {
web4_enabled: boolean;
};
welcome_bonus: {
bonus_amount: number;
};
}
//# sourceMappingURL=types.d.ts.map
2 changes: 1 addition & 1 deletion dist/core/types.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 17 additions & 1 deletion dist/core/zhtp-api-methods.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,26 @@
* All API method implementations for various operations
*/
import { ZhtpApiCore } from './zhtp-api-core';
import { Identity, Wallet, NetworkStatus, DaoProposal, DaoStats, Transaction, Delegate, ProposalDetails, TreasuryRecord, DApp, SmartContract, ContractDeploymentResult, ContractExecutionResult, Asset, NodeStatus, Proof } from './types';
import { Identity, Wallet, NetworkStatus, DaoProposal, DaoStats, Transaction, Delegate, ProposalDetails, TreasuryRecord, DApp, SmartContract, ContractDeploymentResult, ContractExecutionResult, Asset, NodeStatus, Proof, SignupRequest, LoginRequest } from './types';
export declare abstract class ZhtpApiMethods extends ZhtpApiCore {
signIn(did: string, passphrase: string): Promise<Identity>;
createIdentity(data: any): Promise<Identity>;
/**
* Sign up a new citizen identity with 3 wallets, DAO membership, and welcome bonus
*/
signup(request: SignupRequest): Promise<Identity>;
/**
* Login with existing identity
*/
login(request: LoginRequest): Promise<Identity>;
/**
* Map signup response from backend to Identity interface
*/
private mapSignupResponseToIdentity;
/**
* Map login response from backend to Identity interface
*/
private mapLoginResponseToIdentity;
recoverIdentity(method: 'seed' | 'backup' | 'social', data: string): Promise<Identity>;
recoverIdentityFromSeed(recoveryData: Record<string, any>): Promise<Identity>;
restoreIdentityFromBackup(backupData: Record<string, any>): Promise<Identity>;
Expand Down
Loading