@bsv/wallet-toolbox-client 2.1.25 → 3.0.0-alpha.0

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.
Files changed (146) hide show
  1. package/out/src/Wallet.d.ts.map +1 -1
  2. package/out/src/Wallet.js.map +1 -1
  3. package/out/src/WalletLogger.d.ts.map +1 -1
  4. package/out/src/WalletLogger.js.map +1 -1
  5. package/out/src/monitor/LeasedMonitorTask.d.ts +43 -0
  6. package/out/src/monitor/LeasedMonitorTask.d.ts.map +1 -0
  7. package/out/src/monitor/LeasedMonitorTask.js +89 -0
  8. package/out/src/monitor/LeasedMonitorTask.js.map +1 -0
  9. package/out/src/monitor/Monitor.d.ts +7 -0
  10. package/out/src/monitor/Monitor.d.ts.map +1 -1
  11. package/out/src/monitor/Monitor.js +7 -0
  12. package/out/src/monitor/Monitor.js.map +1 -1
  13. package/out/src/monitor/V7LeasedTask.d.ts +43 -0
  14. package/out/src/monitor/V7LeasedTask.d.ts.map +1 -0
  15. package/out/src/monitor/V7LeasedTask.js +89 -0
  16. package/out/src/monitor/V7LeasedTask.js.map +1 -0
  17. package/out/src/monitor/tasks/TaskCheckForProofs.d.ts +2 -0
  18. package/out/src/monitor/tasks/TaskCheckForProofs.d.ts.map +1 -1
  19. package/out/src/monitor/tasks/TaskCheckForProofs.js +55 -0
  20. package/out/src/monitor/tasks/TaskCheckForProofs.js.map +1 -1
  21. package/out/src/monitor/tasks/TaskSendWaiting.d.ts.map +1 -1
  22. package/out/src/monitor/tasks/TaskSendWaiting.js.map +1 -1
  23. package/out/src/sdk/WalletStorage.interfaces.d.ts +59 -59
  24. package/out/src/sdk/WalletStorage.interfaces.d.ts.map +1 -1
  25. package/out/src/sdk/types.d.ts +32 -0
  26. package/out/src/sdk/types.d.ts.map +1 -1
  27. package/out/src/sdk/types.js +50 -1
  28. package/out/src/sdk/types.js.map +1 -1
  29. package/out/src/services/chaintracker/chaintracks/Ingest/LiveIngestorWhatsOnChainPoll.d.ts.map +1 -1
  30. package/out/src/services/chaintracker/chaintracks/Ingest/LiveIngestorWhatsOnChainPoll.js.map +1 -1
  31. package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageBase.d.ts.map +1 -1
  32. package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageBase.js.map +1 -1
  33. package/out/src/services/chaintracker/chaintracks/createDefaultIdbChaintracksOptions.d.ts.map +1 -1
  34. package/out/src/services/chaintracker/chaintracks/createDefaultIdbChaintracksOptions.js.map +1 -1
  35. package/out/src/services/chaintracker/chaintracks/createDefaultNoDbChaintracksOptions.d.ts.map +1 -1
  36. package/out/src/services/chaintracker/chaintracks/createDefaultNoDbChaintracksOptions.js.map +1 -1
  37. package/out/src/services/chaintracker/chaintracks/createIdbChaintracks.d.ts.map +1 -1
  38. package/out/src/services/chaintracker/chaintracks/createIdbChaintracks.js.map +1 -1
  39. package/out/src/services/chaintracker/chaintracks/createNoDbChaintracks.d.ts.map +1 -1
  40. package/out/src/services/chaintracker/chaintracks/createNoDbChaintracks.js.map +1 -1
  41. package/out/src/services/chaintracker/chaintracks/util/BulkFilesReader.d.ts.map +1 -1
  42. package/out/src/services/chaintracker/chaintracks/util/BulkFilesReader.js.map +1 -1
  43. package/out/src/services/chaintracker/chaintracks/util/SingleWriterMultiReaderLock.d.ts.map +1 -1
  44. package/out/src/services/chaintracker/chaintracks/util/SingleWriterMultiReaderLock.js.map +1 -1
  45. package/out/src/storage/StorageIdb.d.ts.map +1 -1
  46. package/out/src/storage/StorageIdb.js +10 -5
  47. package/out/src/storage/StorageIdb.js.map +1 -1
  48. package/out/src/storage/StorageProvider.d.ts +114 -1
  49. package/out/src/storage/StorageProvider.d.ts.map +1 -1
  50. package/out/src/storage/StorageProvider.js +164 -4
  51. package/out/src/storage/StorageProvider.js.map +1 -1
  52. package/out/src/storage/WalletStorageManager.d.ts.map +1 -1
  53. package/out/src/storage/WalletStorageManager.js.map +1 -1
  54. package/out/src/storage/idbHelpers.d.ts +5 -0
  55. package/out/src/storage/idbHelpers.d.ts.map +1 -1
  56. package/out/src/storage/idbHelpers.js +42 -0
  57. package/out/src/storage/idbHelpers.js.map +1 -1
  58. package/out/src/storage/methods/attemptToPostReqsToNetwork.d.ts.map +1 -1
  59. package/out/src/storage/methods/attemptToPostReqsToNetwork.js +116 -4
  60. package/out/src/storage/methods/attemptToPostReqsToNetwork.js.map +1 -1
  61. package/out/src/storage/methods/createAction.d.ts.map +1 -1
  62. package/out/src/storage/methods/createAction.js +22 -5
  63. package/out/src/storage/methods/createAction.js.map +1 -1
  64. package/out/src/storage/methods/internalizeAction.d.ts.map +1 -1
  65. package/out/src/storage/methods/internalizeAction.js +172 -5
  66. package/out/src/storage/methods/internalizeAction.js.map +1 -1
  67. package/out/src/storage/methods/processAction.d.ts.map +1 -1
  68. package/out/src/storage/methods/processAction.js +82 -14
  69. package/out/src/storage/methods/processAction.js.map +1 -1
  70. package/out/src/storage/schema/StorageIdbSchema.d.ts +43 -2
  71. package/out/src/storage/schema/StorageIdbSchema.d.ts.map +1 -1
  72. package/out/src/storage/schema/monitorLease.d.ts +57 -0
  73. package/out/src/storage/schema/monitorLease.d.ts.map +1 -0
  74. package/out/src/storage/schema/monitorLease.js +101 -0
  75. package/out/src/storage/schema/monitorLease.js.map +1 -0
  76. package/out/src/storage/schema/processingFsm.d.ts +27 -0
  77. package/out/src/storage/schema/processingFsm.d.ts.map +1 -0
  78. package/out/src/storage/schema/processingFsm.js +132 -0
  79. package/out/src/storage/schema/processingFsm.js.map +1 -0
  80. package/out/src/storage/schema/tables/TableAction.d.ts +38 -0
  81. package/out/src/storage/schema/tables/TableAction.d.ts.map +1 -0
  82. package/out/src/storage/schema/tables/TableAction.js +3 -0
  83. package/out/src/storage/schema/tables/TableAction.js.map +1 -0
  84. package/out/src/storage/schema/tables/TableChainTip.d.ts +17 -0
  85. package/out/src/storage/schema/tables/TableChainTip.d.ts.map +1 -0
  86. package/out/src/storage/schema/tables/TableChainTip.js +3 -0
  87. package/out/src/storage/schema/tables/TableChainTip.js.map +1 -0
  88. package/out/src/storage/schema/tables/TableMonitorLease.d.ts +23 -0
  89. package/out/src/storage/schema/tables/TableMonitorLease.d.ts.map +1 -0
  90. package/out/src/storage/schema/tables/TableMonitorLease.js +3 -0
  91. package/out/src/storage/schema/tables/TableMonitorLease.js.map +1 -0
  92. package/out/src/storage/schema/tables/TableOutput.d.ts +7 -0
  93. package/out/src/storage/schema/tables/TableOutput.d.ts.map +1 -1
  94. package/out/src/storage/schema/tables/TableOutput.js.map +1 -1
  95. package/out/src/storage/schema/tables/TableTransactionNew.d.ts +50 -0
  96. package/out/src/storage/schema/tables/TableTransactionNew.d.ts.map +1 -0
  97. package/out/src/storage/schema/tables/TableTransactionNew.js +3 -0
  98. package/out/src/storage/schema/tables/TableTransactionNew.js.map +1 -0
  99. package/out/src/storage/schema/tables/TableTransactionV7.d.ts +50 -0
  100. package/out/src/storage/schema/tables/TableTransactionV7.d.ts.map +1 -0
  101. package/out/src/storage/schema/tables/TableTransactionV7.js +3 -0
  102. package/out/src/storage/schema/tables/TableTransactionV7.js.map +1 -0
  103. package/out/src/storage/schema/tables/TableTxAudit.d.ts +26 -0
  104. package/out/src/storage/schema/tables/TableTxAudit.d.ts.map +1 -0
  105. package/out/src/storage/schema/tables/TableTxAudit.js +3 -0
  106. package/out/src/storage/schema/tables/TableTxAudit.js.map +1 -0
  107. package/out/src/storage/schema/tables/index.d.ts +5 -0
  108. package/out/src/storage/schema/tables/index.d.ts.map +1 -1
  109. package/out/src/storage/schema/tables/index.js +5 -0
  110. package/out/src/storage/schema/tables/index.js.map +1 -1
  111. package/out/src/storage/schema/transactionCrud.d.ts +41 -0
  112. package/out/src/storage/schema/transactionCrud.d.ts.map +1 -0
  113. package/out/src/storage/schema/transactionCrud.js +205 -0
  114. package/out/src/storage/schema/transactionCrud.js.map +1 -0
  115. package/out/src/storage/schema/transactionService.d.ts +315 -0
  116. package/out/src/storage/schema/transactionService.d.ts.map +1 -0
  117. package/out/src/storage/schema/transactionService.js +783 -0
  118. package/out/src/storage/schema/transactionService.js.map +1 -0
  119. package/out/src/storage/schema/txAudit.d.ts +33 -0
  120. package/out/src/storage/schema/txAudit.d.ts.map +1 -0
  121. package/out/src/storage/schema/txAudit.js +64 -0
  122. package/out/src/storage/schema/txAudit.js.map +1 -0
  123. package/out/src/storage/schema/v7Crud.d.ts +41 -0
  124. package/out/src/storage/schema/v7Crud.d.ts.map +1 -0
  125. package/out/src/storage/schema/v7Crud.js +205 -0
  126. package/out/src/storage/schema/v7Crud.js.map +1 -0
  127. package/out/src/storage/schema/v7Fsm.d.ts +27 -0
  128. package/out/src/storage/schema/v7Fsm.d.ts.map +1 -0
  129. package/out/src/storage/schema/v7Fsm.js +124 -0
  130. package/out/src/storage/schema/v7Fsm.js.map +1 -0
  131. package/out/src/storage/schema/v7MonitorLease.d.ts +57 -0
  132. package/out/src/storage/schema/v7MonitorLease.d.ts.map +1 -0
  133. package/out/src/storage/schema/v7MonitorLease.js +101 -0
  134. package/out/src/storage/schema/v7MonitorLease.js.map +1 -0
  135. package/out/src/storage/schema/v7Service.d.ts +305 -0
  136. package/out/src/storage/schema/v7Service.d.ts.map +1 -0
  137. package/out/src/storage/schema/v7Service.js +757 -0
  138. package/out/src/storage/schema/v7Service.js.map +1 -0
  139. package/out/src/storage/schema/v7TxAudit.d.ts +33 -0
  140. package/out/src/storage/schema/v7TxAudit.d.ts.map +1 -0
  141. package/out/src/storage/schema/v7TxAudit.js +64 -0
  142. package/out/src/storage/schema/v7TxAudit.js.map +1 -0
  143. package/out/src/storage/storageProviderHelpers.js +1 -1
  144. package/out/src/storage/storageProviderHelpers.js.map +1 -1
  145. package/out/tsconfig.client.tsbuildinfo +1 -1
  146. package/package.json +1 -1
