metal-presale
Version:
SDK for Metal Presales - Client and Server utilities
42 lines • 1.51 kB
TypeScript
import { HolderResponse, PortfolioSummary, TokenLikeItem, PresaleResponse } from './client';
/**
* Calculate portfolio summary from holder response
*/
export declare function calculatePortfolioSummary(holder: HolderResponse): PortfolioSummary;
/**
* Check if a presale is currently active
*/
export declare function isPresaleActive(presale: PresaleResponse): boolean;
/**
* Calculate presale progress percentage
*/
export declare function getPresaleProgress(presale: PresaleResponse): number;
/**
* Calculate time remaining for presale in milliseconds
*/
export declare function getPresaleTimeRemaining(presale: PresaleResponse): number;
/**
* Format time remaining in human readable format
*/
export declare function formatTimeRemaining(milliseconds: number): string;
/**
* Filter tokens by type
*/
export declare function filterTokensByType(tokens: TokenLikeItem[], type: 'token' | 'presale' | 'lock'): TokenLikeItem[];
/**
* Calculate total value of tokens
*/
export declare function calculateTotalValue(tokens: TokenLikeItem[]): number;
/**
* Find token by symbol or address
*/
export declare function findToken(tokens: TokenLikeItem[], symbolOrAddress: string): TokenLikeItem | undefined;
/**
* Sort tokens by value (descending)
*/
export declare function sortTokensByValue(tokens: TokenLikeItem[]): TokenLikeItem[];
/**
* Get unlocked tokens (not in vaults)
*/
export declare function getUnlockedTokens(holder: HolderResponse): TokenLikeItem[];
//# sourceMappingURL=utils.d.ts.map