A unique stringified document ID
Optional_A unique document ID (Mongo DB ObjectID)
The latest synced block status (i.e. height, txIndex, timestamp)
The current gas price based on the average of recent transactions
OptionallastThe last X transactions with timestamps for dynamic reset functionality
The next collection ID to be used
Clean up old transactions beyond a certain age
Maximum age in milliseconds
OptionalcurrentTime: numberCurrent timestamp (optional, defaults to Date.now())
Number of transactions removed
Deep copies the object and returns a new instance.
Converts the object to a different NumberType equivalent.
Optionaloptions: ConvertOptionsCompares this object's fields to another object's fields for equality. Equality is determined by comparing the JSON representations of the objects.
If normalizeNumberTypes is true, then all number types will be compared as strings (i.e. "1n" === "1" === 1). Else, they will be compared as their native types (i.e. 1n !== 1 !== "1").
OptionalnormalizeNumberTypes: booleanCalculate average gas price from transactions in a time window
Time window in milliseconds
OptionalcurrentTime: numberCurrent timestamp (optional, defaults to Date.now())
Average gas price or 0 if no transactions
Get the most recent transaction
The most recent transaction entry or null if none exist
Internal helper method to convert the number fields of the object to a different NumberType equivalent.
Get transactions within a time window
Time window in milliseconds
OptionalcurrentTime: numberCurrent timestamp (optional, defaults to Date.now())
OptionaldefaultMinimumTxs: numberArray of transactions within the time window
Get transaction statistics in a time window
Time window in milliseconds
OptionalcurrentTime: numberCurrent timestamp (optional, defaults to Date.now())
Object with transaction statistics
Checks if the object has number fields.
Converts the object to a JSON object with all primitive types.
Converts the object to a JSON string.
Example