toMBR
toMBR(
obj
,pathsCache
?):bigint
Defined in: packages/store-kit/src/objects/payments.ts:47
Calculates the minimum balance requirement (MBR) for an object.
Parameters
obj
unknown
The object for which to calculate the MBR.
pathsCache?
(undefined
| string
)[]
Precomputed paths of the object.
Returns
bigint
Throws
Throws a TypeError
if the object is undefined.
Throws
Throws a MaxSizeError if the object key or value exceeds the maximum size.
Example
Basic Usage
// Define an objectconst obj = { key: "value"}// Calculate the MBRconst mbr = toMBR(obj)
Cached Paths
Using the paths parameter
// Define an objectconst obj = { key: "value"}// Calculate the pathsconst paths = toPaths(obj)// Calculate the MBRconst mbr = toMBR(obj, paths)