units.d.ts 1006 B

123456789101112131415161718192021222324
  1. import type { BigNumberish, Numeric } from "../utils/index.js";
  2. /**
  3. * Converts %%value%% into a //decimal string//, assuming %%unit%% decimal
  4. * places. The %%unit%% may be the number of decimal places or the name of
  5. * a unit (e.g. ``"gwei"`` for 9 decimal places).
  6. *
  7. */
  8. export declare function formatUnits(value: BigNumberish, unit?: string | Numeric): string;
  9. /**
  10. * Converts the //decimal string// %%value%% to a BigInt, assuming
  11. * %%unit%% decimal places. The %%unit%% may the number of decimal places
  12. * or the name of a unit (e.g. ``"gwei"`` for 9 decimal places).
  13. */
  14. export declare function parseUnits(value: string, unit?: string | Numeric): bigint;
  15. /**
  16. * Converts %%value%% into a //decimal string// using 18 decimal places.
  17. */
  18. export declare function formatEther(wei: BigNumberish): string;
  19. /**
  20. * Converts the //decimal string// %%ether%% to a BigInt, using 18
  21. * decimal places.
  22. */
  23. export declare function parseEther(ether: string): bigint;
  24. //# sourceMappingURL=units.d.ts.map