@reflex-mev/sdk
Version:
TypeScript SDK for Reflex Router - Execute MEV backruns with ease
37 lines • 1.31 kB
TypeScript
/**
* Utility functions for the Reflex SDK
*/
/**
* Validates an Ethereum address format
* @param address - The address to validate
* @returns True if the address is valid
*/
export declare function isValidAddress(address: string): boolean;
/**
* Validates a bytes32 value (like pool ID)
* @param bytes32 - The bytes32 value to validate
* @returns True if the value is valid
*/
export declare function isValidBytes32(bytes32: string): boolean;
/**
* Formats a BigInt value to a human-readable string with decimals
* @param value - The BigInt value
* @param decimals - Number of decimal places (default: 18)
* @returns Formatted string
*/
export declare function formatTokenAmount(value: bigint, decimals?: number): string;
/**
* Parses a token amount string to BigInt
* @param amount - Amount as string (e.g., "1.5")
* @param decimals - Number of decimal places (default: 18)
* @returns BigInt representation
*/
export declare function parseTokenAmount(amount: string, decimals?: number): bigint;
/**
* Calculates the percentage profit
* @param profit - Profit amount
* @param investment - Initial investment amount
* @returns Percentage profit as number
*/
export declare function calculateProfitPercentage(profit: bigint, investment: bigint): number;
//# sourceMappingURL=index.d.ts.map