UNPKG

navskit

Version:

Deploy TypeScript logic on Ethereum. Includes core library, CLI tools, and utilities.

34 lines (33 loc) 1.13 kB
import { TTools } from './types'; import { SafeTransaction } from '@safe-global/types-kit'; type TTransaction = { to: `0x${string}`; value: `0x${string}`; data: `0x${string}`; }; type TToolsParams = { avs: `0x${string}`; }; /** * Convert a percentage (e.g. 50.3 for 50.3 %) to an 18-decimal “wad”. * * EigenLayer’s slashing code treats 1 wad = 1 × 10⁻¹⁸ of “one”. * Because 100 % == 1.0, the conversion is: * * wad = (percent / 100) × 1e18 = percent × 1e16 * * The result must be an integer, so we use BigInt. * * @param {number|string} pct A number in the range 0 … 100 (inclusive). * @returns {bigint} The wad-scaled integer (0 … 1e18). */ export declare function percentToWad(pct: number): bigint; export declare class Tools implements TTools { private toolsParams; calls: TTransaction[]; constructor(toolsParams: TToolsParams); slash(operator: `0x${string}`, percentageOutOf100: number, description: string): void; eject(operator: `0x${string}`): void; getTransaction(): Promise<[SafeTransaction, `0x${string}`] | undefined>; } export {};