/* this file is auto-generated, do not modify */

export type WasmEncodedResult<T> = { value: T; error: undefined } | { value: undefined; error: WasmEncodedError };

export interface WasmEncodedError {
    msg: string;
    readableMsg: string;
}

export class Float {
  private constructor();
  free(): void;
  /**
   * Returns the 32-byte hexadecimal string representation of the float.
   *
   * # Returns
   *
   * * `String` - The 32-byte hex string.
   *
   * # Example
   *
   * ```typescript
   * const float = Float.fromHex("0x0000000000000000000000000000000000000000000000000000000000000005").value!;
   * assert(float.asHex() === "0x0000000000000000000000000000000000000000000000000000000000000005");
   * ```
   */
  asHex(): `0x${string}`;
  /**
   * Convert the float to a JS/TS bigint equivalent of `asHex()` returned hex string.
   *
   * # Throws
   * if conversion fails.
   *
   * # Example
   *
   * ```typescript
   * const float = Float.fromHex("0xfffffffe0000000000000000000000000000000000000000000000000000013a");
   * const value = float.toBigInt();
   * assert(value === 115792089183396302089269705419353877679230723318366275194376439045705909141818n);
   * ```
   */
  toBigint(): bigint;
  /**
   * Constructs a `Float` from a bigint equivalent of the `fromHex()` returned Float.
   *
   * # Throws
   * if conversion fails.
   *
   * # Example
   *
   * ```typescript
   * const float = Float.fromBigint(115792089183396302089269705419353877679230723318366275194376439045705909141818n);
   * assert(float.asHex() === "0xfffffffe0000000000000000000000000000000000000000000000000000013a");
   * ```
   */
  static fromBigint(value: bigint): Float;
  /**
   * Tries to convert the float to a JS/TS bigint equivalent of `asHex()` returned hex string.
   *
   * # Returns
   *
   * * `Ok(bigint)` - The resulting `bigint` value.
   * * `Err(FloatError)` - If the conversion fails.
   *
   * # Example
   *
   * ```typescript
   * const float = Float.fromHex("0xfffffffe0000000000000000000000000000000000000000000000000000013a");
   * const bigintResult = float.tryToBigInt();
   * if (bigintResult.error) {
   *     console.error(bigintResult.error);
   * }
   * assert(bigintResult.value === 115792089183396302089269705419353877679230723318366275194376439045705909141818n);
   * ```
   */
  tryToBigint(): WasmEncodedResult<bigint>;
  /**
   * Constructs a `Float` from a bigint equivalent of the `fromHex()` returned Float.
   *
   * # Returns
   *
   * * `Ok(Float)` - The resulting `Float` value.
   * * `Err(FloatError)` - If the conversion fails.
   *
   * # Example
   *
   * ```typescript
   * const floatResult = Float.tryFromBigint(115792089183396302089269705419353877679230723318366275194376439045705909141818n);
   * if (floatResult.error) {
   *   console.error(floatResult.error);
   * }
   * const value = float.value;
   * assert(value.asHex() === "0xfffffffe0000000000000000000000000000000000000000000000000000013a");
   * ```
   */
  static tryFromBigint(value: bigint): WasmEncodedResult<Float>;
  /**
   * Converts a fixed-point decimal value to a `Float` using the specified number of decimals.
   *
   * # Arguments
   *
   * * `value` - The fixed-point decimal value as a `string`.
   * * `decimals` - The number of decimals in the fixed-point representation.
   *
   * # Returns
   *
   * * `Ok(Float)` - The resulting `Float` value.
   * * `Err(FloatError)` - If the conversion fails.
   *
   * # Example
   *
   * ```typescript
   * const floatResult = Float.fromFixedDecimal("12345", 2);
   * if (floatResult.error) {
   *    console.error(floatResult.error);
   * }
   * const float = floatResult.value;
   * assert(float.format() === "123.45");
   * ```
   */
  static fromFixedDecimal(value: bigint, decimals: number): WasmEncodedResult<Float>;
  /**
   * Converts a `Float` to a fixed-point decimal value using the specified number of decimals.
   *
   * # Arguments
   *
   * * `decimals` - The number of decimals in the fixed-point representation.
   *
   * # Returns
   *
   * * `Ok(String)` - The resulting fixed-point decimal value as a string.
   * * `Err(FloatError)` - If the conversion fails.
   *
   * # Example
   *
   * ```typescript
   * const float = Float.parse("123.45").value!;
   * const result = float.toFixedDecimal(2);
   * if (result.error) {
   *    console.error(result.error);
   * }
   * assert(result.value === "12345");
   * ```
   */
  toFixedDecimal(decimals: number): WasmEncodedResult<bigint>;
  /**
   * Converts a fixed-point decimal value to a `Float` using the specified number of decimals lossy.
   *
   * # Arguments
   *
   * * `value` - The fixed-point decimal value as a `string`.
   * * `decimals` - The number of decimals in the fixed-point representation.
   *
   * # Returns
   *
   * * `Ok(Float)` - The resulting `Float` value.
   * * `Err(FloatError)` - If the conversion fails.
   *
   * # Example
   *
   * ```typescript
   * const floatResult = Float.fromFixedDecimalLossy("12345", 2);
   * if (floatResult.error) {
   *    console.error(floatResult.error);
   * }
   * const float = floatResult.value;
   * assert(float.format() === "123.45");
   * ```
   */
  static fromFixedDecimalLossy(value: bigint, decimals: number): WasmEncodedResult<Float>;
  /**
   * Converts a `Float` to a fixed-point decimal value using the specified number of decimals lossy.
   *
   * # Arguments
   *
   * * `decimals` - The number of decimals in the fixed-point representation.
   *
   * # Returns
   *
   * * `Ok(String)` - The resulting fixed-point decimal value as a string.
   * * `Err(FloatError)` - If the conversion fails.
   *
   * # Example
   *
   * ```typescript
   * const float = Float.fromFixedDecimal(12345n, 3).value!;
   * const result = float.toFixedDecimalLossy(2);
   * if (result.error) {
   *    console.error(result.error);
   * }
   * assert(result.value === "1234");
   * ```
   */
  toFixedDecimalLossy(decimals: number): WasmEncodedResult<bigint>;
  /**
   * Parses a decimal string into a `Float`.
   *
   * # Arguments
   *
   * * `str` - The string to parse.
   *
   * # Returns
   *
   * * `Ok(Float)` - The parsed float.
   * * `Err(FloatError)` - If parsing fails.
   *
   * # Example
   *
   * ```typescript
   * const floatResult = Float.parse("3.1415");
   * if (floatResult.error) {
   *    console.error(floatResult.error);
   * }
   * const float = floatResult.value;
   * assert(float.format() === "3.1415");
   * ```
   */
  static parse(str: string): WasmEncodedResult<Float>;
  /**
   * Constructs a `Float` from a 32-byte hexadecimal string.
   *
   * # Arguments
   *
   * * `hex` - The 32-byte hex string to parse.
   *
   * # Returns
   *
   * * `Ok(Float)` - The float parsed from the hex string.
   * * `Err(FloatError)` - If the hex string is not valid or not 32 bytes.
   *
   * # Example
   *
   * ```typescript
   * const floatResult = Float.fromHex("0x0000000000000000000000000000000000000000000000000000000000000005");
   * if (floatResult.error) {
   *    console.error(floatResult.error);
   * }
   * const float = floatResult.value;
   * assert(float.asHex() === "0x0000000000000000000000000000000000000000000000000000000000000005");
   * ```
   */
  static fromHex(hex: `0x${string}`): WasmEncodedResult<Float>;
  /**
   * Formats the float as a decimal string.
   *
   * NOTE: Uses 18 decimal places and fails if the float has more than
   * that number of decimals.
   *
   * # Returns
   *
   * * `Ok(String)` - The formatted string.
   * * `Err(FloatError)` - If formatting fails.
   *
   * # Example
   *
   * ```typescript
   * const floatResult = Float.parse("2.5");
   * if (floatResult.error) {
   *    console.error(floatResult.error);
   * }
   * const float = floatResult.value;
   * assert(float.format() === "2.5");
   * ```
   */
  format(): WasmEncodedResult<String>;
  /**
   * Formats the float as a decimal string. Gets truncated to 18 decimal
   * places if it has more than that.
   *
   * # Returns
   *
   * * `Ok(String)` - The formatted string.
   * * `Err(FloatError)` - If formatting fails.
   *
   * # Example
   *
   * ```typescript
   * const floatResult = Float.parse("2.5");
   * if (floatResult.error) {
   *    console.error(floatResult.error);
   * }
   * const float = floatResult.value;
   * assert(float.format18() === "2.5");
   * ```
   */
  format18(): WasmEncodedResult<String>;
  /**
   * Returns `true` if `self` is less than `b`.
   *
   * # Arguments
   *
   * * `b` - The `Float` value to compare with `self`.
   *
   * # Returns
   *
   * * `Ok(true)` if `self` is less than `b`.
   * * `Ok(false)` if `self` is not less than `b`.
   * * `Err(FloatError)` if the comparison fails due to an error in the underlying EVM call or decoding.
   *
   * # Example
   *
   * ```typescript
   * const a = Float.parse("1.0").value!;
   * const b = Float.parse("2.0").value!;
   * const result = a.lt(b);
   * if (result.error) {
   *    console.error(result.error);
   * }
   * assert(result.value);
   * ```
   */
  lt(b: Float): WasmEncodedResult<boolean>;
  /**
   * Returns `true` if `self` is equal to `b`.
   *
   * # Arguments
   *
   * * `b` - The `Float` value to compare with `self`.
   *
   * # Returns
   *
   * * `Ok(true)` if `self` is equal to `b`.
   * * `Ok(false)` if `self` is not equal to `b`.
   * * `Err(FloatError)` if the comparison fails due to an error in the underlying EVM call or decoding.
   *
   * # Example
   *
   * ```typescript
   * const a = Float.parse("2.0").value!;
   * const b = Float.parse("2.0").value!;
   * const result = a.eq(b);
   * if (result.error) {
   *    console.error(result.error);
   * }
   * assert(result.value);
   * ```
   */
  eq(b: Float): WasmEncodedResult<boolean>;
  /**
   * Returns `true` if `self` is less than or equal to `b`.
   *
   * # Arguments
   *
   * * `b` - The `Float` value to compare with `self`.
   *
   * # Returns
   *
   * * `Ok(true)` if `self` is less than or equal to `b`.
   * * `Ok(false)` if `self` is not less than or equal to `b`.
   * * `Err(FloatError)` if the comparison fails due to an error in the underlying EVM call or decoding.
   *
   * # Example
   *
   * ```typescript
   * const a = Float.parse("1.0").value!;
   * const b = Float.parse("2.0").value!;
   * const result = a.lte(b);
   * if (result.error) {
   *    console.error(result.error);
   * }
   * assert(result.value);
   * ```
   */
  lte(b: Float): WasmEncodedResult<boolean>;
  /**
   * Returns `true` if `self` is greater than or equal to `b`.
   *
   * # Arguments
   *
   * * `b` - The `Float` value to compare with `self`.
   *
   * # Returns
   *
   * * `Ok(true)` if `self` is greater than or equal to `b`.
   * * `Ok(false)` if `self` is not greater than or equal to `b`.
   * * `Err(FloatError)` if the comparison fails due to an error in the underlying EVM call or decoding.
   *
   * # Example
   *
   * ```typescript
   * const a = Float.parse("2.0").value!;
   * const b = Float.parse("1.0").value!;
   * const result = a.gte(b);
   * if (result.error) {
   *    console.error(result.error);
   * }
   * assert(result.value);
   * ```
   */
  gte(b: Float): WasmEncodedResult<boolean>;
  /**
   * Returns `true` if `self` is greater than `b`.
   *
   * # Arguments
   *
   * * `b` - The `Float` value to compare with `self`.
   *
   * # Returns
   *
   * * `Ok(true)` if `self` is greater than `b`.
   * * `Ok(false)` if `self` is not greater than `b`.
   * * `Err(FloatError)` if the comparison fails due to an error in the underlying EVM call or decoding.
   *
   * # Example
   *
   * ```typescript
   * const a = Float.parse("2.0").value!;
   * const b = Float.parse("1.0").value!;
   * const result = a.gt(b);
   * if (result.error) {
   *    console.error(result.error);
   * }
   * assert(result.value);
   * ```
   */
  gt(b: Float): WasmEncodedResult<boolean>;
  /**
   * Returns the multiplicative inverse of the float.
   *
   * # Returns
   *
   * * `Ok(Float)` - The inverse.
   * * `Err(FloatError)` - If inversion fails.
   *
   * # Example
   *
   * ```typescript
   * const x = Float.parse("2.0").value!;
   * const inv = x.inv();
   * if (inv.error) {
   *    console.error(inv.error);
   * }
   * assert(inv.value.format().startsWith("0.5"));
   * ```
   */
  inv(): WasmEncodedResult<Float>;
  /**
   * Returns the absolute value of the float.
   *
   * # Returns
   *
   * * `Ok(Float)` - The absolute value.
   * * `Err(FloatError)` - If the operation fails.
   *
   * # Example
   *
   * ```typescript
   * const x = Float.parse("-3.14").value!;
   * const abs = x.abs();
   * if (abs.error) {
   *    console.error(abs.error);
   * }
   * assert(abs.value.format() === "3.14");
   * ```
   */
  abs(): WasmEncodedResult<Float>;
  /**
   * Adds two floats.
   *
   * # Returns
   *
   * * `Ok(Float)` - The sum.
   * * `Err(FloatError)` - If addition fails.
   *
   * # Example
   *
   * ```typescript
   * const a = Float.parse("1.5").value!;
   * const b = Float.parse("2.5").value!;
   * const result = a.add(b);
   * if (result.error) {
   *    console.error(result.error);
   * }
   * assert(result.value.format() === "4");
   * ```
   */
  add(b: Float): WasmEncodedResult<Float>;
  /**
   * Subtracts `b` from `self`.
   *
   * # Returns
   *
   * * `Ok(Float)` - The difference.
   * * `Err(FloatError)` - If subtraction fails.
   *
   * # Example
   *
   * ```typescript
   * const a = Float.parse("5.0").value!;
   * const b = Float.parse("2.0").value!;
   * const result = a.sub(b);
   * if (result.error) {
   *    console.error(result.error);
   * }
   * assert(result.value.format() === "3");
   * ```
   */
  sub(b: Float): WasmEncodedResult<Float>;
  /**
   * Multiplies two floats.
   *
   * # Returns
   *
   * * `Ok(Float)` - The product.
   * * `Err(FloatError)` - If multiplication fails.
   *
   * # Example
   *
   * ```typescript
   * const a = Float.parse("2.0").value!;
   * const b = Float.parse("3.0").value!;
   * const result = a.mul(b);
   * if (result.error) {
   *    console.error(result.error);
   * }
   * assert(result.value.format() === "6");
   * ```
   */
  mul(b: Float): WasmEncodedResult<Float>;
  /**
   * Divides `self` by `b`.
   *
   * # Returns
   *
   * * `Ok(Float)` - The quotient.
   * * `Err(FloatError)` - If division fails.
   *
   * # Example
   *
   * ```typescript
   * const a = Float.parse("6.0").value!;
   * const b = Float.parse("2.0").value!;
   * const result = a.div(b);
   * if (result.error) {
   *    console.error(result.error);
   * }
   * assert(result.value.format() === "3");
   * ```
   */
  div(b: Float): WasmEncodedResult<Float>;
  /**
   * Returns the fractional part of the float.
   *
   * # Returns
   *
   * * `Ok(Float)` - The fractional part.
   * * `Err(FloatError)` - If the operation fails.
   *
   * # Example
   *
   * ```typescript
   * const x = Float.parse("3.75").value!;
   * const result = x.frac();
   * if (result.error) {
   *    console.error(result.error);
   * }
   * assert(result.value.format() === "0.75");
   * ```
   */
  frac(): WasmEncodedResult<Float>;
  /**
   * Returns the floor of the float.
   *
   * # Returns
   *
   * * `Ok(Float)` - The floored value.
   * * `Err(FloatError)` - If the operation fails.
   *
   * # Example
   *
   * ```typescript
   * const x = Float.parse("3.75").value!;
   * const result = x.floor();
   * if (result.error) {
   *    console.error(result.error);
   * }
   * assert(result.value.format() === "3");
   * ```
   */
  floor(): WasmEncodedResult<Float>;
  /**
   * Returns the minimum of `self` and `b`.
   *
   * # Arguments
   *
   * * `b` - The other `Float` to compare with.
   *
   * # Returns
   *
   * * `Ok(Float)` - The minimum value.
   * * `Err(FloatError)` - If the operation fails.
   *
   * # Example
   *
   * ```typescript
   * const a = Float.parse("1.0").value!;
   * const b = Float.parse("2.0").value!;
   * const result = a.min(b);
   * if (result.error) {
   *    console.error(result.error);
   * }
   * assert(result.value.format() === "1");
   * ```
   */
  min(b: Float): WasmEncodedResult<Float>;
  /**
   * Returns the maximum of `self` and `b`.
   *
   * # Arguments
   *
   * * `b` - The other `Float` to compare with.
   *
   * # Returns
   *
   * * `Ok(Float)` - The maximum value.
   * * `Err(FloatError)` - If the operation fails.
   *
   * # Example
   *
   * ```typescript
   * const a = Float.parse("1.0").value!;
   * const b = Float.parse("2.0").value!;
   * const result = a.max(b);
   * if (result.error) {
   *    console.error(result.error);
   * }
   * assert(result.value.format() === "2");
   * ```
   */
  max(b: Float): WasmEncodedResult<Float>;
  /**
   * Checks if the float is zero.
   *
   * # Returns
   *
   * * `Ok(true)` if the float is zero.
   * * `Ok(false)` if the float is not zero.
   * * `Err(FloatError)` if the operation fails.
   *
   * # Example
   *
   * ```typescript
   * const zero = Float.parse("0").value!;
   * const result = zero.isZero();
   * if (result.error) {
   *    console.error(result.error);
   * }
   * assert(result.value);
   * ```
   */
  isZero(): WasmEncodedResult<boolean>;
  /**
   * Returns the negation of the float.
   *
   * # Returns
   *
   * * `Ok(Float)` - The negated value.
   * * `Err(FloatError)` - If the operation fails.
   *
   * # Example
   *
   * ```typescript
   * const x = Float.parse("3.14").value!;
   * const result = x.neg();
   * if (result.error) {
   *    console.error(result.error);
   * }
   * assert(result.value.format() === "-3.14");
   * ```
   */
  neg(): WasmEncodedResult<Float>;
}
