@bsv/wallet-toolbox 1.3.26 → 1.3.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/mobile/out/src/monitor/Monitor.js +4 -4
- package/mobile/out/src/monitor/tasks/{TaskServiceCallHistory.d.ts → TaskMonitorCallHistory.d.ts} +2 -2
- package/mobile/out/src/monitor/tasks/{TaskServiceCallHistory.d.ts.map → TaskMonitorCallHistory.d.ts.map} +1 -1
- package/{out/src/monitor/tasks/TaskServiceCallHistory.js → mobile/out/src/monitor/tasks/TaskMonitorCallHistory.js} +6 -6
- package/mobile/out/src/monitor/tasks/{TaskServiceCallHistory.js.map → TaskMonitorCallHistory.js.map} +1 -1
- package/mobile/package-lock.json +2 -2
- package/mobile/package.json +1 -1
- package/out/src/monitor/Monitor.js +4 -4
- package/out/src/monitor/tasks/{TaskServiceCallHistory.d.ts → TaskMonitorCallHistory.d.ts} +2 -2
- package/out/src/monitor/tasks/{TaskServiceCallHistory.d.ts.map → TaskMonitorCallHistory.d.ts.map} +1 -1
- package/{mobile/out/src/monitor/tasks/TaskServiceCallHistory.js → out/src/monitor/tasks/TaskMonitorCallHistory.js} +6 -6
- package/out/src/monitor/tasks/{TaskServiceCallHistory.js.map → TaskMonitorCallHistory.js.map} +1 -1
- package/out/src/storage/StorageKnex.d.ts.map +1 -1
- package/out/src/storage/StorageKnex.js +7 -0
- package/out/src/storage/StorageKnex.js.map +1 -1
- package/out/test/Wallet/local/localWallet.man.test.js +1 -1
- package/out/tsconfig.all.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/monitor/Monitor.ts +4 -4
- package/src/monitor/tasks/{TaskServiceCallHistory.ts → TaskMonitorCallHistory.ts} +3 -3
- package/src/storage/StorageKnex.ts +7 -0
- package/test/Wallet/local/localWallet.man.test.ts +1 -1
package/package.json
CHANGED
package/src/monitor/Monitor.ts
CHANGED
|
@@ -13,7 +13,7 @@ import { TaskFailAbandoned } from './tasks/TaskFailAbandoned'
|
|
|
13
13
|
import { TaskCheckForProofs } from './tasks/TaskCheckForProofs'
|
|
14
14
|
import { TaskClock } from './tasks/TaskClock'
|
|
15
15
|
import { TaskNewHeader } from './tasks/TaskNewHeader'
|
|
16
|
-
import {
|
|
16
|
+
import { TaskMonitorCallHistory } from './tasks/TaskMonitorCallHistory'
|
|
17
17
|
|
|
18
18
|
import { TaskSendWaiting } from './tasks/TaskSendWaiting'
|
|
19
19
|
import { TaskCheckNoSends } from './tasks/TaskCheckNoSends'
|
|
@@ -111,7 +111,7 @@ export class Monitor {
|
|
|
111
111
|
addAllTasksToOther(): void {
|
|
112
112
|
this._otherTasks.push(new TaskClock(this))
|
|
113
113
|
this._otherTasks.push(new TaskNewHeader(this))
|
|
114
|
-
this._otherTasks.push(new
|
|
114
|
+
this._otherTasks.push(new TaskMonitorCallHistory(this))
|
|
115
115
|
this._otherTasks.push(new TaskPurge(this, this.defaultPurgeParams))
|
|
116
116
|
this._otherTasks.push(new TaskReviewStatus(this))
|
|
117
117
|
this._otherTasks.push(new TaskSendWaiting(this))
|
|
@@ -130,7 +130,7 @@ export class Monitor {
|
|
|
130
130
|
addDefaultTasks(): void {
|
|
131
131
|
this._tasks.push(new TaskClock(this))
|
|
132
132
|
this._tasks.push(new TaskNewHeader(this))
|
|
133
|
-
this._tasks.push(new
|
|
133
|
+
this._tasks.push(new TaskMonitorCallHistory(this))
|
|
134
134
|
this._tasks.push(new TaskSendWaiting(this, 8 * this.oneSecond, 7 * this.oneSecond)) // Check every 8 seconds but must be 7 seconds old
|
|
135
135
|
this._tasks.push(new TaskCheckForProofs(this, 2 * this.oneHour)) // Every two hours if no block found
|
|
136
136
|
this._tasks.push(new TaskCheckNoSends(this))
|
|
@@ -147,7 +147,7 @@ export class Monitor {
|
|
|
147
147
|
addMultiUserTasks(): void {
|
|
148
148
|
this._tasks.push(new TaskClock(this))
|
|
149
149
|
this._tasks.push(new TaskNewHeader(this))
|
|
150
|
-
this._tasks.push(new
|
|
150
|
+
this._tasks.push(new TaskMonitorCallHistory(this))
|
|
151
151
|
this._tasks.push(new TaskSendWaiting(this, 8 * this.oneSecond, 7 * this.oneSecond)) // Check every 8 seconds but must be 7 seconds old
|
|
152
152
|
this._tasks.push(new TaskCheckForProofs(this, 2 * this.oneHour)) // Every two hours if no block found
|
|
153
153
|
this._tasks.push(new TaskCheckNoSends(this))
|
|
@@ -2,14 +2,14 @@ import { TableMonitorEvent } from '../../storage/index.client'
|
|
|
2
2
|
import { Monitor } from '../Monitor'
|
|
3
3
|
import { WalletMonitorTask } from './WalletMonitorTask'
|
|
4
4
|
|
|
5
|
-
export class
|
|
6
|
-
static taskName = '
|
|
5
|
+
export class TaskMonitorCallHistory extends WalletMonitorTask {
|
|
6
|
+
static taskName = 'MonitorCallHistory'
|
|
7
7
|
|
|
8
8
|
constructor(
|
|
9
9
|
monitor: Monitor,
|
|
10
10
|
public triggerMsecs = monitor.oneMinute * 12
|
|
11
11
|
) {
|
|
12
|
-
super(monitor,
|
|
12
|
+
super(monitor, TaskMonitorCallHistory.taskName)
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
trigger(nowMsecsSinceEpoch: number): { run: boolean } {
|
|
@@ -1159,6 +1159,13 @@ export class StorageKnex extends StorageProvider implements sdk.WalletStoragePro
|
|
|
1159
1159
|
const monitorEvent = verifyOneOrNone(await this.findMonitorEvents({ partial: { event: 'ServiceCallHistory'}, orderDescending: true, paged: { limit: 1 } }))
|
|
1160
1160
|
const monitorStats: ServicesCallHistory | undefined = monitorEvent ? JSON.parse(monitorEvent.details!) : undefined
|
|
1161
1161
|
const servicesStats = this.getServices().getServicesCallHistory(true)
|
|
1162
|
+
await this.insertMonitorEvent({
|
|
1163
|
+
event: 'ServicesCallHistory',
|
|
1164
|
+
details: JSON.stringify(servicesStats),
|
|
1165
|
+
created_at: new Date(),
|
|
1166
|
+
updated_at: new Date(),
|
|
1167
|
+
id: 0
|
|
1168
|
+
})
|
|
1162
1169
|
|
|
1163
1170
|
const one_day_ago = new Date(Date.now() - 24 * 60 * 60 * 1000).toISOString()
|
|
1164
1171
|
const one_week_ago = new Date(Date.now() - 7 * 24 * 60 * 60 * 1000).toISOString()
|
|
@@ -35,7 +35,7 @@ describe('localWallet tests', () => {
|
|
|
35
35
|
await setup.monitor.runOnce()
|
|
36
36
|
await setup.services.getRawTx('0000e416dfaf14c04899ccad2bf76a67c1d5598fece25cf4dcb7a076012b7d8d')
|
|
37
37
|
await setup.services.getRawTx('0000ced61e2491be55061ce6577e0c59b909922ba92d5cc1cd754b10d721ab0e')
|
|
38
|
-
logger(await setup.monitor.runTask('
|
|
38
|
+
logger(await setup.monitor.runTask('MonitorCallHistory'))
|
|
39
39
|
await setup.wallet.destroy()
|
|
40
40
|
})
|
|
41
41
|
|