@bsv/wallet-toolbox 2.1.25 → 2.1.26
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/docs/client.md +1683 -1111
- package/docs/monitor.md +34 -19
- package/docs/services.md +303 -279
- package/docs/setup.md +24 -24
- package/docs/storage.md +864 -199
- package/docs/wallet.md +5228 -11040
- package/out/src/__tests/CWIStyleWalletManager.test.js +3 -2
- package/out/src/__tests/CWIStyleWalletManager.test.js.map +1 -1
- package/out/src/__tests/ShamirWalletManager.test.js +4 -0
- package/out/src/__tests/ShamirWalletManager.test.js.map +1 -1
- package/out/src/__tests/WalletPermissionsManager.callbacks.test.js +9 -17
- package/out/src/__tests/WalletPermissionsManager.callbacks.test.js.map +1 -1
- package/out/src/__tests/WalletPermissionsManager.checks.test.js +4 -4
- package/out/src/__tests/WalletPermissionsManager.checks.test.js.map +1 -1
- package/out/src/__tests/WalletPermissionsManager.encryption.test.js +8 -8
- package/out/src/__tests/WalletPermissionsManager.encryption.test.js.map +1 -1
- package/out/src/__tests/WalletPermissionsManager.fixtures.d.ts +2 -1
- package/out/src/__tests/WalletPermissionsManager.fixtures.d.ts.map +1 -1
- package/out/src/__tests/WalletPermissionsManager.fixtures.js +7 -5
- package/out/src/__tests/WalletPermissionsManager.fixtures.js.map +1 -1
- package/out/src/__tests/WalletPermissionsManager.flows.test.js +14 -14
- package/out/src/__tests/WalletPermissionsManager.flows.test.js.map +1 -1
- package/out/src/__tests/WalletPermissionsManager.initialization.test.js +4 -4
- package/out/src/__tests/WalletPermissionsManager.initialization.test.js.map +1 -1
- package/out/src/__tests/WalletPermissionsManager.pmodules.test.js +4 -4
- package/out/src/__tests/WalletPermissionsManager.pmodules.test.js.map +1 -1
- package/out/src/__tests/WalletPermissionsManager.proxying.test.js +6 -5
- package/out/src/__tests/WalletPermissionsManager.proxying.test.js.map +1 -1
- package/out/src/__tests/WalletPermissionsManager.tokens.test.js +2 -1
- package/out/src/__tests/WalletPermissionsManager.tokens.test.js.map +1 -1
- package/out/src/entropy/EntropyCollector.js.map +1 -1
- package/out/src/mockchain/MockChainMigrations.d.ts.map +1 -1
- package/out/src/mockchain/MockChainStorage.js +3 -3
- package/out/src/mockchain/MockChainStorage.js.map +1 -1
- package/out/src/mockchain/MockMiner.js +1 -1
- package/out/src/mockchain/MockMiner.js.map +1 -1
- package/out/src/mockchain/MockServices.js +14 -13
- package/out/src/mockchain/MockServices.js.map +1 -1
- package/out/src/monitor/Monitor.js +8 -6
- package/out/src/monitor/Monitor.js.map +1 -1
- package/out/src/monitor/MonitorDaemon.d.ts.map +1 -1
- package/out/src/monitor/MonitorDaemon.js +11 -13
- package/out/src/monitor/MonitorDaemon.js.map +1 -1
- package/out/src/sdk/PrivilegedKeyManager.d.ts.map +1 -1
- package/out/src/sdk/PrivilegedKeyManager.js +6 -3
- package/out/src/sdk/PrivilegedKeyManager.js.map +1 -1
- package/out/src/sdk/WalletError.d.ts.map +1 -1
- package/out/src/sdk/WalletError.js +19 -18
- package/out/src/sdk/WalletError.js.map +1 -1
- package/out/src/sdk/WalletErrorFromJson.js +1 -1
- package/out/src/sdk/WalletErrorFromJson.js.map +1 -1
- package/out/src/sdk/WalletStorage.interfaces.d.ts +59 -59
- package/out/src/sdk/WalletStorage.interfaces.d.ts.map +1 -1
- package/out/src/services/ServiceCollection.d.ts.map +1 -1
- package/out/src/services/ServiceCollection.js +3 -4
- package/out/src/services/ServiceCollection.js.map +1 -1
- package/out/src/services/Services.d.ts.map +1 -1
- package/out/src/services/Services.js +27 -25
- package/out/src/services/Services.js.map +1 -1
- package/out/src/storage/StorageIdb.d.ts.map +1 -1
- package/out/src/storage/StorageIdb.js +99 -94
- package/out/src/storage/StorageIdb.js.map +1 -1
- package/out/src/storage/StorageKnex.d.ts +1 -1
- package/out/src/storage/StorageKnex.d.ts.map +1 -1
- package/out/src/storage/StorageKnex.js +159 -156
- package/out/src/storage/StorageKnex.js.map +1 -1
- package/out/src/storage/StorageProvider.d.ts.map +1 -1
- package/out/src/storage/StorageProvider.js +35 -31
- package/out/src/storage/StorageProvider.js.map +1 -1
- package/out/src/storage/StorageReader.js +7 -7
- package/out/src/storage/StorageReader.js.map +1 -1
- package/out/src/storage/StorageReaderWriter.d.ts +0 -1
- package/out/src/storage/StorageReaderWriter.d.ts.map +1 -1
- package/out/src/storage/StorageReaderWriter.js +0 -3
- package/out/src/storage/StorageReaderWriter.js.map +1 -1
- package/out/src/storage/StorageSyncReader.js +1 -1
- package/out/src/storage/StorageSyncReader.js.map +1 -1
- package/out/src/storage/WalletStorageManager.d.ts.map +1 -1
- package/out/src/storage/WalletStorageManager.js +22 -21
- package/out/src/storage/WalletStorageManager.js.map +1 -1
- package/out/src/storage/index.all.d.ts +3 -0
- package/out/src/storage/index.all.d.ts.map +1 -1
- package/out/src/storage/index.all.js +3 -0
- package/out/src/storage/index.all.js.map +1 -1
- package/out/src/storage/index.client.d.ts +3 -0
- package/out/src/storage/index.client.d.ts.map +1 -1
- package/out/src/storage/index.client.js +3 -0
- package/out/src/storage/index.client.js.map +1 -1
- package/out/src/storage/index.mobile.d.ts +3 -0
- package/out/src/storage/index.mobile.d.ts.map +1 -1
- package/out/src/storage/index.mobile.js +3 -0
- package/out/src/storage/index.mobile.js.map +1 -1
- package/out/src/storage/portable/index.d.ts +55 -0
- package/out/src/storage/portable/index.d.ts.map +1 -0
- package/out/src/storage/portable/index.js +830 -0
- package/out/src/storage/portable/index.js.map +1 -0
- package/out/src/storage/storageProviderHelpers.js +2 -2
- package/out/src/storage/storageProviderHelpers.js.map +1 -1
- package/out/src/utility/Format.d.ts.map +1 -1
- package/out/src/utility/Format.js +10 -45
- package/out/src/utility/Format.js.map +1 -1
- package/out/src/utility/ScriptTemplateBRC29.d.ts.map +1 -1
- package/out/src/utility/ScriptTemplateBRC29.js +3 -2
- package/out/src/utility/ScriptTemplateBRC29.js.map +1 -1
- package/out/src/utility/brc114ActionTimeLabels.js +1 -1
- package/out/src/utility/brc114ActionTimeLabels.js.map +1 -1
- package/out/src/utility/identityUtils.d.ts.map +1 -1
- package/out/src/utility/identityUtils.js +5 -5
- package/out/src/utility/identityUtils.js.map +1 -1
- package/out/src/utility/index.all.d.ts +1 -0
- package/out/src/utility/index.all.d.ts.map +1 -1
- package/out/src/utility/index.all.js +1 -0
- package/out/src/utility/index.all.js.map +1 -1
- package/out/src/utility/index.client.d.ts +1 -0
- package/out/src/utility/index.client.d.ts.map +1 -1
- package/out/src/utility/index.client.js +1 -0
- package/out/src/utility/index.client.js.map +1 -1
- package/out/src/utility/stampLog.js +3 -3
- package/out/src/utility/stampLog.js.map +1 -1
- package/out/src/utility/utilityHelpers.buffer.js +1 -1
- package/out/src/utility/utilityHelpers.buffer.js.map +1 -1
- package/out/src/utility/utilityHelpers.d.ts.map +1 -1
- package/out/src/utility/utilityHelpers.js +2 -2
- package/out/src/utility/utilityHelpers.js.map +1 -1
- package/out/src/wab-client/WABClient.d.ts +2 -2
- package/out/src/wab-client/WABClient.d.ts.map +1 -1
- package/package.json +1 -1
- package/out/src/storage/schema/__tests/v7Backfill.runner.test.d.ts +0 -2
- package/out/src/storage/schema/__tests/v7Backfill.runner.test.d.ts.map +0 -1
- package/out/src/storage/schema/__tests/v7Backfill.runner.test.js +0 -148
- package/out/src/storage/schema/__tests/v7Backfill.runner.test.js.map +0 -1
- package/out/src/storage/schema/__tests/v7Backfill.test.d.ts +0 -2
- package/out/src/storage/schema/__tests/v7Backfill.test.d.ts.map +0 -1
- package/out/src/storage/schema/__tests/v7Backfill.test.js +0 -96
- package/out/src/storage/schema/__tests/v7Backfill.test.js.map +0 -1
- package/out/src/storage/schema/__tests/v7Fsm.test.d.ts +0 -2
- package/out/src/storage/schema/__tests/v7Fsm.test.d.ts.map +0 -1
- package/out/src/storage/schema/__tests/v7Fsm.test.js +0 -42
- package/out/src/storage/schema/__tests/v7Fsm.test.js.map +0 -1
- package/out/src/storage/schema/__tests/v7Spendability.test.d.ts +0 -2
- package/out/src/storage/schema/__tests/v7Spendability.test.d.ts.map +0 -1
- package/out/src/storage/schema/__tests/v7Spendability.test.js +0 -29
- package/out/src/storage/schema/__tests/v7Spendability.test.js.map +0 -1
- package/out/src/storage/schema/tables/TableAction.d.ts +0 -38
- package/out/src/storage/schema/tables/TableAction.d.ts.map +0 -1
- package/out/src/storage/schema/tables/TableAction.js +0 -3
- package/out/src/storage/schema/tables/TableAction.js.map +0 -1
- package/out/src/storage/schema/tables/TableChainTip.d.ts +0 -17
- package/out/src/storage/schema/tables/TableChainTip.d.ts.map +0 -1
- package/out/src/storage/schema/tables/TableChainTip.js +0 -3
- package/out/src/storage/schema/tables/TableChainTip.js.map +0 -1
- package/out/src/storage/schema/tables/TableMonitorLease.d.ts +0 -23
- package/out/src/storage/schema/tables/TableMonitorLease.d.ts.map +0 -1
- package/out/src/storage/schema/tables/TableMonitorLease.js +0 -3
- package/out/src/storage/schema/tables/TableMonitorLease.js.map +0 -1
- package/out/src/storage/schema/tables/TableTransactionV7.d.ts +0 -50
- package/out/src/storage/schema/tables/TableTransactionV7.d.ts.map +0 -1
- package/out/src/storage/schema/tables/TableTransactionV7.js +0 -3
- package/out/src/storage/schema/tables/TableTransactionV7.js.map +0 -1
- package/out/src/storage/schema/tables/TableTxAudit.d.ts +0 -26
- package/out/src/storage/schema/tables/TableTxAudit.d.ts.map +0 -1
- package/out/src/storage/schema/tables/TableTxAudit.js +0 -3
- package/out/src/storage/schema/tables/TableTxAudit.js.map +0 -1
- package/out/src/storage/schema/v7Backfill.d.ts +0 -35
- package/out/src/storage/schema/v7Backfill.d.ts.map +0 -1
- package/out/src/storage/schema/v7Backfill.idb.d.ts +0 -32
- package/out/src/storage/schema/v7Backfill.idb.d.ts.map +0 -1
- package/out/src/storage/schema/v7Backfill.idb.js +0 -95
- package/out/src/storage/schema/v7Backfill.idb.js.map +0 -1
- package/out/src/storage/schema/v7Backfill.js +0 -147
- package/out/src/storage/schema/v7Backfill.js.map +0 -1
- package/out/src/storage/schema/v7Backfill.knex.d.ts +0 -32
- package/out/src/storage/schema/v7Backfill.knex.d.ts.map +0 -1
- package/out/src/storage/schema/v7Backfill.knex.js +0 -240
- package/out/src/storage/schema/v7Backfill.knex.js.map +0 -1
- package/out/src/storage/schema/v7Backfill.runner.d.ts +0 -63
- package/out/src/storage/schema/v7Backfill.runner.d.ts.map +0 -1
- package/out/src/storage/schema/v7Backfill.runner.js +0 -62
- package/out/src/storage/schema/v7Backfill.runner.js.map +0 -1
- package/out/src/storage/schema/v7Crud.d.ts +0 -39
- package/out/src/storage/schema/v7Crud.d.ts.map +0 -1
- package/out/src/storage/schema/v7Crud.js +0 -203
- package/out/src/storage/schema/v7Crud.js.map +0 -1
- package/out/src/storage/schema/v7Fsm.d.ts +0 -27
- package/out/src/storage/schema/v7Fsm.d.ts.map +0 -1
- package/out/src/storage/schema/v7Fsm.js +0 -108
- package/out/src/storage/schema/v7Fsm.js.map +0 -1
- package/out/src/storage/schema/v7MonitorLease.d.ts +0 -57
- package/out/src/storage/schema/v7MonitorLease.d.ts.map +0 -1
- package/out/src/storage/schema/v7MonitorLease.js +0 -101
- package/out/src/storage/schema/v7MonitorLease.js.map +0 -1
- package/out/src/storage/schema/v7Spendability.d.ts +0 -45
- package/out/src/storage/schema/v7Spendability.d.ts.map +0 -1
- package/out/src/storage/schema/v7Spendability.js +0 -52
- package/out/src/storage/schema/v7Spendability.js.map +0 -1
- package/out/src/storage/schema/v7TxAudit.d.ts +0 -33
- package/out/src/storage/schema/v7TxAudit.d.ts.map +0 -1
- package/out/src/storage/schema/v7TxAudit.js +0 -64
- package/out/src/storage/schema/v7TxAudit.js.map +0 -1
|
@@ -24,11 +24,11 @@ export declare class WABClient {
|
|
|
24
24
|
/**
|
|
25
25
|
* Start an Auth Method flow
|
|
26
26
|
*/
|
|
27
|
-
startAuthMethod(authMethod: AuthMethodInteractor, presentationKey: string, payload: any): Promise<
|
|
27
|
+
startAuthMethod(authMethod: AuthMethodInteractor, presentationKey: string, payload: any): Promise<any>;
|
|
28
28
|
/**
|
|
29
29
|
* Complete an Auth Method flow
|
|
30
30
|
*/
|
|
31
|
-
completeAuthMethod(authMethod: AuthMethodInteractor, presentationKey: string, payload: any): Promise<
|
|
31
|
+
completeAuthMethod(authMethod: AuthMethodInteractor, presentationKey: string, payload: any): Promise<any>;
|
|
32
32
|
/**
|
|
33
33
|
* List user-linked methods
|
|
34
34
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WABClient.d.ts","sourceRoot":"","sources":["../../../src/wab-client/WABClient.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,oBAAoB,EAAE,MAAM,gDAAgD,CAAA;AAGrF,qBAAa,SAAS;IACP,OAAO,CAAC,QAAQ,CAAC,SAAS;gBAAT,SAAS,EAAE,MAAM;IAE/C;;OAEG;IACU,OAAO;
|
|
1
|
+
{"version":3,"file":"WABClient.d.ts","sourceRoot":"","sources":["../../../src/wab-client/WABClient.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,oBAAoB,EAAE,MAAM,gDAAgD,CAAA;AAGrF,qBAAa,SAAS;IACP,OAAO,CAAC,QAAQ,CAAC,SAAS;gBAAT,SAAS,EAAE,MAAM;IAE/C;;OAEG;IACU,OAAO,IAAK,OAAO,CAAC,GAAG,CAAC;IAKrC;;OAEG;IACI,6BAA6B,IAAK,MAAM;IAI/C;;OAEG;IACU,eAAe,CAAE,UAAU,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;IAIpH;;OAEG;IACU,kBAAkB,CAAE,UAAU,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;IAIvH;;OAEG;IACU,iBAAiB,CAAE,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAStE;;OAEG;IACU,Y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OAAO,EAAE,GAAG,EACZ,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;CAYlD"}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"v7Backfill.runner.test.d.ts","sourceRoot":"","sources":["../../../../../src/storage/schema/__tests/v7Backfill.runner.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const v7Backfill_runner_1 = require("../v7Backfill.runner");
|
|
4
|
-
class FakeDriver {
|
|
5
|
-
constructor() {
|
|
6
|
-
this.reqs = [];
|
|
7
|
-
this.legacyTxs = [];
|
|
8
|
-
this.v7Rows = [];
|
|
9
|
-
this.actions = [];
|
|
10
|
-
this.labelRepoints = [];
|
|
11
|
-
this.nextV7Id = 1;
|
|
12
|
-
this.nextActionId = 1;
|
|
13
|
-
}
|
|
14
|
-
async *streamLegacyReqs() {
|
|
15
|
-
for (const r of this.reqs)
|
|
16
|
-
yield r;
|
|
17
|
-
}
|
|
18
|
-
async *streamLegacyTransactions() {
|
|
19
|
-
for (const t of this.legacyTxs)
|
|
20
|
-
yield t;
|
|
21
|
-
}
|
|
22
|
-
async upsertTransactionV7(row) {
|
|
23
|
-
const existing = this.v7Rows.find(r => r.txid === row.txid);
|
|
24
|
-
if (existing != null) {
|
|
25
|
-
Object.assign(existing, row);
|
|
26
|
-
return existing.transactionId;
|
|
27
|
-
}
|
|
28
|
-
const inserted = { ...row, transactionId: this.nextV7Id++ };
|
|
29
|
-
this.v7Rows.push(inserted);
|
|
30
|
-
return inserted.transactionId;
|
|
31
|
-
}
|
|
32
|
-
async upsertAction(row) {
|
|
33
|
-
const existing = this.actions.find(a => a.userId === row.userId && a.transactionId === row.transactionId);
|
|
34
|
-
if (existing != null) {
|
|
35
|
-
Object.assign(existing, row);
|
|
36
|
-
return existing.actionId;
|
|
37
|
-
}
|
|
38
|
-
const inserted = { ...row, actionId: this.nextActionId++ };
|
|
39
|
-
this.actions.push(inserted);
|
|
40
|
-
return inserted.actionId;
|
|
41
|
-
}
|
|
42
|
-
async repointTxLabelMap(legacyTransactionId, actionId) {
|
|
43
|
-
this.labelRepoints.push([legacyTransactionId, actionId]);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
const now = new Date('2026-05-11T12:00:00Z');
|
|
47
|
-
function legacyReq(txid, overrides = {}) {
|
|
48
|
-
return {
|
|
49
|
-
created_at: now,
|
|
50
|
-
updated_at: now,
|
|
51
|
-
provenTxReqId: Math.floor(Math.random() * 1e9),
|
|
52
|
-
status: 'unmined',
|
|
53
|
-
attempts: 1,
|
|
54
|
-
notified: false,
|
|
55
|
-
txid,
|
|
56
|
-
history: '{}',
|
|
57
|
-
notify: '{}',
|
|
58
|
-
rawTx: [1, 2],
|
|
59
|
-
wasBroadcast: true,
|
|
60
|
-
rebroadcastAttempts: 0,
|
|
61
|
-
...overrides
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
function legacyProven(txid) {
|
|
65
|
-
return {
|
|
66
|
-
created_at: now,
|
|
67
|
-
updated_at: now,
|
|
68
|
-
provenTxId: 99,
|
|
69
|
-
txid,
|
|
70
|
-
height: 800001,
|
|
71
|
-
index: 2,
|
|
72
|
-
merklePath: [7, 7],
|
|
73
|
-
rawTx: [1, 2],
|
|
74
|
-
blockHash: 'b'.repeat(64),
|
|
75
|
-
merkleRoot: 'c'.repeat(64)
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
function legacyTx(overrides = {}) {
|
|
79
|
-
return {
|
|
80
|
-
created_at: now,
|
|
81
|
-
updated_at: now,
|
|
82
|
-
transactionId: 1,
|
|
83
|
-
userId: 7,
|
|
84
|
-
status: 'completed',
|
|
85
|
-
reference: 'r-1',
|
|
86
|
-
isOutgoing: true,
|
|
87
|
-
satoshis: 1000,
|
|
88
|
-
description: 'd',
|
|
89
|
-
txid: 'a'.repeat(64),
|
|
90
|
-
...overrides
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
describe('runV7Backfill orchestrator', () => {
|
|
94
|
-
test('emits one transactions_v7 row per unique txid across reqs + legacy tx', async () => {
|
|
95
|
-
const driver = new FakeDriver();
|
|
96
|
-
const txidA = 'a'.repeat(64);
|
|
97
|
-
const txidB = 'b'.repeat(64);
|
|
98
|
-
driver.reqs = [{ req: legacyReq(txidA, { status: 'completed' }), proven: legacyProven(txidA) }];
|
|
99
|
-
driver.legacyTxs = [
|
|
100
|
-
legacyTx({ transactionId: 1, txid: txidA, status: 'completed' }),
|
|
101
|
-
legacyTx({ transactionId: 2, txid: txidB, status: 'sending', userId: 7, reference: 'r-2' })
|
|
102
|
-
];
|
|
103
|
-
const stats = await (0, v7Backfill_runner_1.runV7Backfill)(driver, now);
|
|
104
|
-
expect(driver.v7Rows).toHaveLength(2);
|
|
105
|
-
expect(stats.reqsBackfilled).toBe(1);
|
|
106
|
-
expect(stats.legacyTxOnlyBackfilled).toBe(1);
|
|
107
|
-
expect(stats.actionsBackfilled).toBe(2);
|
|
108
|
-
expect(stats.labelMapsRepointed).toBe(2);
|
|
109
|
-
const provenRow = driver.v7Rows.find(r => r.txid === txidA);
|
|
110
|
-
expect(provenRow.processing).toBe('proven');
|
|
111
|
-
expect(provenRow.height).toBe(800001);
|
|
112
|
-
const localRow = driver.v7Rows.find(r => r.txid === txidB);
|
|
113
|
-
expect(localRow.processing).toBe('sending');
|
|
114
|
-
expect(localRow.height).toBeUndefined();
|
|
115
|
-
});
|
|
116
|
-
test('skips legacy transactions without a txid', async () => {
|
|
117
|
-
const driver = new FakeDriver();
|
|
118
|
-
driver.legacyTxs = [legacyTx({ transactionId: 5, txid: undefined, status: 'unsigned' })];
|
|
119
|
-
const stats = await (0, v7Backfill_runner_1.runV7Backfill)(driver, now);
|
|
120
|
-
expect(driver.v7Rows).toHaveLength(0);
|
|
121
|
-
expect(driver.actions).toHaveLength(0);
|
|
122
|
-
expect(stats.actionsBackfilled).toBe(0);
|
|
123
|
-
expect(stats.legacyTxOnlyBackfilled).toBe(0);
|
|
124
|
-
});
|
|
125
|
-
test('shares one transactions_v7 row when multiple users have actions on same txid', async () => {
|
|
126
|
-
const driver = new FakeDriver();
|
|
127
|
-
const txid = 'a'.repeat(64);
|
|
128
|
-
driver.legacyTxs = [
|
|
129
|
-
legacyTx({ transactionId: 10, txid, userId: 1, reference: 'r-1' }),
|
|
130
|
-
legacyTx({ transactionId: 11, txid, userId: 2, reference: 'r-2' })
|
|
131
|
-
];
|
|
132
|
-
const stats = await (0, v7Backfill_runner_1.runV7Backfill)(driver, now);
|
|
133
|
-
expect(driver.v7Rows).toHaveLength(1);
|
|
134
|
-
expect(driver.actions).toHaveLength(2);
|
|
135
|
-
expect(driver.actions.map(a => a.userId).sort()).toEqual([1, 2]);
|
|
136
|
-
expect(stats.legacyTxOnlyBackfilled).toBe(1);
|
|
137
|
-
});
|
|
138
|
-
test('repoints labels using the new actionId, not the legacy transactionId', async () => {
|
|
139
|
-
const driver = new FakeDriver();
|
|
140
|
-
driver.legacyTxs = [legacyTx({ transactionId: 42, userId: 7, reference: 'r-x' })];
|
|
141
|
-
await (0, v7Backfill_runner_1.runV7Backfill)(driver, now);
|
|
142
|
-
expect(driver.labelRepoints).toHaveLength(1);
|
|
143
|
-
const [legacy, actionId] = driver.labelRepoints[0];
|
|
144
|
-
expect(legacy).toBe(42);
|
|
145
|
-
expect(actionId).toBe(driver.actions[0].actionId);
|
|
146
|
-
});
|
|
147
|
-
});
|
|
148
|
-
//# sourceMappingURL=v7Backfill.runner.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"v7Backfill.runner.test.js","sourceRoot":"","sources":["../../../../../src/storage/schema/__tests/v7Backfill.runner.test.ts"],"names":[],"mappings":";;AAOA,4DAAsE;AAEtE,MAAM,UAAU;IAAhB;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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const v7Backfill_1 = require("../v7Backfill");
|
|
4
|
-
const now = new Date('2026-05-11T12:00:00Z');
|
|
5
|
-
function legacyReq(overrides = {}) {
|
|
6
|
-
return {
|
|
7
|
-
created_at: new Date('2026-01-01T00:00:00Z'),
|
|
8
|
-
updated_at: new Date('2026-01-02T00:00:00Z'),
|
|
9
|
-
provenTxReqId: 1,
|
|
10
|
-
status: 'unmined',
|
|
11
|
-
attempts: 3,
|
|
12
|
-
notified: false,
|
|
13
|
-
txid: 'a'.repeat(64),
|
|
14
|
-
history: '{}',
|
|
15
|
-
notify: '{}',
|
|
16
|
-
rawTx: [1, 2, 3],
|
|
17
|
-
wasBroadcast: true,
|
|
18
|
-
rebroadcastAttempts: 0,
|
|
19
|
-
...overrides
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
function legacyProven(overrides = {}) {
|
|
23
|
-
return {
|
|
24
|
-
created_at: new Date('2026-01-03T00:00:00Z'),
|
|
25
|
-
updated_at: new Date('2026-01-03T00:00:00Z'),
|
|
26
|
-
provenTxId: 1,
|
|
27
|
-
txid: 'a'.repeat(64),
|
|
28
|
-
height: 800000,
|
|
29
|
-
index: 7,
|
|
30
|
-
merklePath: [9, 9, 9],
|
|
31
|
-
rawTx: [1, 2, 3],
|
|
32
|
-
blockHash: 'b'.repeat(64),
|
|
33
|
-
merkleRoot: 'c'.repeat(64),
|
|
34
|
-
...overrides
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
function legacyTx(overrides = {}) {
|
|
38
|
-
return {
|
|
39
|
-
created_at: new Date('2026-02-01T00:00:00Z'),
|
|
40
|
-
updated_at: new Date('2026-02-02T00:00:00Z'),
|
|
41
|
-
transactionId: 42,
|
|
42
|
-
userId: 7,
|
|
43
|
-
status: 'completed',
|
|
44
|
-
reference: 'ref-abc',
|
|
45
|
-
isOutgoing: true,
|
|
46
|
-
satoshis: 5000,
|
|
47
|
-
description: 'pay alice',
|
|
48
|
-
txid: 'a'.repeat(64),
|
|
49
|
-
...overrides
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
describe('v7Backfill', () => {
|
|
53
|
-
test('buildTransactionV7Row maps unmined req without proof to sent FSM state', () => {
|
|
54
|
-
const row = (0, v7Backfill_1.buildTransactionV7Row)(legacyReq(), undefined, now);
|
|
55
|
-
expect(row.processing).toBe('sent');
|
|
56
|
-
expect(row.wasBroadcast).toBe(true);
|
|
57
|
-
expect(row.attempts).toBe(3);
|
|
58
|
-
expect(row.height).toBeUndefined();
|
|
59
|
-
expect(row.rawTx).toEqual([1, 2, 3]);
|
|
60
|
-
});
|
|
61
|
-
test('buildTransactionV7Row merges proven_txs fields when present', () => {
|
|
62
|
-
const row = (0, v7Backfill_1.buildTransactionV7Row)(legacyReq({ status: 'completed' }), legacyProven(), now);
|
|
63
|
-
expect(row.processing).toBe('proven');
|
|
64
|
-
expect(row.height).toBe(800000);
|
|
65
|
-
expect(row.merkleIndex).toBe(7);
|
|
66
|
-
expect(row.blockHash).toBe('b'.repeat(64));
|
|
67
|
-
});
|
|
68
|
-
test('buildTransactionV7Row maps rebroadcastAttempts -> rebroadcastCycles', () => {
|
|
69
|
-
const row = (0, v7Backfill_1.buildTransactionV7Row)(legacyReq({ rebroadcastAttempts: 5 }), undefined, now);
|
|
70
|
-
expect(row.rebroadcastCycles).toBe(5);
|
|
71
|
-
});
|
|
72
|
-
test('buildTransactionV7RowFromLegacyTx returns undefined when no txid', () => {
|
|
73
|
-
const row = (0, v7Backfill_1.buildTransactionV7RowFromLegacyTx)(legacyTx({ txid: undefined }), now);
|
|
74
|
-
expect(row).toBeUndefined();
|
|
75
|
-
});
|
|
76
|
-
test('buildTransactionV7RowFromLegacyTx maps completed -> proven', () => {
|
|
77
|
-
const row = (0, v7Backfill_1.buildTransactionV7RowFromLegacyTx)(legacyTx(), now);
|
|
78
|
-
expect(row === null || row === void 0 ? void 0 : row.processing).toBe('proven');
|
|
79
|
-
expect(row === null || row === void 0 ? void 0 : row.txid).toBe('a'.repeat(64));
|
|
80
|
-
});
|
|
81
|
-
test('buildActionRow propagates per-user fields and detects nosend', () => {
|
|
82
|
-
const a = (0, v7Backfill_1.buildActionRow)(legacyTx({ status: 'nosend' }), 99, now);
|
|
83
|
-
expect(a.userId).toBe(7);
|
|
84
|
-
expect(a.transactionId).toBe(99);
|
|
85
|
-
expect(a.userNosend).toBe(true);
|
|
86
|
-
expect(a.userAborted).toBe(false);
|
|
87
|
-
expect(a.satoshisDelta).toBe(5000);
|
|
88
|
-
expect(a.reference).toBe('ref-abc');
|
|
89
|
-
});
|
|
90
|
-
test('buildActionRow flags failed legacy tx as userAborted', () => {
|
|
91
|
-
const a = (0, v7Backfill_1.buildActionRow)(legacyTx({ status: 'failed' }), 100, now);
|
|
92
|
-
expect(a.userAborted).toBe(true);
|
|
93
|
-
expect(a.userNosend).toBe(false);
|
|
94
|
-
});
|
|
95
|
-
});
|
|
96
|
-
//# sourceMappingURL=v7Backfill.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"v7Backfill.test.js","sourceRoot":"","sources":["../../../../../src/storage/schema/__tests/v7Backfill.test.ts"],"names":[],"mappings":";;AAAA,8CAIsB;AAGtB,MAAM,GAAG,GAAG,IAAI,IAAI,CAAC,sBAAsB,CAAC,CAAA;AAE5C,SAAS,SAAS,CAAE,YAAuC,EAAE;IAC3D,OAAO;QACL,UAAU,EAAE,IAAI,IAAI,CAAC,sBAAsB,CAAC;QAC5C,UAAU,EAAE,IAAI,IAAI,CAAC,sBAAsB,CAAC;QAC5C,aAAa,EAAE,CAAC;QAChB,MAAM,EAAE,SAAS;QACjB,QAAQ,EAAE,CAAC;QACX,QAAQ,EAAE,KAAK;QACf,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;QACpB,OAAO,EAAE,IAAI;QACb,MAAM,EAAE,IAAI;QACZ,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,E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,CAAC,IAAI,CAAC,CAAA;QAClC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;IACrC,CAAC,CAAC,CAAA;IAEF,IAAI,CAAC,sDAAsD,EAAE,GAAG,EAAE;QAChE,MAAM,CAAC,GAAG,IAAA,2BAAc,EAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;QAClE,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAChC,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IAClC,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"v7Fsm.test.d.ts","sourceRoot":"","sources":["../../../../../src/storage/schema/__tests/v7Fsm.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const v7Fsm_1 = require("../v7Fsm");
|
|
4
|
-
describe('v7Fsm', () => {
|
|
5
|
-
test('identity transitions are allowed', () => {
|
|
6
|
-
const map = (0, v7Fsm_1.processingTransitionMap)();
|
|
7
|
-
for (const s of Object.keys(map)) {
|
|
8
|
-
expect((0, v7Fsm_1.isValidProcessingTransition)(s, s)).toBe(true);
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
test('queued cannot jump straight to proven', () => {
|
|
12
|
-
expect((0, v7Fsm_1.isValidProcessingTransition)('queued', 'proven')).toBe(false);
|
|
13
|
-
const r = (0, v7Fsm_1.validateProcessingTransition)('queued', 'proven');
|
|
14
|
-
expect(r.ok).toBe(false);
|
|
15
|
-
expect(r.reason).toMatch(/illegal transition/);
|
|
16
|
-
});
|
|
17
|
-
test('canonical happy path: queued -> sending -> sent -> seen -> proven', () => {
|
|
18
|
-
expect((0, v7Fsm_1.isValidProcessingTransition)('queued', 'sending')).toBe(true);
|
|
19
|
-
expect((0, v7Fsm_1.isValidProcessingTransition)('sending', 'sent')).toBe(true);
|
|
20
|
-
expect((0, v7Fsm_1.isValidProcessingTransition)('sent', 'seen')).toBe(true);
|
|
21
|
-
expect((0, v7Fsm_1.isValidProcessingTransition)('seen', 'proven')).toBe(true);
|
|
22
|
-
});
|
|
23
|
-
test('terminal states block direct re-entry except via unfail', () => {
|
|
24
|
-
expect((0, v7Fsm_1.isValidProcessingTransition)('invalid', 'queued')).toBe(false);
|
|
25
|
-
expect((0, v7Fsm_1.isValidProcessingTransition)('invalid', 'unfail')).toBe(true);
|
|
26
|
-
expect((0, v7Fsm_1.isValidProcessingTransition)('doubleSpend', 'unfail')).toBe(true);
|
|
27
|
-
expect((0, v7Fsm_1.isValidProcessingTransition)('proven', 'reorging')).toBe(true);
|
|
28
|
-
});
|
|
29
|
-
test('isProcessingSpendable matches sdk constant', () => {
|
|
30
|
-
expect((0, v7Fsm_1.isProcessingSpendable)('sent')).toBe(true);
|
|
31
|
-
expect((0, v7Fsm_1.isProcessingSpendable)('proven')).toBe(true);
|
|
32
|
-
expect((0, v7Fsm_1.isProcessingSpendable)('queued')).toBe(false);
|
|
33
|
-
expect((0, v7Fsm_1.isProcessingSpendable)('invalid')).toBe(false);
|
|
34
|
-
});
|
|
35
|
-
test('isProcessingTerminal matches sdk constant', () => {
|
|
36
|
-
expect((0, v7Fsm_1.isProcessingTerminal)('proven')).toBe(true);
|
|
37
|
-
expect((0, v7Fsm_1.isProcessingTerminal)('invalid')).toBe(true);
|
|
38
|
-
expect((0, v7Fsm_1.isProcessingTerminal)('doubleSpend')).toBe(true);
|
|
39
|
-
expect((0, v7Fsm_1.isProcessingTerminal)('queued')).toBe(false);
|
|
40
|
-
});
|
|
41
|
-
});
|
|
42
|
-
//# sourceMappingURL=v7Fsm.test.js.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AAI,CAAC,CAAA;QACjD,MAAM,CAAC,IAAA,4BAAoB,EAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAClD,MAAM,CAAC,IAAA,4BAAoB,EAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QACtD,MAAM,CAAC,IAAA,4BAAoB,EAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IACpD,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"v7Spendability.test.d.ts","sourceRoot":"","sources":["../../../../../src/storage/schema/__tests/v7Spendability.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const v7Spendability_1 = require("../v7Spendability");
|
|
4
|
-
describe('v7Spendability', () => {
|
|
5
|
-
const tip = { height: 1000 };
|
|
6
|
-
test('non-spendable processing state rejects', () => {
|
|
7
|
-
expect((0, v7Spendability_1.isOutputSpendable)({ spentBy: null, lockingScript: [0x76] }, { processing: 'queued' }, tip)).toBe(false);
|
|
8
|
-
expect((0, v7Spendability_1.isOutputSpendable)({ spentBy: null, lockingScript: [0x76] }, { processing: 'invalid' }, tip)).toBe(false);
|
|
9
|
-
});
|
|
10
|
-
test('spent output rejects', () => {
|
|
11
|
-
expect((0, v7Spendability_1.isOutputSpendable)({ spentBy: 7, lockingScript: [0x76] }, { processing: 'proven' }, tip)).toBe(false);
|
|
12
|
-
});
|
|
13
|
-
test('missing locking script rejects', () => {
|
|
14
|
-
expect((0, v7Spendability_1.isOutputSpendable)({ spentBy: null, lockingScript: null }, { processing: 'proven' }, tip)).toBe(false);
|
|
15
|
-
});
|
|
16
|
-
test('immature coinbase rejects', () => {
|
|
17
|
-
expect((0, v7Spendability_1.isOutputSpendable)({ spentBy: null, lockingScript: [0x76], isCoinbase: true, maturesAtHeight: 1001 }, { processing: 'proven' }, tip)).toBe(false);
|
|
18
|
-
});
|
|
19
|
-
test('mature coinbase passes', () => {
|
|
20
|
-
expect((0, v7Spendability_1.isOutputSpendable)({ spentBy: null, lockingScript: [0x76], isCoinbase: true, maturesAtHeight: 1000 }, { processing: 'proven' }, tip)).toBe(true);
|
|
21
|
-
});
|
|
22
|
-
test('non-coinbase spendable in sent state', () => {
|
|
23
|
-
expect((0, v7Spendability_1.isOutputSpendable)({ spentBy: null, lockingScript: [0x76], isCoinbase: false }, { processing: 'sent' }, tip)).toBe(true);
|
|
24
|
-
});
|
|
25
|
-
test('coinbase without chain tip cannot mature', () => {
|
|
26
|
-
expect((0, v7Spendability_1.isOutputSpendable)({ spentBy: null, lockingScript: [0x76], isCoinbase: true, maturesAtHeight: 100 }, { processing: 'proven' }, undefined)).toBe(false);
|
|
27
|
-
});
|
|
28
|
-
});
|
|
29
|
-
//# sourceMappingURL=v7Spendability.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"v7Spendability.test.js","sourceRoot":"","sources":["../../../../../src/storage/schema/__tests/v7Spendability.test.ts"],"names":[],"mappings":";;AAAA,sDAAqD;AAErD,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC9B,MAAM,GAAG,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,CAAA;IAE5B,IAAI,CAAC,wCAAwC,EAAE,GAAG,EAAE;QAClD,MAAM,CACJ,IAAA,kCAAiB,EAAC,EAAE,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,GAAG,CAAC,CAC3F,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QACb,MAAM,CACJ,IAAA,kCAAiB,EAAC,EAAE,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC,IAAI,CAA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C,IAAI,CAAC,IAAI,CAAC,CAAA;IACd,CAAC,CAAC,CAAA;IAEF,IAAI,CAAC,sCAAsC,EAAE,GAAG,EAAE;QAChD,MAAM,CACJ,IAAA,kCAAiB,EACf,EAAE,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC,IAAI,CAAC,EAAE,UAAU,EAAE,KAAK,EAAE,EAC3D,EAAE,UAAU,EAAE,MAAM,EAAE,EACtB,GAAG,CACJ,CACF,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACd,CAAC,CAAC,CAAA;IAEF,IAAI,CAAC,0CAA0C,EAAE,GAAG,EAAE;QACpD,MAAM,CACJ,IAAA,kCAAiB,EACf,EAAE,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC,IAAI,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,eAAe,EAAE,GAAG,EAAE,EAChF,EAAE,UAAU,EAAE,QAAQ,EAAE,EACxB,SAAS,CACV,CACF,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IACf,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import * as sdk from '../../../sdk';
|
|
2
|
-
/**
|
|
3
|
-
* V7 per-user view of a transaction.
|
|
4
|
-
*
|
|
5
|
-
* Migrated from the legacy `transactions` table. Holds everything that is truly
|
|
6
|
-
* per-user (description, labels via tx_labels_map -> actionId, soft-delete flags,
|
|
7
|
-
* notification subscribers). All on-chain status lives in the V7 `transactions`
|
|
8
|
-
* table addressed by `transactionId`.
|
|
9
|
-
*
|
|
10
|
-
* UNIQUE(userId, transactionId).
|
|
11
|
-
*/
|
|
12
|
-
export interface TableAction extends sdk.EntityTimeStamp {
|
|
13
|
-
created_at: Date;
|
|
14
|
-
updated_at: Date;
|
|
15
|
-
/** PK */
|
|
16
|
-
actionId: number;
|
|
17
|
-
userId: number;
|
|
18
|
-
/** FK -> V7 transactions.transactionId (per-txid record) */
|
|
19
|
-
transactionId: number;
|
|
20
|
-
/** Application reference, hex/Base64, max 64 chars */
|
|
21
|
-
reference: string;
|
|
22
|
-
description: string;
|
|
23
|
-
/** true if originated in this wallet (change returns to it) */
|
|
24
|
-
isOutgoing: boolean;
|
|
25
|
-
/** Signed net change to this user's balance from this action */
|
|
26
|
-
satoshisDelta: number;
|
|
27
|
-
/** Per-user nosend override */
|
|
28
|
-
userNosend: boolean;
|
|
29
|
-
/** Soft-delete flag — hide from default queries */
|
|
30
|
-
hidden: boolean;
|
|
31
|
-
/** Per-user abort flag */
|
|
32
|
-
userAborted: boolean;
|
|
33
|
-
/** JSON string of per-user notification subscribers (mirrors legacy notify) */
|
|
34
|
-
notifyJson?: string;
|
|
35
|
-
/** Optimistic concurrency token */
|
|
36
|
-
rowVersion: number;
|
|
37
|
-
}
|
|
38
|
-
//# sourceMappingURL=TableAction.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TableAction.d.ts","sourceRoot":"","sources":["../../../../../src/storage/schema/tables/TableAction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,cAAc,CAAA;AAEnC;;;;;;;;;GASG;AACH,MAAM,WAAW,WAAY,SAAQ,GAAG,CAAC,eAAe;IACtD,UAAU,EAAE,IAAI,CAAA;IAChB,UAAU,EAAE,IAAI,CAAA;IAChB,SAAS;IACT,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;IACd,4DAA4D;IAC5D,aAAa,EAAE,MAAM,CAAA;IACrB,sDAAsD;IACtD,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,MAAM,CAAA;IACnB,+DAA+D;IAC/D,UAAU,EAAE,OAAO,CAAA;IACnB,gEAAgE;IAChE,aAAa,EAAE,MAAM,CAAA;IACrB,+BAA+B;IAC/B,UAAU,EAAE,OAAO,CAAA;IACnB,mDAAmD;IACnD,MAAM,EAAE,OAAO,CAAA;IACf,0BAA0B;IAC1B,WAAW,EAAE,OAAO,CAAA;IACpB,+EAA+E;IAC/E,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,mCAAmC;IACnC,UAAU,EAAE,MAAM,CAAA;CACnB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TableAction.js","sourceRoot":"","sources":["../../../../../src/storage/schema/tables/TableAction.ts"],"names":[],"mappings":""}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import * as sdk from '../../../sdk';
|
|
2
|
-
/**
|
|
3
|
-
* V7 singleton row tracking the most recently observed chain tip.
|
|
4
|
-
* Used by spendability checks and coinbase maturity calculations.
|
|
5
|
-
*/
|
|
6
|
-
export interface TableChainTip extends sdk.EntityTimeStamp {
|
|
7
|
-
created_at: Date;
|
|
8
|
-
updated_at: Date;
|
|
9
|
-
/** Always 1 — singleton enforced by storage layer */
|
|
10
|
-
id: number;
|
|
11
|
-
height: number;
|
|
12
|
-
blockHash: string;
|
|
13
|
-
merkleRoot?: string;
|
|
14
|
-
/** Wall-clock of the observation */
|
|
15
|
-
observedAt: Date;
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=TableChainTip.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TableChainTip.d.ts","sourceRoot":"","sources":["../../../../../src/storage/schema/tables/TableChainTip.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,cAAc,CAAA;AAEnC;;;GAGG;AACH,MAAM,WAAW,aAAc,SAAQ,GAAG,CAAC,eAAe;IACxD,UAAU,EAAE,IAAI,CAAA;IAChB,UAAU,EAAE,IAAI,CAAA;IAChB,qDAAqD;IACrD,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,oCAAoC;IACpC,UAAU,EAAE,IAAI,CAAA;CACjB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TableChainTip.js","sourceRoot":"","sources":["../../../../../src/storage/schema/tables/TableChainTip.ts"],"names":[],"mappings":""}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import * as sdk from '../../../sdk';
|
|
2
|
-
/**
|
|
3
|
-
* V7 lease record so at most one Monitor daemon owns a given task at a time.
|
|
4
|
-
*
|
|
5
|
-
* The Monitor acquires a lease by upserting `(taskName, ownerId, expiresAt)`
|
|
6
|
-
* and renews periodically. Stale leases (`expiresAt < now`) may be claimed by
|
|
7
|
-
* another instance.
|
|
8
|
-
*/
|
|
9
|
-
export interface TableMonitorLease extends sdk.EntityTimeStamp {
|
|
10
|
-
created_at: Date;
|
|
11
|
-
updated_at: Date;
|
|
12
|
-
/** Logical task name, e.g. 'proof-acquisition' */
|
|
13
|
-
taskName: string;
|
|
14
|
-
/** Stable identifier for the owning Monitor instance */
|
|
15
|
-
ownerId: string;
|
|
16
|
-
/** Lease expiry — claimants treat any row with expiresAt <= now() as free */
|
|
17
|
-
expiresAt: Date;
|
|
18
|
-
/** Monotonic counter incremented on each successful renew */
|
|
19
|
-
renewCount: number;
|
|
20
|
-
/** Optional free-text description of current activity */
|
|
21
|
-
note?: string;
|
|
22
|
-
}
|
|
23
|
-
//# sourceMappingURL=TableMonitorLease.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TableMonitorLease.d.ts","sourceRoot":"","sources":["../../../../../src/storage/schema/tables/TableMonitorLease.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,cAAc,CAAA;AAEnC;;;;;;GAMG;AACH,MAAM,WAAW,iBAAkB,SAAQ,GAAG,CAAC,eAAe;IAC5D,UAAU,EAAE,IAAI,CAAA;IAChB,UAAU,EAAE,IAAI,CAAA;IAChB,kDAAkD;IAClD,QAAQ,EAAE,MAAM,CAAA;IAChB,wDAAwD;IACxD,OAAO,EAAE,MAAM,CAAA;IACf,6EAA6E;IAC7E,SAAS,EAAE,IAAI,CAAA;IACf,6DAA6D;IAC7D,UAAU,EAAE,MAAM,CAAA;IAClB,yDAAyD;IACzD,IAAI,CAAC,EAAE,MAAM,CAAA;CACd"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TableMonitorLease.js","sourceRoot":"","sources":["../../../../../src/storage/schema/tables/TableMonitorLease.ts"],"names":[],"mappings":""}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import * as sdk from '../../../sdk';
|
|
2
|
-
/**
|
|
3
|
-
* V7 canonical per-txid table.
|
|
4
|
-
*
|
|
5
|
-
* Single source of truth for everything about a transaction on the network.
|
|
6
|
-
* Merges the legacy `proven_tx_reqs` (broadcast queue + processing state) and
|
|
7
|
-
* `proven_txs` (final Merkle proof) tables into one row per txid.
|
|
8
|
-
*
|
|
9
|
-
* Per-user metadata (description, labels, hidden, etc.) lives in `actions`.
|
|
10
|
-
*/
|
|
11
|
-
export interface TableTransactionV7 extends sdk.EntityTimeStamp {
|
|
12
|
-
created_at: Date;
|
|
13
|
-
updated_at: Date;
|
|
14
|
-
/** PK */
|
|
15
|
-
transactionId: number;
|
|
16
|
-
/** UNIQUE — Bitcoin txid, hex */
|
|
17
|
-
txid: string;
|
|
18
|
-
/** Granular FSM state (see ProcessingStatus) */
|
|
19
|
-
processing: sdk.ProcessingStatus;
|
|
20
|
-
/** Wall-clock of the most recent processing transition */
|
|
21
|
-
processingChangedAt: Date;
|
|
22
|
-
/** Wall-clock at which the next monitor pass should consider this row */
|
|
23
|
-
nextActionAt?: Date;
|
|
24
|
-
/** Cumulative network-service attempt count */
|
|
25
|
-
attempts: number;
|
|
26
|
-
/** Count of times this row has been reset for rebroadcast (circuit-breaker) */
|
|
27
|
-
rebroadcastCycles: number;
|
|
28
|
-
/** true once the row has reached a state implying successful broadcast */
|
|
29
|
-
wasBroadcast: boolean;
|
|
30
|
-
/** Application-supplied idempotency key (unique when present) */
|
|
31
|
-
idempotencyKey?: string;
|
|
32
|
-
/** Optional batch tag for grouped broadcast */
|
|
33
|
-
batch?: string;
|
|
34
|
-
rawTx?: number[];
|
|
35
|
-
inputBeef?: number[];
|
|
36
|
-
/** Merkle proof fields — populated on transition to `proven` */
|
|
37
|
-
height?: number;
|
|
38
|
-
merkleIndex?: number;
|
|
39
|
-
merklePath?: number[];
|
|
40
|
-
merkleRoot?: string;
|
|
41
|
-
blockHash?: string;
|
|
42
|
-
isCoinbase: boolean;
|
|
43
|
-
lastProvider?: string;
|
|
44
|
-
lastProviderStatus?: string;
|
|
45
|
-
/** Reason a row is in `frozen` state, free text */
|
|
46
|
-
frozenReason?: string;
|
|
47
|
-
/** Optimistic concurrency token */
|
|
48
|
-
rowVersion: number;
|
|
49
|
-
}
|
|
50
|
-
//# sourceMappingURL=TableTransactionV7.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TableTransactionV7.d.ts","sourceRoot":"","sources":["../../../../../src/storage/schema/tables/TableTransactionV7.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,cAAc,CAAA;AAEnC;;;;;;;;GAQG;AACH,MAAM,WAAW,kBAAmB,SAAQ,GAAG,CAAC,eAAe;IAC7D,UAAU,EAAE,IAAI,CAAA;IAChB,UAAU,EAAE,IAAI,CAAA;IAChB,SAAS;IACT,aAAa,EAAE,MAAM,CAAA;IACrB,iCAAiC;IACjC,IAAI,EAAE,MAAM,CAAA;IACZ,gDAAgD;IAChD,UAAU,EAAE,GAAG,CAAC,gBAAgB,CAAA;IAChC,0DAA0D;IAC1D,mBAAmB,EAAE,IAAI,CAAA;IACzB,yEAAyE;IACzE,YAAY,CAAC,EAAE,IAAI,CAAA;IACnB,+CAA+C;IAC/C,QAAQ,EAAE,MAAM,CAAA;IAChB,+EAA+E;IAC/E,iBAAiB,EAAE,MAAM,CAAA;IACzB,0EAA0E;IAC1E,YAAY,EAAE,OAAO,CAAA;IACrB,iEAAiE;IACjE,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,+CAA+C;IAC/C,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;IAChB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAA;IACpB,gEAAgE;IAChE,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;IACrB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,OAAO,CAAA;IACnB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,mDAAmD;IACnD,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,mCAAmC;IACnC,UAAU,EAAE,MAAM,CAAA;CACnB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TableTransactionV7.js","sourceRoot":"","sources":["../../../../../src/storage/schema/tables/TableTransactionV7.ts"],"names":[],"mappings":""}
|