@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.
Files changed (199) hide show
  1. package/docs/client.md +1683 -1111
  2. package/docs/monitor.md +34 -19
  3. package/docs/services.md +303 -279
  4. package/docs/setup.md +24 -24
  5. package/docs/storage.md +864 -199
  6. package/docs/wallet.md +5228 -11040
  7. package/out/src/__tests/CWIStyleWalletManager.test.js +3 -2
  8. package/out/src/__tests/CWIStyleWalletManager.test.js.map +1 -1
  9. package/out/src/__tests/ShamirWalletManager.test.js +4 -0
  10. package/out/src/__tests/ShamirWalletManager.test.js.map +1 -1
  11. package/out/src/__tests/WalletPermissionsManager.callbacks.test.js +9 -17
  12. package/out/src/__tests/WalletPermissionsManager.callbacks.test.js.map +1 -1
  13. package/out/src/__tests/WalletPermissionsManager.checks.test.js +4 -4
  14. package/out/src/__tests/WalletPermissionsManager.checks.test.js.map +1 -1
  15. package/out/src/__tests/WalletPermissionsManager.encryption.test.js +8 -8
  16. package/out/src/__tests/WalletPermissionsManager.encryption.test.js.map +1 -1
  17. package/out/src/__tests/WalletPermissionsManager.fixtures.d.ts +2 -1
  18. package/out/src/__tests/WalletPermissionsManager.fixtures.d.ts.map +1 -1
  19. package/out/src/__tests/WalletPermissionsManager.fixtures.js +7 -5
  20. package/out/src/__tests/WalletPermissionsManager.fixtures.js.map +1 -1
  21. package/out/src/__tests/WalletPermissionsManager.flows.test.js +14 -14
  22. package/out/src/__tests/WalletPermissionsManager.flows.test.js.map +1 -1
  23. package/out/src/__tests/WalletPermissionsManager.initialization.test.js +4 -4
  24. package/out/src/__tests/WalletPermissionsManager.initialization.test.js.map +1 -1
  25. package/out/src/__tests/WalletPermissionsManager.pmodules.test.js +4 -4
  26. package/out/src/__tests/WalletPermissionsManager.pmodules.test.js.map +1 -1
  27. package/out/src/__tests/WalletPermissionsManager.proxying.test.js +6 -5
  28. package/out/src/__tests/WalletPermissionsManager.proxying.test.js.map +1 -1
  29. package/out/src/__tests/WalletPermissionsManager.tokens.test.js +2 -1
  30. package/out/src/__tests/WalletPermissionsManager.tokens.test.js.map +1 -1
  31. package/out/src/entropy/EntropyCollector.js.map +1 -1
  32. package/out/src/mockchain/MockChainMigrations.d.ts.map +1 -1
  33. package/out/src/mockchain/MockChainStorage.js +3 -3
  34. package/out/src/mockchain/MockChainStorage.js.map +1 -1
  35. package/out/src/mockchain/MockMiner.js +1 -1
  36. package/out/src/mockchain/MockMiner.js.map +1 -1
  37. package/out/src/mockchain/MockServices.js +14 -13
  38. package/out/src/mockchain/MockServices.js.map +1 -1
  39. package/out/src/monitor/Monitor.js +8 -6
  40. package/out/src/monitor/Monitor.js.map +1 -1
  41. package/out/src/monitor/MonitorDaemon.d.ts.map +1 -1
  42. package/out/src/monitor/MonitorDaemon.js +11 -13
  43. package/out/src/monitor/MonitorDaemon.js.map +1 -1
  44. package/out/src/sdk/PrivilegedKeyManager.d.ts.map +1 -1
  45. package/out/src/sdk/PrivilegedKeyManager.js +6 -3
  46. package/out/src/sdk/PrivilegedKeyManager.js.map +1 -1
  47. package/out/src/sdk/WalletError.d.ts.map +1 -1
  48. package/out/src/sdk/WalletError.js +19 -18
  49. package/out/src/sdk/WalletError.js.map +1 -1
  50. package/out/src/sdk/WalletErrorFromJson.js +1 -1
  51. package/out/src/sdk/WalletErrorFromJson.js.map +1 -1
  52. package/out/src/sdk/WalletStorage.interfaces.d.ts +59 -59
  53. package/out/src/sdk/WalletStorage.interfaces.d.ts.map +1 -1
  54. package/out/src/services/ServiceCollection.d.ts.map +1 -1
  55. package/out/src/services/ServiceCollection.js +3 -4
  56. package/out/src/services/ServiceCollection.js.map +1 -1
  57. package/out/src/services/Services.d.ts.map +1 -1
  58. package/out/src/services/Services.js +27 -25
  59. package/out/src/services/Services.js.map +1 -1
  60. package/out/src/storage/StorageIdb.d.ts.map +1 -1
  61. package/out/src/storage/StorageIdb.js +99 -94
  62. package/out/src/storage/StorageIdb.js.map +1 -1
  63. package/out/src/storage/StorageKnex.d.ts +1 -1
  64. package/out/src/storage/StorageKnex.d.ts.map +1 -1
  65. package/out/src/storage/StorageKnex.js +159 -156
  66. package/out/src/storage/StorageKnex.js.map +1 -1
  67. package/out/src/storage/StorageProvider.d.ts.map +1 -1
  68. package/out/src/storage/StorageProvider.js +35 -31
  69. package/out/src/storage/StorageProvider.js.map +1 -1
  70. package/out/src/storage/StorageReader.js +7 -7
  71. package/out/src/storage/StorageReader.js.map +1 -1
  72. package/out/src/storage/StorageReaderWriter.d.ts +0 -1
  73. package/out/src/storage/StorageReaderWriter.d.ts.map +1 -1
  74. package/out/src/storage/StorageReaderWriter.js +0 -3
  75. package/out/src/storage/StorageReaderWriter.js.map +1 -1
  76. package/out/src/storage/StorageSyncReader.js +1 -1
  77. package/out/src/storage/StorageSyncReader.js.map +1 -1
  78. package/out/src/storage/WalletStorageManager.d.ts.map +1 -1
  79. package/out/src/storage/WalletStorageManager.js +22 -21
  80. package/out/src/storage/WalletStorageManager.js.map +1 -1
  81. package/out/src/storage/index.all.d.ts +3 -0
  82. package/out/src/storage/index.all.d.ts.map +1 -1
  83. package/out/src/storage/index.all.js +3 -0
  84. package/out/src/storage/index.all.js.map +1 -1
  85. package/out/src/storage/index.client.d.ts +3 -0
  86. package/out/src/storage/index.client.d.ts.map +1 -1
  87. package/out/src/storage/index.client.js +3 -0
  88. package/out/src/storage/index.client.js.map +1 -1
  89. package/out/src/storage/index.mobile.d.ts +3 -0
  90. package/out/src/storage/index.mobile.d.ts.map +1 -1
  91. package/out/src/storage/index.mobile.js +3 -0
  92. package/out/src/storage/index.mobile.js.map +1 -1
  93. package/out/src/storage/portable/index.d.ts +55 -0
  94. package/out/src/storage/portable/index.d.ts.map +1 -0
  95. package/out/src/storage/portable/index.js +830 -0
  96. package/out/src/storage/portable/index.js.map +1 -0
  97. package/out/src/storage/storageProviderHelpers.js +2 -2
  98. package/out/src/storage/storageProviderHelpers.js.map +1 -1
  99. package/out/src/utility/Format.d.ts.map +1 -1
  100. package/out/src/utility/Format.js +10 -45
  101. package/out/src/utility/Format.js.map +1 -1
  102. package/out/src/utility/ScriptTemplateBRC29.d.ts.map +1 -1
  103. package/out/src/utility/ScriptTemplateBRC29.js +3 -2
  104. package/out/src/utility/ScriptTemplateBRC29.js.map +1 -1
  105. package/out/src/utility/brc114ActionTimeLabels.js +1 -1
  106. package/out/src/utility/brc114ActionTimeLabels.js.map +1 -1
  107. package/out/src/utility/identityUtils.d.ts.map +1 -1
  108. package/out/src/utility/identityUtils.js +5 -5
  109. package/out/src/utility/identityUtils.js.map +1 -1
  110. package/out/src/utility/index.all.d.ts +1 -0
  111. package/out/src/utility/index.all.d.ts.map +1 -1
  112. package/out/src/utility/index.all.js +1 -0
  113. package/out/src/utility/index.all.js.map +1 -1
  114. package/out/src/utility/index.client.d.ts +1 -0
  115. package/out/src/utility/index.client.d.ts.map +1 -1
  116. package/out/src/utility/index.client.js +1 -0
  117. package/out/src/utility/index.client.js.map +1 -1
  118. package/out/src/utility/stampLog.js +3 -3
  119. package/out/src/utility/stampLog.js.map +1 -1
  120. package/out/src/utility/utilityHelpers.buffer.js +1 -1
  121. package/out/src/utility/utilityHelpers.buffer.js.map +1 -1
  122. package/out/src/utility/utilityHelpers.d.ts.map +1 -1
  123. package/out/src/utility/utilityHelpers.js +2 -2
  124. package/out/src/utility/utilityHelpers.js.map +1 -1
  125. package/out/src/wab-client/WABClient.d.ts +2 -2
  126. package/out/src/wab-client/WABClient.d.ts.map +1 -1
  127. package/package.json +1 -1
  128. package/out/src/storage/schema/__tests/v7Backfill.runner.test.d.ts +0 -2
  129. package/out/src/storage/schema/__tests/v7Backfill.runner.test.d.ts.map +0 -1
  130. package/out/src/storage/schema/__tests/v7Backfill.runner.test.js +0 -148
  131. package/out/src/storage/schema/__tests/v7Backfill.runner.test.js.map +0 -1
  132. package/out/src/storage/schema/__tests/v7Backfill.test.d.ts +0 -2
  133. package/out/src/storage/schema/__tests/v7Backfill.test.d.ts.map +0 -1
  134. package/out/src/storage/schema/__tests/v7Backfill.test.js +0 -96
  135. package/out/src/storage/schema/__tests/v7Backfill.test.js.map +0 -1
  136. package/out/src/storage/schema/__tests/v7Fsm.test.d.ts +0 -2
  137. package/out/src/storage/schema/__tests/v7Fsm.test.d.ts.map +0 -1
  138. package/out/src/storage/schema/__tests/v7Fsm.test.js +0 -42
  139. package/out/src/storage/schema/__tests/v7Fsm.test.js.map +0 -1
  140. package/out/src/storage/schema/__tests/v7Spendability.test.d.ts +0 -2
  141. package/out/src/storage/schema/__tests/v7Spendability.test.d.ts.map +0 -1
  142. package/out/src/storage/schema/__tests/v7Spendability.test.js +0 -29
  143. package/out/src/storage/schema/__tests/v7Spendability.test.js.map +0 -1
  144. package/out/src/storage/schema/tables/TableAction.d.ts +0 -38
  145. package/out/src/storage/schema/tables/TableAction.d.ts.map +0 -1
  146. package/out/src/storage/schema/tables/TableAction.js +0 -3
  147. package/out/src/storage/schema/tables/TableAction.js.map +0 -1
  148. package/out/src/storage/schema/tables/TableChainTip.d.ts +0 -17
  149. package/out/src/storage/schema/tables/TableChainTip.d.ts.map +0 -1
  150. package/out/src/storage/schema/tables/TableChainTip.js +0 -3
  151. package/out/src/storage/schema/tables/TableChainTip.js.map +0 -1
  152. package/out/src/storage/schema/tables/TableMonitorLease.d.ts +0 -23
  153. package/out/src/storage/schema/tables/TableMonitorLease.d.ts.map +0 -1
  154. package/out/src/storage/schema/tables/TableMonitorLease.js +0 -3
  155. package/out/src/storage/schema/tables/TableMonitorLease.js.map +0 -1
  156. package/out/src/storage/schema/tables/TableTransactionV7.d.ts +0 -50
  157. package/out/src/storage/schema/tables/TableTransactionV7.d.ts.map +0 -1
  158. package/out/src/storage/schema/tables/TableTransactionV7.js +0 -3
  159. package/out/src/storage/schema/tables/TableTransactionV7.js.map +0 -1
  160. package/out/src/storage/schema/tables/TableTxAudit.d.ts +0 -26
  161. package/out/src/storage/schema/tables/TableTxAudit.d.ts.map +0 -1
  162. package/out/src/storage/schema/tables/TableTxAudit.js +0 -3
  163. package/out/src/storage/schema/tables/TableTxAudit.js.map +0 -1
  164. package/out/src/storage/schema/v7Backfill.d.ts +0 -35
  165. package/out/src/storage/schema/v7Backfill.d.ts.map +0 -1
  166. package/out/src/storage/schema/v7Backfill.idb.d.ts +0 -32
  167. package/out/src/storage/schema/v7Backfill.idb.d.ts.map +0 -1
  168. package/out/src/storage/schema/v7Backfill.idb.js +0 -95
  169. package/out/src/storage/schema/v7Backfill.idb.js.map +0 -1
  170. package/out/src/storage/schema/v7Backfill.js +0 -147
  171. package/out/src/storage/schema/v7Backfill.js.map +0 -1
  172. package/out/src/storage/schema/v7Backfill.knex.d.ts +0 -32
  173. package/out/src/storage/schema/v7Backfill.knex.d.ts.map +0 -1
  174. package/out/src/storage/schema/v7Backfill.knex.js +0 -240
  175. package/out/src/storage/schema/v7Backfill.knex.js.map +0 -1
  176. package/out/src/storage/schema/v7Backfill.runner.d.ts +0 -63
  177. package/out/src/storage/schema/v7Backfill.runner.d.ts.map +0 -1
  178. package/out/src/storage/schema/v7Backfill.runner.js +0 -62
  179. package/out/src/storage/schema/v7Backfill.runner.js.map +0 -1
  180. package/out/src/storage/schema/v7Crud.d.ts +0 -39
  181. package/out/src/storage/schema/v7Crud.d.ts.map +0 -1
  182. package/out/src/storage/schema/v7Crud.js +0 -203
  183. package/out/src/storage/schema/v7Crud.js.map +0 -1
  184. package/out/src/storage/schema/v7Fsm.d.ts +0 -27
  185. package/out/src/storage/schema/v7Fsm.d.ts.map +0 -1
  186. package/out/src/storage/schema/v7Fsm.js +0 -108
  187. package/out/src/storage/schema/v7Fsm.js.map +0 -1
  188. package/out/src/storage/schema/v7MonitorLease.d.ts +0 -57
  189. package/out/src/storage/schema/v7MonitorLease.d.ts.map +0 -1
  190. package/out/src/storage/schema/v7MonitorLease.js +0 -101
  191. package/out/src/storage/schema/v7MonitorLease.js.map +0 -1
  192. package/out/src/storage/schema/v7Spendability.d.ts +0 -45
  193. package/out/src/storage/schema/v7Spendability.d.ts.map +0 -1
  194. package/out/src/storage/schema/v7Spendability.js +0 -52
  195. package/out/src/storage/schema/v7Spendability.js.map +0 -1
  196. package/out/src/storage/schema/v7TxAudit.d.ts +0 -33
  197. package/out/src/storage/schema/v7TxAudit.d.ts.map +0 -1
  198. package/out/src/storage/schema/v7TxAudit.js +0 -64
  199. package/out/src/storage/schema/v7TxAudit.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"v7Backfill.knex.js","sourceRoot":"","sources":["../../../../src/storage/schema/v7Backfill.knex.ts"],"names":[],"mappings":";;;AAqOA,8CAKC;AAlOD,2DAAsF;AAEtF,MAAM,YAAY,GAAG,GAAG,CAAA;AAExB;;;;;;;;;;GAUG;AACH,MAAa,oBAAoB;IAC/B,YAA8B,IAAU;QAAV,SAAI,GAAJ,IAAI,CAAM;IAAG,CAAC;IAE5C,KAAK,CAAC,CAAE,gBAAgB;;QACtB,IAAI,MAAM,GAAG,CAAC,CAAA;QACd,oDAAoD;QACpD,OAAO,IAAI,EAAE,CAAC;YACZ,MAAM,IAAI,GAAU,MAAM,IAAI,CAAC,IAAI,CAAC,qBAAqB,CAAC;iBACvD,QAAQ,CAAC,iBAAiB,EAAE,cAAc,EAAE,cAAc,CAAC;iBAC3D,MAAM,CACL,KAAK,EACL,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,EACxC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,EACtC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,EAAE,CAAC,cAAc,CAAC,EAChD,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,EAAE,CAAC,aAAa,CAAC,EAC9C,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,EAAE,CAAC,cAAc,CAAC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QAAE,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAA;IAC1D,OAAO,SAAS,CAAA;AAClB,CAAC;AAED,SAAS,KAAK,CAAE,CAAuB;IACrC,IAAI,CAAC,IAAI,IAAI;QAAE,OAAO,IAAI,CAAA;IAC1B,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACvB,CAAC"}
