Members
(constant) lastPosExists
Check if the last position exists in the localstorage
Methods
clearDB()
Clears all localstorage inserts and IndexedDB inserts
getHistory(psk) → {HistoryData}
Parameters:
Name | Type | Description |
---|---|---|
psk |
string |
Returns:
- Type
- HistoryData
getNextPos() → {number}
Increment the lastPos by 1 if non zero
Returns:
lastPos the position where to fetch from
- Type
- number
insertHistory(historyData)
Insert history data
Parameters:
Name | Type | Description |
---|---|---|
historyData |
HistoryData |
maxBlockHeight(items) → {number}
Returns the maximum block height within the list of items given.
The items are expected to have a `block_height` property.
Parameters:
Name | Type | Description |
---|---|---|
items |
Array.<{block_height: number}> |
- Source:
- See:
Returns:
the maximum block height found, or 0.
It's not possible to use `Math.max` because in certain engine (WebKit)
it's recursive, and it will exceed the stack if the arguments are a lot.
- Type
- number
setLastPos(position)
Set the lastPos in the localStorage
Parameters:
Name | Type | Description |
---|---|---|
position |
number | the position to set |