@@ -0,0 +1,57 @@
1
+ import { Knex } from 'knex';
2
+ import { TableMonitorLease } from './tables';
3
+ /**
4
+ * V7 monitor lease primitive.
5
+ *
6
+ * A `monitor_lease` row records the owner that may currently execute a named
7
+ * task. Acquisition is opportunistic: a Monitor calls `tryClaimLease()` to
8
+ * insert or take over a stale row; if it succeeds it owns the task until
9
+ * `expiresAt`. While running it calls `renewLease()` to extend the deadline.
10
+ * On clean shutdown it calls `releaseLease()`.
11
+ *
12
+ * The Knex driver expresses claim + takeover as a single conditional UPDATE
13
+ * so that two contending Monitors cannot both believe they own the task — at
14
+ * most one row write will succeed per (task, expiry) pair.
15
+ */
16
+ export interface MonitorLeaseClaim {
17
+ taskName: string;
18
+ ownerId: string;
19
+ ttlMs: number;
20
+ note?: string;
21
+ }
22
+ export interface MonitorLeaseRenew {
23
+ taskName: string;
24
+ ownerId: string;
25
+ ttlMs: number;
26
+ note?: string;
27
+ }
28
+ export interface MonitorLeaseRelease {
29
+ taskName: string;
30
+ ownerId: string;
31
+ }
32
+ export interface MonitorLeaseResult {
33
+ acquired: boolean;
34
+ lease?: TableMonitorLease;
35
+ }
36
+ /**
37
+ * Try to claim a lease on `taskName`. Succeeds iff:
38
+ * - no row exists for the task, OR
39
+ * - the existing row has `expiresAt <= now`, OR
40
+ * - the existing row's `ownerId` already equals the requested owner.
41
+ *
42
+ * On success the row is upserted with `expiresAt = now + ttlMs` and
43
+ * `renewCount = renewCount + 1` (0 for fresh rows).
44
+ */
45
+ export declare function tryClaimLease(knex: Knex, claim: MonitorLeaseClaim, now?: Date): Promise<MonitorLeaseResult>;
46
+ /**
47
+ * Extend the current owner's lease. Fails (returns `acquired: false`) when the
48
+ * row does not exist, is owned by someone else, or has already expired.
49
+ */
50
+ export declare function renewLease(knex: Knex, renew: MonitorLeaseRenew, now?: Date): Promise<MonitorLeaseResult>;
51
+ /**
52
+ * Release the lease (no-op when not owned by the caller).
53
+ * The row is deleted so subsequent claimants do not see an inherited
54
+ * `renew_count`.
55
+ */
56
+ export declare function releaseLease(knex: Knex, release: MonitorLeaseRelease): Promise<boolean>;
57
+ //# sourceMappingURL=v7MonitorLease.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"v7MonitorLease.d.ts","sourceRoot":"","sources":["../../../../../src/storage/schema/v7MonitorLease.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAE5C;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,OAAO,CAAA;IACjB,KAAK,CAAC,EAAE,iBAAiB,CAAA;CAC1B;AAED;;;;;;;;GAQG;AACH,wBAAsB,aAAa,CACjC,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,iBAAiB,EACxB,GAAG,GAAE,IAAiB,GACrB,OAAO,CAAC,kBAAkB,CAAC,CAmC7B;AAED;;;GAGG;AACH,wBAAsB,UAAU,CAC9B,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,iBAAiB,EACxB,GAAG,GAAE,IAAiB,GACrB,OAAO,CAAC,kBAAkB,CAAC,CAkB7B;AAED;;;;GAIG;AACH,wBAAsB,YAAY,CAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,OAAO,CAAC,CAK9F"}
@@ -0,0 +1,101 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.tryClaimLease = tryClaimLease;
4
+ exports.renewLease = renewLease;
5
+ exports.releaseLease = releaseLease;
6
+ /**
7
+ * Try to claim a lease on `taskName`. Succeeds iff:
8
+ * - no row exists for the task, OR
9
+ * - the existing row has `expiresAt <= now`, OR
10
+ * - the existing row's `ownerId` already equals the requested owner.
11
+ *
12
+ * On success the row is upserted with `expiresAt = now + ttlMs` and
13
+ * `renewCount = renewCount + 1` (0 for fresh rows).
14
+ */
15
+ async function tryClaimLease(knex, claim, now = new Date()) {
16
+ const expiresAt = new Date(now.getTime() + claim.ttlMs);
17
+ return await knex.transaction(async (trx) => {
18
+ var _a, _b;
19
+ const existing = await trx('monitor_lease').where({ task_name: claim.taskName }).forUpdate().first();
20
+ const canClaim = existing == null ||
21
+ new Date(existing.expires_at).getTime() <= now.getTime() ||
22
+ existing.owner_id === claim.ownerId;
23
+ if (!canClaim)
24
+ return { acquired: false };
25
+ if (existing == null) {
26
+ await trx('monitor_lease').insert({
27
+ task_name: claim.taskName,
28
+ owner_id: claim.ownerId,
29
+ expires_at: expiresAt,
30
+ renew_count: 0,
31
+ note: (_a = claim.note) !== null && _a !== void 0 ? _a : null,
32
+ created_at: now,
33
+ updated_at: now
34
+ });
35
+ }
36
+ else {
37
+ await trx('monitor_lease')
38
+ .where({ task_name: claim.taskName })
39
+ .update({
40
+ owner_id: claim.ownerId,
41
+ expires_at: expiresAt,
42
+ renew_count: existing.owner_id === claim.ownerId ? existing.renew_count + 1 : 0,
43
+ note: (_b = claim.note) !== null && _b !== void 0 ? _b : existing.note,
44
+ updated_at: now
45
+ });
46
+ }
47
+ const row = await trx('monitor_lease').where({ task_name: claim.taskName }).first();
48
+ return { acquired: true, lease: mapRow(row) };
49
+ });
50
+ }
51
+ /**
52
+ * Extend the current owner's lease. Fails (returns `acquired: false`) when the
53
+ * row does not exist, is owned by someone else, or has already expired.
54
+ */
55
+ async function renewLease(knex, renew, now = new Date()) {
56
+ const expiresAt = new Date(now.getTime() + renew.ttlMs);
57
+ return await knex.transaction(async (trx) => {
58
+ var _a;
59
+ const existing = await trx('monitor_lease').where({ task_name: renew.taskName }).forUpdate().first();
60
+ if (existing == null)
61
+ return { acquired: false };
62
+ if (existing.owner_id !== renew.ownerId)
63
+ return { acquired: false };
64
+ if (new Date(existing.expires_at).getTime() <= now.getTime())
65
+ return { acquired: false };
66
+ await trx('monitor_lease')
67
+ .where({ task_name: renew.taskName })
68
+ .update({
69
+ expires_at: expiresAt,
70
+ renew_count: existing.renew_count + 1,
71
+ note: (_a = renew.note) !== null && _a !== void 0 ? _a : existing.note,
72
+ updated_at: now
73
+ });
74
+ const row = await trx('monitor_lease').where({ task_name: renew.taskName }).first();
75
+ return { acquired: true, lease: mapRow(row) };
76
+ });
77
+ }
78
+ /**
79
+ * Release the lease (no-op when not owned by the caller).
80
+ * The row is deleted so subsequent claimants do not see an inherited
81
+ * `renew_count`.
82
+ */
83
+ async function releaseLease(knex, release) {
84
+ const deleted = await knex('monitor_lease')
85
+ .where({ task_name: release.taskName, owner_id: release.ownerId })
86
+ .delete();
87
+ return deleted > 0;
88
+ }
89
+ function mapRow(row) {
90
+ var _a;
91
+ return {
92
+ created_at: new Date(row.created_at),
93
+ updated_at: new Date(row.updated_at),
94
+ taskName: row.task_name,
95
+ ownerId: row.owner_id,
96
+ expiresAt: new Date(row.expires_at),
97
+ renewCount: row.renew_count,
98
+ note: (_a = row.note) !== null && _a !== void 0 ? _a : undefined
99
+ };
100
+ }
101
+ //# sourceMappingURL=v7MonitorLease.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"v7MonitorLease.js","sourceRoot":"","sources":["../../../../../src/storage/schema/v7MonitorLease.ts"],"names":[],"mappings":";;AAiDA,sCAuCC;AAMD,gCAsBC;AAOD,oCAKC;AAxFD;;;;;;;;GAQG;AACI,KAAK,UAAU,aAAa,CACjC,IAAU,EACV,KAAwB,EACxB,MAAY,IAAI,IAAI,EAAE;IAEtB,MAAM,SAAS,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,KAAK,C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0 +1,305 @@
1
+ import { Beef } from '@bsv/sdk';
2
+ import { Knex } from 'knex';
3
+ import * as sdk from '../../sdk';
4
+ import { TableAction, TableOutput, TableTransactionV7 } from './tables';
5
+ import { MonitorLeaseClaim, MonitorLeaseRelease, MonitorLeaseRenew, MonitorLeaseResult } from './v7MonitorLease';
6
+ /**
7
+ * High-level service over the V7 storage primitives.
8
+ *
9
+ * Storage methods and the Monitor call into this surface rather than the
10
+ * lower-level CRUD/FSM/audit/lease modules so that:
11
+ * - Every processing transition is audited.
12
+ * - Optimistic concurrency is uniformly enforced.
13
+ * - Chain tip + monitor lease access have one canonical entry point.
14
+ *
15
+ * Construction takes a Knex handle; instances are stateless and cheap to
16
+ * create — typically one per request or per Monitor task tick.
17
+ */
18
+ export declare class V7TransactionService {
19
+ private readonly knex;
20
+ constructor(knex: Knex);
21
+ findByTxid(txid: string): Promise<TableTransactionV7 | undefined>;
22
+ findById(transactionId: number): Promise<TableTransactionV7 | undefined>;
23
+ /**
24
+ * Insert a new V7 transaction row. The row is created in `queued` state
25
+ * unless the caller overrides `processing`.
26
+ */
27
+ create(args: {
28
+ txid: string;
29
+ processing?: sdk.ProcessingStatus;
30
+ rawTx?: number[];
31
+ inputBeef?: number[];
32
+ batch?: string;
33
+ idempotencyKey?: string;
34
+ isCoinbase?: boolean;
35
+ now?: Date;
36
+ }): Promise<TableTransactionV7>;
37
+ /**
38
+ * Transition processing state with optimistic concurrency. Returns
39
+ * `undefined` when the FSM rejects the move OR the row's current state no
40
+ * longer matches `expectedFrom`.
41
+ */
42
+ transition(args: {
43
+ transactionId: number;
44
+ expectedFrom: sdk.ProcessingStatus;
45
+ to: sdk.ProcessingStatus;
46
+ provider?: string;
47
+ providerStatus?: string;
48
+ details?: Record<string, unknown>;
49
+ now?: Date;
50
+ }): Promise<TableTransactionV7 | undefined>;
51
+ /**
52
+ * Record acquisition of a Merkle proof for a transaction. Atomically:
53
+ * - Updates proof columns (height, index, merkle_path, merkle_root, block_hash)
54
+ * - Transitions processing to `proven` from any spendable-class state.
55
+ * - Writes a `proof.acquired` audit row.
56
+ */
57
+ recordProof(args: {
58
+ transactionId: number;
59
+ height: number;
60
+ merkleIndex: number;
61
+ merklePath: number[];
62
+ merkleRoot: string;
63
+ blockHash: string;
64
+ expectedFrom: sdk.ProcessingStatus;
65
+ now?: Date;
66
+ }): Promise<TableTransactionV7 | undefined>;
67
+ findActionForUser(userId: number, transactionId: number): Promise<TableAction | undefined>;
68
+ createAction(args: {
69
+ userId: number;
70
+ transactionId: number;
71
+ reference: string;
72
+ description: string;
73
+ isOutgoing: boolean;
74
+ satoshisDelta: number;
75
+ userNosend?: boolean;
76
+ notifyJson?: string;
77
+ now?: Date;
78
+ }): Promise<number>;
79
+ getChainTip(): Promise<{
80
+ height: number;
81
+ blockHash: string;
82
+ } | undefined>;
83
+ setChainTip(args: {
84
+ height: number;
85
+ blockHash: string;
86
+ merkleRoot?: string;
87
+ now?: Date;
88
+ }): Promise<void>;
89
+ tryClaimLease(claim: MonitorLeaseClaim, now?: Date): Promise<MonitorLeaseResult>;
90
+ renewLease(renew: MonitorLeaseRenew, now?: Date): Promise<MonitorLeaseResult>;
91
+ releaseLease(release: MonitorLeaseRelease): Promise<boolean>;
92
+ /**
93
+ * #1 — Look up an action + its backing transaction by (userId, reference).
94
+ */
95
+ findActionByReference(userId: number, reference: string): Promise<{
96
+ action: TableAction;
97
+ transaction: TableTransactionV7;
98
+ } | undefined>;
99
+ /**
100
+ * #2 — Look up an action + its backing transaction by (userId, txid).
101
+ */
102
+ findActionByUserTxid(userId: number, txid: string): Promise<{
103
+ action: TableAction;
104
+ transaction: TableTransactionV7;
105
+ } | undefined>;
106
+ /**
107
+ * #3 — Upsert: find existing action for (userId, txid) or create both the V7
108
+ * transaction row and the action row.
109
+ */
110
+ findOrCreateActionForTxid(args: {
111
+ userId: number;
112
+ txid: string;
113
+ isOutgoing: boolean;
114
+ description: string;
115
+ satoshisDelta: number;
116
+ reference: string;
117
+ rawTx?: number[];
118
+ inputBeef?: number[];
119
+ processing?: sdk.ProcessingStatus;
120
+ now?: Date;
121
+ }): Promise<{
122
+ action: TableAction;
123
+ transaction: TableTransactionV7;
124
+ isNew: boolean;
125
+ }>;
126
+ /**
127
+ * #4 — Atomically update the satoshisDelta column on an action row.
128
+ */
129
+ updateActionSatoshisDelta(actionId: number, delta: number, now?: Date): Promise<void>;
130
+ /**
131
+ * #5 — Create a V7 transaction row already in `proven` state with all proof
132
+ * columns populated. Useful for internalised transactions that arrive with a
133
+ * Merkle proof (bump) already attached.
134
+ */
135
+ createWithProof(args: {
136
+ txid: string;
137
+ rawTx?: number[];
138
+ inputBeef?: number[];
139
+ height: number;
140
+ merkleIndex: number;
141
+ merklePath: number[];
142
+ merkleRoot: string;
143
+ blockHash: string;
144
+ isCoinbase?: boolean;
145
+ now?: Date;
146
+ }): Promise<TableTransactionV7>;
147
+ /**
148
+ * #6 — Find an existing V7 transaction row for the given txid (suitable for
149
+ * the broadcast queue) or create a new one in `queued` state.
150
+ */
151
+ findOrCreateForBroadcast(args: {
152
+ txid: string;
153
+ rawTx: number[];
154
+ inputBeef?: number[];
155
+ batch?: string;
156
+ processing?: sdk.ProcessingStatus;
157
+ now?: Date;
158
+ }): Promise<{
159
+ transaction: TableTransactionV7;
160
+ isNew: boolean;
161
+ }>;
162
+ /**
163
+ * #7 — Bulk transition: attempt `transition` for each id; collect results.
164
+ * When `expectedFrom` is omitted the current state of each row is used as
165
+ * the expected source (lenient mode — only the FSM is checked).
166
+ */
167
+ transitionMany(args: {
168
+ transactionIds: number[];
169
+ expectedFrom?: sdk.ProcessingStatus;
170
+ to: sdk.ProcessingStatus;
171
+ provider?: string;
172
+ providerStatus?: string;
173
+ details?: Record<string, unknown>;
174
+ now?: Date;
175
+ }): Promise<{
176
+ updated: number[];
177
+ skipped: number[];
178
+ }>;
179
+ /**
180
+ * #8 — Bulk-set the `batch` column for a list of transaction ids.
181
+ * Pass `undefined` to clear the batch tag.
182
+ */
183
+ setBatch(transactionIds: number[], batch: string | undefined, now?: Date): Promise<void>;
184
+ /**
185
+ * #9 — Atomically increment the `attempts` counter for one transaction and
186
+ * write an `attempts.incremented` audit entry.
187
+ */
188
+ incrementAttempts(transactionId: number, now?: Date): Promise<TableTransactionV7 | undefined>;
189
+ /**
190
+ * #10 — Record the outcome of a broadcast attempt. Transitions processing
191
+ * state, updates `wasBroadcast` and `lastProvider*` columns, and writes an
192
+ * audit row.
193
+ */
194
+ recordBroadcastResult(args: {
195
+ transactionId: number;
196
+ txid: string;
197
+ status: sdk.ProcessingStatus;
198
+ provider: string;
199
+ providerStatus?: string;
200
+ wasBroadcast?: boolean;
201
+ details?: Record<string, unknown>;
202
+ now?: Date;
203
+ }): Promise<TableTransactionV7 | undefined>;
204
+ /**
205
+ * #11 — Append a free-form history note to the audit log for a transaction.
206
+ */
207
+ recordHistoryNote(transactionId: number, note: {
208
+ what: string;
209
+ [k: string]: unknown;
210
+ }, now?: Date): Promise<void>;
211
+ /**
212
+ * #12 — For each txid that exists in the V7 transactions table, merge the
213
+ * raw transaction bytes and (where available) the Merkle path into `beef`.
214
+ * Txids not present in V7 are silently skipped.
215
+ */
216
+ mergeBeefForTxids(beef: Beef, txids: string[]): Promise<void>;
217
+ /**
218
+ * #13 — Collect broadcast-readiness info and a populated Beef for a list of
219
+ * txids. Each entry is classified as:
220
+ * - `readyToSend` — queued/sending → still needs broadcast
221
+ * - `alreadySent` — sent/seen/seen_multi/unconfirmed/proven → already on network
222
+ * - `error` — invalid/doubleSpend → terminal failure
223
+ * - `unknown` — not found in V7
224
+ */
225
+ collectReqsAndBeef(txids: string[], extraTxids?: string[]): Promise<{
226
+ beef: Beef;
227
+ details: Array<{
228
+ txid: string;
229
+ status: 'readyToSend' | 'alreadySent' | 'error' | 'unknown';
230
+ reason?: string;
231
+ }>;
232
+ }>;
233
+ /**
234
+ * #14 — Paginated list of actions (per-user transaction views) with optional
235
+ * status and label filters.
236
+ *
237
+ * After the V7 cutover `tx_labels_map.transactionId` references `actions.actionId`
238
+ * (not `transactions.transactionId`).
239
+ */
240
+ listActionsForUser(args: {
241
+ userId: number;
242
+ statusFilter?: sdk.ProcessingStatus[];
243
+ labelIds?: number[];
244
+ labelQueryMode?: 'all' | 'any';
245
+ createdAtFrom?: Date;
246
+ createdAtTo?: Date;
247
+ limit: number;
248
+ offset: number;
249
+ }): Promise<{
250
+ rows: Array<TableAction & {
251
+ txid: string;
252
+ processing: sdk.ProcessingStatus;
253
+ height?: number;
254
+ }>;
255
+ total?: number;
256
+ }>;
257
+ /**
258
+ * #15 — Paginated list of outputs with their backing transaction processing
259
+ * state. Optional filters: basket, tag set, processing state, spent flag.
260
+ */
261
+ listOutputsForUser(args: {
262
+ userId: number;
263
+ basketId?: number;
264
+ tagIds?: number[];
265
+ tagQueryMode?: 'all' | 'any';
266
+ processingFilter: sdk.ProcessingStatus[];
267
+ includeSpent: boolean;
268
+ limit: number;
269
+ offset: number;
270
+ includeLockingScripts?: boolean;
271
+ }): Promise<{
272
+ rows: Array<TableOutput & {
273
+ processing: sdk.ProcessingStatus;
274
+ }>;
275
+ total?: number;
276
+ }>;
277
+ /**
278
+ * Post-cutover helper: rewrite `tx_labels_map.transactionId` rows that were
279
+ * written with the legacy transactionId (before the real txid + actionId were
280
+ * known) so that they now point at the V7 `actions.actionId`.
281
+ *
282
+ * Call this once per new outgoing transaction immediately after
283
+ * `findOrCreateActionForTxid` resolves the actionId.
284
+ *
285
+ * This is a no-op when:
286
+ * - `legacyTransactionId` has no rows in `tx_labels_map` (no labels on the tx)
287
+ * - `legacyTransactionId === actionId` (should not happen in practice but
288
+ * is safe to call anyway)
289
+ */
290
+ repointLabelsToActionId(legacyTransactionId: number, actionId: number, now?: Date): Promise<void>;
291
+ /**
292
+ * After `processAction` creates the V7 `transactions` row, remap
293
+ * `outputs.transactionId` and `outputs.spentBy` from the bridge-period
294
+ * `transactions_legacy.transactionId` to the real V7 `transactions.transactionId`.
295
+ *
296
+ * During `createAction`, new outputs are inserted with `transactionId =
297
+ * legacyTransactionId` (bypassing FK constraints). `listActionsKnex` queries
298
+ * outputs by V7 transactionId, so without this remap the outputs would be
299
+ * invisible to `listActions`.
300
+ *
301
+ * This is a no-op when `legacyTransactionId === v7TransactionId`.
302
+ */
303
+ repointOutputsToV7TransactionId(legacyTransactionId: number, v7TransactionId: number, now?: Date): Promise<void>;
304
+ }
305
+ //# sourceMappingURL=v7Service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"v7Service.d.ts","sourceRoot":"","sources":["../../../../../src/storage/schema/v7Service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAc,MAAM,UAAU,CAAA;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,KAAK,GAAG,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAA;AAevE,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EACnB,MAAM,kBAAkB,CAAA;AAEzB;;;;;;;;;;;GAWG;AACH,qBAAa,oBAAoB;IAClB,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,IAAI;IAMlC,UAAU,CAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,GAAG,SAAS,CAAC;IAIlE,QAAQ,CAAE,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,GAAG,SAAS,CAAC;IAI/E;;;OAGG;IACG,MAAM,CAAE,IAAI,EAAE;QAClB,IAAI,EAAE,MAAM,CAAA;QACZ,UAAU,CAAC,EAAE,GAAG,CAAC,gBAAgB,CAAA;QACjC,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;QAChB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAA;QACpB,KAAK,CAAC,EAAE,MAAM,CAAA;QACd,cAAc,CAAC,EAAE,MAAM,CAAA;QACvB,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