• Calculates the minimum balance requirement (MBR) for an object.

    Parameters

    • obj: any

      The object for which to calculate the MBR.

    • OptionalpathsCache: (undefined | string)[]

      Precomputed paths of the object.

    Returns bigint

    Throws a TypeError if the object is undefined.

    Throws a MaxSizeError if the object key or value exceeds the maximum size.

    // Define an object
    const obj = {
    key: "value"
    }
    // Calculate the MBR
    const mbr = toMBR(obj)

    Using the paths parameter

    // Define an object
    const obj = {
    key: "value"
    }
    // Calculate the paths
    const paths = toPaths(obj)
    // Calculate the MBR
    const mbr = toMBR(obj, paths)