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
73 changes: 73 additions & 0 deletions dist/core/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -341,4 +341,77 @@ export interface VerifyProofResponse {
claim: ProofType;
verified_at: number;
}
export interface WalletPermissions {
can_transfer_external: boolean;
can_vote: boolean;
can_stake: boolean;
can_receive_rewards: boolean;
daily_transaction_limit: number;
requires_multisig_threshold: number | null;
}
export interface DetailedWalletInfo {
wallet_type: string;
wallet_id: string;
available_balance: number;
staked_balance: number;
pending_rewards: number;
total_balance: number;
permissions: WalletPermissions;
created_at: number;
description: string;
}
export interface WalletListResponse {
status: string;
identity_id: string;
total_wallets: number;
total_balance: number;
wallets: DetailedWalletInfo[];
}
export interface WalletBalanceResponse {
status: string;
wallet_type: string;
identity_id: string;
balance: {
available_balance: number;
staked_balance: number;
pending_rewards: number;
total_balance: number;
};
permissions: WalletPermissions;
created_at: number;
}
export interface SimpleSendRequest {
from_identity: string;
to_address: string;
amount: number;
memo?: string;
}
export interface CrossWalletTransferRequest {
identity_id: string;
from_wallet: string;
to_wallet: string;
amount: number;
purpose?: string;
}
export interface StakingRequest {
identity_id: string;
amount: number;
}
export interface TransactionRecord {
tx_hash: string;
tx_type: string;
amount: number;
fee: number;
from_wallet: string | null;
to_address: string | null;
timestamp: number;
block_height: number | null;
status: string;
memo: string | null;
}
export interface TransactionHistoryResponse {
identity_id: string;
total_transactions: number;
transactions: TransactionRecord[];
}
//# sourceMappingURL=types.d.ts.map
2 changes: 1 addition & 1 deletion dist/core/types.d.ts.map

Large diffs are not rendered by default.

63 changes: 61 additions & 2 deletions dist/core/zhtp-api-methods.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* 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, GasInfo, SignupRequest, LoginRequest, BackupData, BackupVerification, BackupStatus, ImportBackupResponse, SeedVerification, SeedPhrases, Guardian, GuardianResponse, RecoverySession, RecoveryStatus, CitizenshipResult, ProofData, GenerateProofRequest, VerifyProofResponse } from './types';
import { Identity, Wallet, NetworkStatus, DaoProposal, DaoStats, Transaction, Delegate, ProposalDetails, TreasuryRecord, DApp, SmartContract, ContractDeploymentResult, ContractExecutionResult, Asset, NodeStatus, GasInfo, SignupRequest, LoginRequest, BackupData, BackupVerification, BackupStatus, ImportBackupResponse, SeedVerification, SeedPhrases, Guardian, GuardianResponse, RecoverySession, RecoveryStatus, CitizenshipResult, ProofData, GenerateProofRequest, VerifyProofResponse, WalletListResponse, WalletBalanceResponse, SimpleSendRequest, CrossWalletTransferRequest, TransactionHistoryResponse } from './types';
export declare abstract class ZhtpApiMethods extends ZhtpApiCore {
signIn(did: string, passphrase: string): Promise<Identity>;
createIdentity(data: any): Promise<Identity>;
Expand Down Expand Up @@ -117,10 +117,69 @@ export declare abstract class ZhtpApiMethods extends ZhtpApiCore {
identity: Identity;
}>;
getNetworkInfo(): Promise<NetworkStatus>;
/**
* List all wallets for an identity
* @param identityId - Identity ID (hex string)
* @returns List of all wallets with balances and permissions
*/
getWalletList(identityId: string): Promise<WalletListResponse>;
/**
* Get balance for a specific wallet type
* @param walletType - Wallet type (Primary, UBI, Savings, Staking, etc.)
* @param identityId - Identity ID (hex string)
* @returns Detailed balance information for the wallet
*/
getWalletBalance(walletType: string, identityId: string): Promise<WalletBalanceResponse>;
/**
* Get comprehensive wallet statistics for an identity
* @param identityId - Identity ID (hex string)
* @returns Wallet statistics
*/
getWalletStatistics(identityId: string): Promise<any>;
/**
* Get transaction history for an identity
* @param identityId - Identity ID (hex string)
* @returns Transaction history
*/
getWalletTransactionHistory(identityId: string): Promise<TransactionHistoryResponse>;
/**
* Send a simple payment from primary wallet
* @param request - Send request with from_identity, to_address, amount, memo
* @returns Transaction result
*/
sendWalletPayment(request: SimpleSendRequest): Promise<any>;
/**
* Transfer tokens between wallets of the same identity
* @param request - Transfer request with identity_id, from_wallet, to_wallet, amount, purpose
* @returns Transfer result with transaction ID
*/
transferBetweenWallets(request: CrossWalletTransferRequest): Promise<any>;
/**
* Stake tokens from Primary wallet to Staking wallet
* @param identityId - Identity ID (hex string)
* @param amount - Amount to stake
* @returns Staking result
*/
stakeTokens(identityId: string, amount: number): Promise<any>;
/**
* Unstake tokens from Staking wallet back to Primary wallet
* @param identityId - Identity ID (hex string)
* @param amount - Amount to unstake
* @returns Unstaking result
*/
unstakeTokens(identityId: string, amount: number): Promise<any>;
/**
* @deprecated Use getWalletList() instead
*/
getWallets(did: string): Promise<Wallet[]>;
getWalletBalance(did: string): Promise<number>;
/**
* @deprecated Use getWalletTransactionHistory() instead
*/
getTransactionHistory(address: string, walletType?: string): Promise<Transaction[]>;
getAssets(address: string): Promise<Asset[]>;
/**
* @deprecated Use sendWalletPayment() instead
*/
sendTransaction(from: string, to: string, amount: number, metadata?: Record<string, any>): Promise<Transaction>;
getDaoProposals(): Promise<DaoProposal[]>;
getDaoStats(): Promise<DaoStats>;
Expand Down
Loading