import { BaseProvider } from '../providers/base'; import { Coin } from '@cryptoandcoffee/akash-jsdk-protobuf'; import { JWTAuthManager } from './jwt-auth'; import { JWTGenerationOptions, AuthConfig } from '../types/jwt'; declare global { interface Window { keplr?: any; cosmostation?: any; } } export interface WalletProvider { connect(): Promise; disconnect(): Promise; getAccounts(): Promise; signTransaction(tx: any): Promise; signMessage(message: string): Promise; isConnected(): boolean; } export interface TransactionRequest { from: string; to?: string; amount?: Coin[]; gas?: string; gasPrice?: string; memo?: string; msgs: any[]; } export interface Balance { address: string; balances: Coin[]; } export interface TransactionHistory { hash: string; height: number; timestamp: string; from: string; to?: string; amount: Coin[]; fee: Coin[]; memo?: string; success: boolean; } export declare class WalletManager { private provider; private connectedWallet; private jwtAuthManager; private authConfig; constructor(provider: BaseProvider); /** * Connect to a wallet provider (Keplr, Cosmostation, etc.) */ connectWallet(walletProvider: WalletProvider): Promise; /** * Disconnect from current wallet */ disconnectWallet(): Promise; /** * Get connected wallet accounts */ getAccounts(): Promise; /** * Get account balances */ getBalance(address: string): Promise; /** * Sign and broadcast transaction */ sendTransaction(request: TransactionRequest): Promise; /** * Sign a message without broadcasting */ signMessage(message: string): Promise; /** * Generate JWT using Keplr's signArbitrary (ADR-36) method * This is the recommended way for web applications using Keplr */ generateJWTTokenWithKeplr(chainId: string, address: string, options?: { expiresIn?: number; accessType?: import('../types/jwt').JWTAccessType; leasePermissions?: any[]; }): Promise; /** * Get transaction history for an address */ getTransactionHistory(address: string, limit?: number): Promise; /** * Simulate transaction to estimate gas */ simulateTransaction(request: TransactionRequest): Promise<{ gasUsed: string; gasWanted: string; estimatedFee: Coin[]; }>; /** * Check if wallet is connected */ isWalletConnected(): boolean; /** * Get current wallet provider */ getWalletProvider(): WalletProvider | null; /** * Transfer tokens between accounts */ transfer(from: string, to: string, amount: Coin[], memo?: string): Promise; /** * Delegate tokens to a validator */ delegate(_params: { delegatorAddress: string; validatorAddress: string; amount: Coin; memo?: string; }): Promise<{ txHash: string; height: number; success: boolean; }>; /** * Undelegate tokens from a validator */ undelegate(_params: { delegatorAddress: string; validatorAddress: string; amount: Coin; memo?: string; }): Promise<{ txHash: string; height: number; success: boolean; }>; /** * Claim staking rewards */ claimRewards(delegator: string, validators: string[], memo?: string): Promise; /** * Send tokens (simplified interface) */ send(params: { fromAddress: string; toAddress: string; amount: Coin; memo?: string; }): Promise<{ txHash: string; height: number; gasUsed: number; success: boolean; }>; /** * Estimate gas for a transaction */ estimateGas(_params: { fromAddress: string; toAddress: string; amount: Coin; }): Promise<{ gasEstimate: number; gasPrice: Coin; estimatedFee: Coin; }>; /** * Get delegations for an address */ getDelegations(delegatorAddress: string): Promise; /** * Validate an address */ validateAddress(address: string): { valid: boolean; type?: 'account' | 'validator'; errors?: string[]; }; /** * Generate a JWT token for Akash Network authentication (Mainnet 14+) * Uses the wallet's private key to sign the token with ES256K (secp256k1) */ generateJWTToken(options: Omit, privateKey?: string): Promise; /** * Set authentication configuration * Allows switching between JWT and certificate-based auth */ setAuthConfig(config: AuthConfig): void; /** * Get current authentication configuration */ getAuthConfig(): AuthConfig | null; /** * Get JWT authentication manager instance */ getJWTAuthManager(): JWTAuthManager; /** * Check if JWT token is expired and needs refresh */ isJWTTokenExpired(token: string): boolean; /** * Create authorization header for provider requests * Supports both JWT and certificate-based auth */ createAuthorizationHeader(): string | null; } export declare class KeplrWallet implements WalletProvider { private keplr; connect(): Promise; disconnect(): Promise; getAccounts(): Promise; signTransaction(_tx: any): Promise; signMessage(_message: string): Promise; isConnected(): boolean; } export declare class CosmostationWallet implements WalletProvider { connect(): Promise; disconnect(): Promise; getAccounts(): Promise; signTransaction(_tx: any): Promise; signMessage(_message: string): Promise; isConnected(): boolean; } export declare class MnemonicWallet implements WalletProvider { private mnemonic; private wallet; private connected; constructor(mnemonic: string); connect(): Promise; disconnect(): Promise; getAccounts(): Promise; signTransaction(_tx: any): Promise; signMessage(_message: string): Promise; isConnected(): boolean; } //# sourceMappingURL=wallet.d.ts.map