@@ -1,63 +0,0 @@
1
- import { TableAction, TableProvenTx, TableProvenTxReq, TableTransaction, TableTransactionV7 } from './tables';
2
- /**
3
- * Storage-agnostic driver used by the V7 backfill orchestrator.
4
- *
5
- * Implementations must be idempotent — calling each method twice with the same
6
- * input must not produce duplicate rows. The orchestrator is responsible for
7
- * iteration order and chunking; the driver only performs writes.
8
- */
9
- export interface V7BackfillDriver {
10
- /** Stream legacy `proven_tx_reqs` rows joined with their `proven_txs` row when available. */
11
- streamLegacyReqs: () => AsyncIterable<{
12
- req: TableProvenTxReq;
13
- proven?: TableProvenTx;
14
- }>;
15
- /** Stream legacy `transactions` rows ordered by transactionId ascending. */
16
- streamLegacyTransactions: () => AsyncIterable<TableTransaction>;
17
- /**
18
- * Upsert a V7 `transactions` row by `txid`. Returns the resolved
19
- * `transactionId` (PK of `transactions_v7`).
20
- */
21
- upsertTransactionV7: (row: Omit<TableTransactionV7, 'transactionId'>) => Promise<number>;
22
- /**
23
- * Upsert a V7 `actions` row by `(userId, transactionId)`. Returns the
24
- * resolved `actionId`.
25
- */
26
- upsertAction: (row: Omit<TableAction, 'actionId'>) => Promise<number>;
27
- /**
28
- * Re-point a single legacy `tx_labels_map` row whose `transactionId` refers
29
- * to the old `transactions` PK so that it points to the new `actions.actionId`.
30
- *
31
- * Implementations may choose to rewrite the entire mapping in bulk and treat
32
- * this method as a no-op; the orchestrator will still call it once per pair.
33
- */
34
- repointTxLabelMap: (legacyTransactionId: number, actionId: number) => Promise<void>;
35
- }
36
- export interface V7BackfillStats {
37
- reqsBackfilled: number;
38
- legacyTxOnlyBackfilled: number;
39
- actionsBackfilled: number;
40
- labelMapsRepointed: number;
41
- }
42
- /**
43
- * Orchestrates §3 Steps 2-5 of PROD_REQ_V7_TS.md.
44
- *
45
- * Strategy:
46
- * 1. Walk every `proven_tx_reqs` row (joined with its proof) and upsert a row
47
- * in `transactions_v7`. Build a `txid -> transactionId` map.
48
- * 2. Walk every legacy `transactions` row.
49
- * - If the row has a txid AND it is not in the map, upsert a tx-only V7
50
- * row (locally-created actions that never reached the broadcast queue).
51
- * - Compute the V7 `transactionId` for this legacy row. Rows without a
52
- * txid (unsigned, unprocessed) are skipped — they have no canonical V7
53
- * representation yet and are surfaced as gaps in the stats.
54
- * 3. Upsert an `actions` row per legacy `transactions` row that has a V7
55
- * transactionId.
56
- * 4. Re-point `tx_labels_map.transactionId` from legacy PK to new `actionId`.
57
- *
58
- * The driver is invoked one row at a time so that the entire pass can run as
59
- * a single Knex transaction or a single IDB readwrite transaction without
60
- * holding the full row set in memory.
61
- */
62
- export declare function runV7Backfill(driver: V7BackfillDriver, now?: Date): Promise<V7BackfillStats>;
63
- //# sourceMappingURL=v7Backfill.runner.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"v7Backfill.runner.d.ts","sourceRoot":"","sources":["../../../../src/storage/schema/v7Backfill.runner.ts"],"names":[],"mappings":"AACA,OAAO,EACL,WAAW,EACX,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EACnB,MAAM,UAAU,CAAA;AAEjB;;;;;;GAMG;AACH,MAAM,WAAW,gBAAgB;IAC/B,6FAA6F;IAC7F,gBAAgB,EAAE,MAAM,aAAa,CAAC;QAAE,GAAG,EAAE,gBAAgB,CAAC;QAAC,MAAM,CAAC,EAAE,aAAa,CAAA;KAAE,CAAC,CAAA;IACxF,4EAA4E;IAC5E,wBAAwB,EAAE,MAAM,aAAa,CAAC,gBAAgB,CAAC,CAAA;IAC/D;;;OAGG;IACH,mBAAmB,EAAE,CAAC,GAAG,EAAE,IAAI,CAAC,kBAAkB,EAAE,eAAe,CAAC,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;IACxF;;;OAGG;IACH,YAAY,EAAE,CAAC,GAAG,EAAE,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;IACrE;;;;;;OAMG;IACH,iBAAiB,EAAE,CAAC,mBAAmB,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CACpF;AAED,MAAM,WAAW,eAAe;IAC9B,cAAc,EAAE,MAAM,CAAA;IACtB,sBAAsB,EAAE,MAAM,CAAA;IAC9B,iBAAiB,EAAE,MAAM,CAAA;IACzB,kBAAkB,EAAE,MAAM,CAAA;CAC3B;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,aAAa,CAAE,MAAM,EAAE,gBAAgB,EAAE,GAAG,GAAE,IAAiB,GAAG,OAAO,CAAC,eAAe,CAAC,CAyC/G"}
@@ -1,62 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.runV7Backfill = runV7Backfill;
4
- const v7Backfill_1 = require("./v7Backfill");
5
- /**
6
- * Orchestrates §3 Steps 2-5 of PROD_REQ_V7_TS.md.
7
- *
8
- * Strategy:
9
- * 1. Walk every `proven_tx_reqs` row (joined with its proof) and upsert a row
10
- * in `transactions_v7`. Build a `txid -> transactionId` map.
11
- * 2. Walk every legacy `transactions` row.
12
- * - If the row has a txid AND it is not in the map, upsert a tx-only V7
13
- * row (locally-created actions that never reached the broadcast queue).
14
- * - Compute the V7 `transactionId` for this legacy row. Rows without a
15
- * txid (unsigned, unprocessed) are skipped — they have no canonical V7
16
- * representation yet and are surfaced as gaps in the stats.
17
- * 3. Upsert an `actions` row per legacy `transactions` row that has a V7
18
- * transactionId.
19
- * 4. Re-point `tx_labels_map.transactionId` from legacy PK to new `actionId`.
20
- *
21
- * The driver is invoked one row at a time so that the entire pass can run as
22
- * a single Knex transaction or a single IDB readwrite transaction without
23
- * holding the full row set in memory.
24
- */
25
- async function runV7Backfill(driver, now = new Date()) {
26
- const stats = {
27
- reqsBackfilled: 0,
28
- legacyTxOnlyBackfilled: 0,
29
- actionsBackfilled: 0,
30
- labelMapsRepointed: 0
31
- };
32
- const txidToV7Id = new Map();
33
- for await (const { req, proven } of driver.streamLegacyReqs()) {
34
- const v7Row = (0, v7Backfill_1.buildTransactionV7Row)(req, proven, now);
35
- const id = await driver.upsertTransactionV7(v7Row);
36
- txidToV7Id.set(v7Row.txid, id);
37
- stats.reqsBackfilled += 1;
38
- }
39
- for await (const legacy of driver.streamLegacyTransactions()) {
40
- let v7Id;
41
- if (legacy.txid != null) {
42
- v7Id = txidToV7Id.get(legacy.txid);
43
- if (v7Id === undefined) {
44
- const v7Row = (0, v7Backfill_1.buildTransactionV7RowFromLegacyTx)(legacy, now);
45
- if (v7Row !== undefined) {
46
- v7Id = await driver.upsertTransactionV7(v7Row);
47
- txidToV7Id.set(legacy.txid, v7Id);
48
- stats.legacyTxOnlyBackfilled += 1;
49
- }
50
- }
51
- }
52
- if (v7Id === undefined)
53
- continue;
54
- const actionRow = (0, v7Backfill_1.buildActionRow)(legacy, v7Id, now);
55
- const actionId = await driver.upsertAction(actionRow);
56
- stats.actionsBackfilled += 1;
57
- await driver.repointTxLabelMap(legacy.transactionId, actionId);
58
- stats.labelMapsRepointed += 1;
59
- }
60
- return stats;
61
- }
62
- //# sourceMappingURL=v7Backfill.runner.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"v7Backfill.runner.js","sourceRoot":"","sources":["../../../../src/storage/schema/v7Backfill.runner.ts"],"names":[],"mappings":";;AAoEA,sCAyCC;AA7GD,6CAAuG;AAgDvG;;;;;;;;;;;;;;;;;;;GAmBG;AACI,KAAK,UAAU,aAAa,CAAE,MAAwB,EAAE,MAAY,IAAI,IAAI,EAAE;IACnF,MAAM,KAAK,GAAoB;QAC7B,cAAc,E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AG,IAAA,2BAAc,EAAC,MAAM,EAAE,IAAI,EAAE,GAAG,CAAC,CAAA;QACnD,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,SAAS,CAAC,CAAA;QACrD,KAAK,CAAC,iBAAiB,IAAI,CAAC,CAAA;QAE5B,MAAM,MAAM,CAAC,iBAAiB,CAAC,MAAM,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAA;QAC9D,KAAK,CAAC,kBAAkB,IAAI,CAAC,CAAA;IAC/B,CAAC;IAED,OAAO,KAAK,CAAA;AACd,CAAC"}
@@ -1,39 +0,0 @@
1
- import { Knex } from 'knex';
2
- import * as sdk from '../../sdk';
3
- import { TableAction, TableChainTip, TableTransactionV7 } from './tables';
4
- /** Read a single `transactions_v7` row by txid, returning `undefined` if absent. */
5
- export declare function findTransactionV7ByTxid(knex: Knex, txid: string): Promise<TableTransactionV7 | undefined>;
6
- /** Read a single `transactions_v7` row by PK. */
7
- export declare function findTransactionV7(knex: Knex, transactionId: number): Promise<TableTransactionV7 | undefined>;
8
- /** Insert a new `transactions_v7` row. Caller supplies the full body. */
9
- export declare function insertTransactionV7(knex: Knex, row: Omit<TableTransactionV7, 'transactionId' | 'created_at' | 'updated_at'>, now?: Date): Promise<number>;
10
- /**
11
- * Transition the processing column atomically and append a `tx_audit` row.
12
- * Returns the new `TableTransactionV7` on success and `undefined` when the
13
- * source state did not match the row (CAS failed) or the transition was
14
- * rejected by the FSM.
15
- *
16
- * Optimistic concurrency: the caller passes the `expectedFromState` they
17
- * read in the same logical operation; the update only fires when the row's
18
- * current `processing` still equals that value.
19
- */
20
- export declare function transitionProcessing(knex: Knex, args: {
21
- transactionId: number;
22
- expectedFromState: sdk.ProcessingStatus;
23
- toState: sdk.ProcessingStatus;
24
- details?: Record<string, unknown>;
25
- provider?: string;
26
- providerStatus?: string;
27
- }, now?: Date): Promise<TableTransactionV7 | undefined>;
28
- /** Find an action row by `(userId, transactionId)`. */
29
- export declare function findAction(knex: Knex, userId: number, transactionId: number): Promise<TableAction | undefined>;
30
- export declare function insertAction(knex: Knex, row: Omit<TableAction, 'actionId' | 'created_at' | 'updated_at'>, now?: Date): Promise<number>;
31
- /** Get the singleton chain tip row (`id = 1`). */
32
- export declare function getChainTip(knex: Knex): Promise<TableChainTip | undefined>;
33
- /** Upsert the singleton chain tip. Always uses `id = 1`. */
34
- export declare function setChainTip(knex: Knex, args: {
35
- height: number;
36
- blockHash: string;
37
- merkleRoot?: string;
38
- }, now?: Date): Promise<void>;
39
- //# sourceMappingURL=v7Crud.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"v7Crud.d.ts","sourceRoot":"","sources":["../../../../src/storage/schema/v7Crud.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,KAAK,GAAG,MAAM,WAAW,CAAA;AAChC,OAAO,EACL,WAAW,EACX,aAAa,EACb,kBAAkB,EACnB,MAAM,UAAU,CAAA;AAGjB,oFAAoF;AACpF,wBAAsB,uBAAuB,CAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,GAAG,SAAS,CAAC,CAGhH;AAED,iDAAiD;AACjD,wBAAsB,iBAAiB,CAAE,IAAI,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,GAAG,SAAS,CAAC,CAGnH;AAED,yEAAyE;AACzE,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,IAAI,EACV,GAAG,EAAE,IAAI,CAAC,kBAAkB,EAAE,eAAe,GAAG,YAAY,GAAG,YAAY,CAAC,EAC5E,GAAG,GAAE,IAAiB,GACrB,OAAO,CAAC,MAAM,CAAC,CAKjB;AAED;;;;;;;;;GASG;AACH,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,IAAI,EACV,IAAI,EAAE;IACJ,aAAa,EAAE,MAAM,CAAA;IACrB,iBAAiB,EAAE,GAAG,CAAC,gBAAgB,CAAA;IACvC,OAAO,EAAE,GAAG,CAAC,gBAAgB,CAAA;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB,EACD,GAAG,GAAE,IAAiB,GACrB,OAAO,CAAC,kBAAkB,GAAG,SAAS,CAAC,CAsBzC;AAED,uDAAuD;AACvD,wBAAsB,UAAU,CAC9B,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC,CAGlC;AAED,wBAAsB,YAAY,CAChC,IAAI,EAAE,IAAI,EACV,GAAG,EAAE,IAAI,CAAC,WAAW,EAAE,UAAU,GAAG,YAAY,GAAG,YAAY,CAAC,EAChE,GAAG,GAAE,IAAiB,GACrB,OAAO,CAAC,MAAM,CAAC,CAmBjB;AAED,kDAAkD;AAClD,wBAAsB,WAAW,CAAE,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC,CAGjF;AAED,4DAA4D;AAC5D,wBAAsB,WAAW,CAC/B,IAAI,EAAE,IAAI,EACV,IAAI,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,EAChE,GAAG,GAAE,IAAiB,GACrB,OAAO,CAAC,IAAI,CAAC,CAqBf"}
@@ -1,203 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.findTransactionV7ByTxid = findTransactionV7ByTxid;
4
- exports.findTransactionV7 = findTransactionV7;
5
- exports.insertTransactionV7 = insertTransactionV7;
6
- exports.transitionProcessing = transitionProcessing;
7
- exports.findAction = findAction;
8
- exports.insertAction = insertAction;
9
- exports.getChainTip = getChainTip;
10
- exports.setChainTip = setChainTip;
11
- const v7TxAudit_1 = require("./v7TxAudit");
12
- /** Read a single `transactions_v7` row by txid, returning `undefined` if absent. */
13
- async function findTransactionV7ByTxid(knex, txid) {
14
- const row = await knex('transactions_v7').where({ txid }).first();
15
- return row != null ? mapTransactionRow(row) : undefined;
16
- }
17
- /** Read a single `transactions_v7` row by PK. */
18
- async function findTransactionV7(knex, transactionId) {
19
- const row = await knex('transactions_v7').where({ transactionId }).first();
20
- return row != null ? mapTransactionRow(row) : undefined;
21
- }
22
- /** Insert a new `transactions_v7` row. Caller supplies the full body. */
23
- async function insertTransactionV7(knex, row, now = new Date()) {
24
- const [id] = await knex('transactions_v7').insert(unmapTransactionRow(row, now));
25
- if (typeof id === 'number' && id > 0)
26
- return id;
27
- const r = await knex('transactions_v7').where({ txid: row.txid }).first('transactionId');
28
- return r.transactionId;
29
- }
30
- /**
31
- * Transition the processing column atomically and append a `tx_audit` row.
32
- * Returns the new `TableTransactionV7` on success and `undefined` when the
33
- * source state did not match the row (CAS failed) or the transition was
34
- * rejected by the FSM.
35
- *
36
- * Optimistic concurrency: the caller passes the `expectedFromState` they
37
- * read in the same logical operation; the update only fires when the row's
38
- * current `processing` still equals that value.
39
- */
40
- async function transitionProcessing(knex, args, now = new Date()) {
41
- var _a, _b;
42
- const ok = await (0, v7TxAudit_1.auditProcessingTransition)(knex, args.transactionId, args.expectedFromState, args.toState, args.details, now);
43
- if (!ok)
44
- return undefined;
45
- const updated = await knex('transactions_v7')
46
- .where({ transactionId: args.transactionId, processing: args.expectedFromState })
47
- .update({
48
- processing: args.toState,
49
- processing_changed_at: now,
50
- last_provider: (_a = args.provider) !== null && _a !== void 0 ? _a : null,
51
- last_provider_status: (_b = args.providerStatus) !== null && _b !== void 0 ? _b : null,
52
- updated_at: now
53
- });
54
- if (updated === 0)
55
- return undefined;
56
- const row = await knex('transactions_v7').where({ transactionId: args.transactionId }).first();
57
- return mapTransactionRow(row);
58
- }
59
- /** Find an action row by `(userId, transactionId)`. */
60
- async function findAction(knex, userId, transactionId) {
61
- const row = await knex('actions').where({ userId, transactionId }).first();
62
- return row != null ? mapActionRow(row) : undefined;
63
- }
64
- async function insertAction(knex, row, now = new Date()) {
65
- var _a;
66
- const [id] = await knex('actions').insert({
67
- userId: row.userId,
68
- transactionId: row.transactionId,
69
- reference: row.reference,
70
- description: row.description,
71
- isOutgoing: row.isOutgoing,
72
- satoshis_delta: row.satoshisDelta,
73
- user_nosend: row.userNosend,
74
- hidden: row.hidden,
75
- user_aborted: row.userAborted,
76
- notify_json: (_a = row.notifyJson) !== null && _a !== void 0 ? _a : null,
77
- row_version: row.rowVersion,
78
- created_at: now,
79
- updated_at: now
80
- });
81
- if (typeof id === 'number' && id > 0)
82
- return id;
83
- const r = await knex('actions').where({ userId: row.userId, transactionId: row.transactionId }).first('actionId');
84
- return r.actionId;
85
- }
86
- /** Get the singleton chain tip row (`id = 1`). */
87
- async function getChainTip(knex) {
88
- const row = await knex('chain_tip').where({ id: 1 }).first();
89
- return row != null ? mapChainTipRow(row) : undefined;
90
- }
91
- /** Upsert the singleton chain tip. Always uses `id = 1`. */
92
- async function setChainTip(knex, args, now = new Date()) {
93
- var _a, _b;
94
- const existing = await knex('chain_tip').where({ id: 1 }).first('id');
95
- if (existing == null) {
96
- await knex('chain_tip').insert({
97
- id: 1,
98
- height: args.height,
99
- block_hash: args.blockHash,
100
- merkle_root: (_a = args.merkleRoot) !== null && _a !== void 0 ? _a : null,
101
- observed_at: now,
102
- created_at: now,
103
- updated_at: now
104
- });
105
- return;
106
- }
107
- await knex('chain_tip').where({ id: 1 }).update({
108
- height: args.height,
109
- block_hash: args.blockHash,
110
- merkle_root: (_b = args.merkleRoot) !== null && _b !== void 0 ? _b : null,
111
- observed_at: now,
112
- updated_at: now
113
- });
114
- }
115
- function mapTransactionRow(row) {
116
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
117
- return {
118
- created_at: new Date(row.created_at),
119
- updated_at: new Date(row.updated_at),
120
- transactionId: row.transactionId,
121
- txid: row.txid,
122
- processing: row.processing,
123
- processingChangedAt: new Date(row.processing_changed_at),
124
- nextActionAt: row.next_action_at != null ? new Date(row.next_action_at) : undefined,
125
- attempts: row.attempts,
126
- rebroadcastCycles: row.rebroadcast_cycles,
127
- wasBroadcast: !!row.was_broadcast,
128
- idempotencyKey: (_a = row.idempotency_key) !== null && _a !== void 0 ? _a : undefined,
129
- batch: (_b = row.batch) !== null && _b !== void 0 ? _b : undefined,
130
- rawTx: row.raw_tx != null ? Array.from(row.raw_tx.values()) : undefined,
131
- inputBeef: row.input_beef != null ? Array.from(row.input_beef.values()) : undefined,
132
- height: (_c = row.height) !== null && _c !== void 0 ? _c : undefined,
133
- merkleIndex: (_d = row.merkle_index) !== null && _d !== void 0 ? _d : undefined,
134
- merklePath: row.merkle_path != null ? Array.from(row.merkle_path.values()) : undefined,
135
- merkleRoot: (_e = row.merkle_root) !== null && _e !== void 0 ? _e : undefined,
136
- blockHash: (_f = row.block_hash) !== null && _f !== void 0 ? _f : undefined,
137
- isCoinbase: !!row.is_coinbase,
138
- lastProvider: (_g = row.last_provider) !== null && _g !== void 0 ? _g : undefined,
139
- lastProviderStatus: (_h = row.last_provider_status) !== null && _h !== void 0 ? _h : undefined,
140
- frozenReason: (_j = row.frozen_reason) !== null && _j !== void 0 ? _j : undefined,
141
- rowVersion: row.row_version
142
- };
143
- }
144
- function unmapTransactionRow(row, now) {
145
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
146
- return {
147
- txid: row.txid,
148
- processing: row.processing,
149
- processing_changed_at: row.processingChangedAt,
150
- next_action_at: (_a = row.nextActionAt) !== null && _a !== void 0 ? _a : null,
151
- attempts: row.attempts,
152
- rebroadcast_cycles: row.rebroadcastCycles,
153
- was_broadcast: row.wasBroadcast,
154
- idempotency_key: (_b = row.idempotencyKey) !== null && _b !== void 0 ? _b : null,
155
- batch: (_c = row.batch) !== null && _c !== void 0 ? _c : null,
156
- raw_tx: row.rawTx != null ? Buffer.from(row.rawTx) : null,
157
- input_beef: row.inputBeef != null ? Buffer.from(row.inputBeef) : null,
158
- height: (_d = row.height) !== null && _d !== void 0 ? _d : null,
159
- merkle_index: (_e = row.merkleIndex) !== null && _e !== void 0 ? _e : null,
160
- merkle_path: row.merklePath != null ? Buffer.from(row.merklePath) : null,
161
- merkle_root: (_f = row.merkleRoot) !== null && _f !== void 0 ? _f : null,
162
- block_hash: (_g = row.blockHash) !== null && _g !== void 0 ? _g : null,
163
- is_coinbase: row.isCoinbase,
164
- last_provider: (_h = row.lastProvider) !== null && _h !== void 0 ? _h : null,
165
- last_provider_status: (_j = row.lastProviderStatus) !== null && _j !== void 0 ? _j : null,
166
- frozen_reason: (_k = row.frozenReason) !== null && _k !== void 0 ? _k : null,
167
- row_version: row.rowVersion,
168
- created_at: now,
169
- updated_at: now
170
- };
171
- }
172
- function mapActionRow(row) {
173
- var _a;
174
- return {
175
- created_at: new Date(row.created_at),
176
- updated_at: new Date(row.updated_at),
177
- actionId: row.actionId,
178
- userId: row.userId,
179
- transactionId: row.transactionId,
180
- reference: row.reference,
181
- description: row.description,
182
- isOutgoing: !!row.isOutgoing,
183
- satoshisDelta: row.satoshis_delta,
184
- userNosend: !!row.user_nosend,
185
- hidden: !!row.hidden,
186
- userAborted: !!row.user_aborted,
187
- notifyJson: (_a = row.notify_json) !== null && _a !== void 0 ? _a : undefined,
188
- rowVersion: row.row_version
189
- };
190
- }
191
- function mapChainTipRow(row) {
192
- var _a;
193
- return {
194
- created_at: new Date(row.created_at),
195
- updated_at: new Date(row.updated_at),
196
- id: row.id,
197
- height: row.height,
198
- blockHash: row.block_hash,
199
- merkleRoot: (_a = row.merkle_root) !== null && _a !== void 0 ? _a : undefined,
200
- observedAt: new Date(row.observed_at)
201
- };
202
- }
203
- //# sourceMappingURL=v7Crud.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"v7Crud.js","sourceRoot":"","sources":["../../../../src/storage/schema/v7Crud.ts"],"names":[],"mappings":";;AAUA,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I,CAAC,GAAG,CAAC,UAAU,CAAC;QACpC,UAAU,EAAE,IAAI,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC;QACpC,EAAE,EAAE,GAAG,CAAC,EAAE;QACV,MAAM,EAAE,GAAG,CAAC,MAAM;QAClB,SAAS,EAAE,GAAG,CAAC,UAAU;QACzB,UAAU,EAAE,MAAA,GAAG,CAAC,WAAW,mCAAI,SAAS;QACxC,UAAU,EAAE,IAAI,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC;KACtC,CAAA;AACH,CAAC"}
@@ -1,27 +0,0 @@
1
- import * as sdk from '../../sdk';
2
- export interface FsmTransitionResult {
3
- ok: boolean;
4
- reason?: string;
5
- }
6
- /**
7
- * Returns true when `from -> to` is a permitted V7 processing transition.
8
- * Identity transitions (`from === to`) are always allowed — they represent a
9
- * status refresh without state change.
10
- */
11
- export declare function isValidProcessingTransition(from: sdk.ProcessingStatus, to: sdk.ProcessingStatus): boolean;
12
- /**
13
- * As `isValidProcessingTransition` but returns a structured result with a
14
- * human-readable reason for any rejection. Useful for `tx_audit` payloads.
15
- */
16
- export declare function validateProcessingTransition(from: sdk.ProcessingStatus, to: sdk.ProcessingStatus): FsmTransitionResult;
17
- /** Snapshot of the transition table for documentation + tests. */
18
- export declare function processingTransitionMap(): Readonly<Record<sdk.ProcessingStatus, readonly sdk.ProcessingStatus[]>>;
19
- /**
20
- * True when the given state implies the transaction has been seen / accepted
21
- * by at least one network provider — the precondition for output spendability
22
- * in §4.
23
- */
24
- export declare function isProcessingSpendable(s: sdk.ProcessingStatus): boolean;
25
- /** True when the state is terminal (no further automatic transitions). */
26
- export declare function isProcessingTerminal(s: sdk.ProcessingStatus): boolean;
27
- //# sourceMappingURL=v7Fsm.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"v7Fsm.d.ts","sourceRoot":"","sources":["../../../../src/storage/schema/v7Fsm.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,WAAW,CAAA;AA+BhC,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,OAAO,CAAA;IACX,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,GAAG,CAAC,gBAAgB,EAC1B,EAAE,EAAE,GAAG,CAAC,gBAAgB,GACvB,OAAO,CAGT;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,GAAG,CAAC,gBAAgB,EAC1B,EAAE,EAAE,GAAG,CAAC,gBAAgB,GACvB,mBAAmB,CAMrB;AAED,kEAAkE;AAClE,wBAAgB,uBAAuB,IAAK,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,gBAAgB,EAAE,SAAS,GAAG,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAElH;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAE,CAAC,EAAE,GAAG,CAAC,gBAAgB,GAAG,OAAO,CAEvE;AAED,0EAA0E;AAC1E,wBAAgB,oBAAoB,CAAE,CAAC,EAAE,GAAG,CAAC,gBAAgB,GAAG,OAAO,CAEtE"}
@@ -1,108 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.isValidProcessingTransition = isValidProcessingTransition;
37
- exports.validateProcessingTransition = validateProcessingTransition;
38
- exports.processingTransitionMap = processingTransitionMap;
39
- exports.isProcessingSpendable = isProcessingSpendable;
40
- exports.isProcessingTerminal = isProcessingTerminal;
41
- const sdk = __importStar(require("../../sdk"));
42
- /**
43
- * V7 processing-state machine.
44
- *
45
- * Maps each `ProcessingStatus` to the set of states it may legally transition
46
- * to. Terminal states (`proven`, `invalid`, `doubleSpend`) have no outgoing
47
- * transitions except via the `unfail` operator override.
48
- *
49
- * The transition table is intentionally permissive — the goal is to *reject
50
- * impossible* moves (e.g. `queued -> proven` without ever broadcasting) rather
51
- * than to enumerate the happy path. Stateful preconditions (proof present,
52
- * provider acknowledged) are enforced at the call site.
53
- */
54
- const TRANSITIONS = {
55
- queued: ['sending', 'sent', 'nosend', 'frozen', 'nonfinal', 'invalid'],
56
- sending: ['sent', 'seen', 'seen_multi', 'invalid', 'doubleSpend', 'frozen', 'queued'],
57
- sent: ['seen', 'seen_multi', 'unconfirmed', 'proven', 'invalid', 'doubleSpend', 'frozen', 'sending'],
58
- seen: ['seen_multi', 'unconfirmed', 'proven', 'invalid', 'doubleSpend', 'reorging', 'frozen'],
59
- seen_multi: ['unconfirmed', 'proven', 'invalid', 'doubleSpend', 'reorging', 'frozen'],
60
- unconfirmed: ['proven', 'invalid', 'reorging', 'frozen', 'seen', 'seen_multi'],
61
- proven: ['reorging'],
62
- reorging: ['proven', 'seen', 'seen_multi', 'unconfirmed', 'invalid', 'doubleSpend', 'frozen'],
63
- invalid: ['unfail'],
64
- doubleSpend: ['unfail'],
65
- unfail: ['queued', 'sending', 'sent', 'seen', 'seen_multi', 'unconfirmed', 'proven', 'invalid', 'doubleSpend'],
66
- frozen: ['queued', 'sending', 'sent', 'seen', 'seen_multi', 'unconfirmed', 'invalid', 'doubleSpend'],
67
- nosend: ['queued', 'sent', 'seen', 'invalid', 'frozen'],
68
- nonfinal: ['queued', 'sending', 'sent', 'invalid', 'frozen']
69
- };
70
- /**
71
- * Returns true when `from -> to` is a permitted V7 processing transition.
72
- * Identity transitions (`from === to`) are always allowed — they represent a
73
- * status refresh without state change.
74
- */
75
- function isValidProcessingTransition(from, to) {
76
- if (from === to)
77
- return true;
78
- return TRANSITIONS[from].includes(to);
79
- }
80
- /**
81
- * As `isValidProcessingTransition` but returns a structured result with a
82
- * human-readable reason for any rejection. Useful for `tx_audit` payloads.
83
- */
84
- function validateProcessingTransition(from, to) {
85
- if (isValidProcessingTransition(from, to))
86
- return { ok: true };
87
- return {
88
- ok: false,
89
- reason: `illegal transition ${from} -> ${to}; legal next: ${TRANSITIONS[from].join(', ')}`
90
- };
91
- }
92
- /** Snapshot of the transition table for documentation + tests. */
93
- function processingTransitionMap() {
94
- return TRANSITIONS;
95
- }
96
- /**
97
- * True when the given state implies the transaction has been seen / accepted
98
- * by at least one network provider — the precondition for output spendability
99
- * in §4.
100
- */
101
- function isProcessingSpendable(s) {
102
- return sdk.ProcessingSpendableStatus.includes(s);
103
- }
104
- /** True when the state is terminal (no further automatic transitions). */
105
- function isProcessingTerminal(s) {
106
- return sdk.ProcessingTerminalStatus.includes(s);
107
- }
108
- //# sourceMappingURL=v7Fsm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"v7Fsm.js","sourceRoot":"","sources":["../../../../src/storage/schema/v7Fsm.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCA,kEAMC;AAMD,oEAS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ACpG,MAAM,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,CAAC;IACvD,QAAQ,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,CAAC;CAC7D,CAAA;AAOD;;;;GAIG;AACH,SAAgB,2BAA2B,CACzC,IAA0B,EAC1B,EAAwB;IAExB,IAAI,IAAI,KAAK,EAAE;QAAE,OAAO,IAAI,CAAA;IAC5B,OAAO,WAAW,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAA;AACvC,CAAC;AAED;;;GAGG;AACH,SAAgB,4BAA4B,CAC1C,IAA0B,EAC1B,EAAwB;IAExB,IAAI,2BAA2B,CAAC,IAAI,EAAE,EAAE,CAAC;QAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,CAAA;IAC9D,OAAO;QACL,EAAE,EAAE,KAAK;QACT,MAAM,EAAE,sBAAsB,IAAI,OAAO,EAAE,iBAAiB,WAAW,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;KAC3F,CAAA;AACH,CAAC;AAED,kEAAkE;AAClE,SAAgB,uBAAuB;IACrC,OAAO,WAAW,CAAA;AACpB,CAAC;AAED;;;;GAIG;AACH,SAAgB,qBAAqB,CAAE,CAAuB;IAC5D,OAAO,GAAG,CAAC,yBAAyB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAA;AAClD,CAAC;AAED,0EAA0E;AAC1E,SAAgB,oBAAoB,CAAE,CAAuB;IAC3D,OAAO,GAAG,CAAC,wBAAwB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAA;AACjD,CAAC"}
@@ -1,57 +0,0 @@
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
@@ -1 +0,0 @@
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"}