@bsv/wallet-toolbox 1.7.18 → 2.0.0-beta.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 (606) hide show
  1. package/out/src/sdk/validationHelpers.d.ts +303 -0
  2. package/out/src/sdk/validationHelpers.d.ts.map +1 -0
  3. package/out/src/sdk/validationHelpers.js +632 -0
  4. package/out/src/sdk/validationHelpers.js.map +1 -0
  5. package/package.json +9 -2
  6. package/.env.template +0 -22
  7. package/.github/ISSUE_TEMPLATE/bug_report.md +0 -40
  8. package/.github/ISSUE_TEMPLATE/discussion.md +0 -24
  9. package/.github/pull_request_template.md +0 -22
  10. package/.github/workflows/push.yaml +0 -145
  11. package/.prettierrc +0 -10
  12. package/CONTRIBUTING.md +0 -89
  13. package/jest.config.ts +0 -25
  14. package/out/test/Wallet/StorageClient/storageClient.man.test.d.ts +0 -2
  15. package/out/test/Wallet/StorageClient/storageClient.man.test.d.ts.map +0 -1
  16. package/out/test/Wallet/StorageClient/storageClient.man.test.js +0 -64
  17. package/out/test/Wallet/StorageClient/storageClient.man.test.js.map +0 -1
  18. package/out/test/Wallet/action/internalizeAction.a.test.d.ts +0 -2
  19. package/out/test/Wallet/action/internalizeAction.a.test.d.ts.map +0 -1
  20. package/out/test/Wallet/action/internalizeAction.a.test.js +0 -243
  21. package/out/test/Wallet/action/internalizeAction.a.test.js.map +0 -1
  22. package/out/test/Wallet/certificate/acquireCertificate.test.d.ts +0 -2
  23. package/out/test/Wallet/certificate/acquireCertificate.test.d.ts.map +0 -1
  24. package/out/test/Wallet/certificate/acquireCertificate.test.js +0 -210
  25. package/out/test/Wallet/certificate/acquireCertificate.test.js.map +0 -1
  26. package/out/test/Wallet/certificate/listCertificates.test.d.ts +0 -2
  27. package/out/test/Wallet/certificate/listCertificates.test.d.ts.map +0 -1
  28. package/out/test/Wallet/certificate/listCertificates.test.js +0 -305
  29. package/out/test/Wallet/certificate/listCertificates.test.js.map +0 -1
  30. package/out/test/Wallet/get/getHeaderForHeight.test.d.ts +0 -2
  31. package/out/test/Wallet/get/getHeaderForHeight.test.d.ts.map +0 -1
  32. package/out/test/Wallet/get/getHeaderForHeight.test.js +0 -74
  33. package/out/test/Wallet/get/getHeaderForHeight.test.js.map +0 -1
  34. package/out/test/Wallet/get/getHeight.test.d.ts +0 -2
  35. package/out/test/Wallet/get/getHeight.test.d.ts.map +0 -1
  36. package/out/test/Wallet/get/getHeight.test.js +0 -48
  37. package/out/test/Wallet/get/getHeight.test.js.map +0 -1
  38. package/out/test/Wallet/get/getKnownTxids.test.d.ts +0 -2
  39. package/out/test/Wallet/get/getKnownTxids.test.d.ts.map +0 -1
  40. package/out/test/Wallet/get/getKnownTxids.test.js +0 -73
  41. package/out/test/Wallet/get/getKnownTxids.test.js.map +0 -1
  42. package/out/test/Wallet/get/getNetwork.test.d.ts +0 -2
  43. package/out/test/Wallet/get/getNetwork.test.d.ts.map +0 -1
  44. package/out/test/Wallet/get/getNetwork.test.js +0 -26
  45. package/out/test/Wallet/get/getNetwork.test.js.map +0 -1
  46. package/out/test/Wallet/get/getVersion.test.d.ts +0 -2
  47. package/out/test/Wallet/get/getVersion.test.d.ts.map +0 -1
  48. package/out/test/Wallet/get/getVersion.test.js +0 -25
  49. package/out/test/Wallet/get/getVersion.test.js.map +0 -1
  50. package/out/test/Wallet/live/walletLive.man.test.d.ts +0 -26
  51. package/out/test/Wallet/live/walletLive.man.test.d.ts.map +0 -1
  52. package/out/test/Wallet/live/walletLive.man.test.js +0 -417
  53. package/out/test/Wallet/live/walletLive.man.test.js.map +0 -1
  54. package/out/test/Wallet/local/localWallet.man.test.d.ts +0 -2
  55. package/out/test/Wallet/local/localWallet.man.test.d.ts.map +0 -1
  56. package/out/test/Wallet/local/localWallet.man.test.js +0 -83
  57. package/out/test/Wallet/local/localWallet.man.test.js.map +0 -1
  58. package/out/test/Wallet/local/localWallet2.man.test.d.ts +0 -2
  59. package/out/test/Wallet/local/localWallet2.man.test.d.ts.map +0 -1
  60. package/out/test/Wallet/local/localWallet2.man.test.js +0 -284
  61. package/out/test/Wallet/local/localWallet2.man.test.js.map +0 -1
  62. package/out/test/Wallet/signAction/mountaintop.man.test.d.ts +0 -2
  63. package/out/test/Wallet/signAction/mountaintop.man.test.d.ts.map +0 -1
  64. package/out/test/Wallet/signAction/mountaintop.man.test.js +0 -109
  65. package/out/test/Wallet/signAction/mountaintop.man.test.js.map +0 -1
  66. package/out/test/Wallet/specOps/specOps.man.test.d.ts +0 -2
  67. package/out/test/Wallet/specOps/specOps.man.test.d.ts.map +0 -1
  68. package/out/test/Wallet/specOps/specOps.man.test.js +0 -163
  69. package/out/test/Wallet/specOps/specOps.man.test.js.map +0 -1
  70. package/out/test/Wallet/support/janitor.man.test.d.ts +0 -2
  71. package/out/test/Wallet/support/janitor.man.test.d.ts.map +0 -1
  72. package/out/test/Wallet/support/janitor.man.test.js +0 -38
  73. package/out/test/Wallet/support/janitor.man.test.js.map +0 -1
  74. package/out/test/Wallet/support/operations.man.test.d.ts +0 -2
  75. package/out/test/Wallet/support/operations.man.test.d.ts.map +0 -1
  76. package/out/test/Wallet/support/operations.man.test.js +0 -370
  77. package/out/test/Wallet/support/operations.man.test.js.map +0 -1
  78. package/out/test/Wallet/support/reqErrorReview.2025.05.06.man.test.d.ts +0 -2
  79. package/out/test/Wallet/support/reqErrorReview.2025.05.06.man.test.d.ts.map +0 -1
  80. package/out/test/Wallet/support/reqErrorReview.2025.05.06.man.test.js +0 -385
  81. package/out/test/Wallet/support/reqErrorReview.2025.05.06.man.test.js.map +0 -1
  82. package/out/test/Wallet/sync/Wallet.updateWalletLegacyTestData.man.test.d.ts +0 -2
  83. package/out/test/Wallet/sync/Wallet.updateWalletLegacyTestData.man.test.d.ts.map +0 -1
  84. package/out/test/Wallet/sync/Wallet.updateWalletLegacyTestData.man.test.js +0 -206
  85. package/out/test/Wallet/sync/Wallet.updateWalletLegacyTestData.man.test.js.map +0 -1
  86. package/out/test/Wallet/sync/setActive.test.d.ts +0 -2
  87. package/out/test/Wallet/sync/setActive.test.d.ts.map +0 -1
  88. package/out/test/Wallet/sync/setActive.test.js +0 -161
  89. package/out/test/Wallet/sync/setActive.test.js.map +0 -1
  90. package/out/test/WalletClient/LocalKVStore.man.test.d.ts +0 -2
  91. package/out/test/WalletClient/LocalKVStore.man.test.d.ts.map +0 -1
  92. package/out/test/WalletClient/LocalKVStore.man.test.js +0 -99
  93. package/out/test/WalletClient/LocalKVStore.man.test.js.map +0 -1
  94. package/out/test/WalletClient/WERR.man.test.d.ts +0 -2
  95. package/out/test/WalletClient/WERR.man.test.d.ts.map +0 -1
  96. package/out/test/WalletClient/WERR.man.test.js +0 -34
  97. package/out/test/WalletClient/WERR.man.test.js.map +0 -1
  98. package/out/test/bsv-ts-sdk/LocalKVStore.test.d.ts +0 -2
  99. package/out/test/bsv-ts-sdk/LocalKVStore.test.d.ts.map +0 -1
  100. package/out/test/bsv-ts-sdk/LocalKVStore.test.js +0 -98
  101. package/out/test/bsv-ts-sdk/LocalKVStore.test.js.map +0 -1
  102. package/out/test/checkDB.d.ts +0 -4
  103. package/out/test/checkDB.d.ts.map +0 -1
  104. package/out/test/checkDB.js +0 -55
  105. package/out/test/checkDB.js.map +0 -1
  106. package/out/test/examples/backup.man.test.d.ts +0 -14
  107. package/out/test/examples/backup.man.test.d.ts.map +0 -1
  108. package/out/test/examples/backup.man.test.js +0 -59
  109. package/out/test/examples/backup.man.test.js.map +0 -1
  110. package/out/test/examples/pushdrop.test.d.ts +0 -56
  111. package/out/test/examples/pushdrop.test.d.ts.map +0 -1
  112. package/out/test/examples/pushdrop.test.js +0 -232
  113. package/out/test/examples/pushdrop.test.js.map +0 -1
  114. package/out/test/monitor/Monitor.test.d.ts +0 -2
  115. package/out/test/monitor/Monitor.test.d.ts.map +0 -1
  116. package/out/test/monitor/Monitor.test.js +0 -560
  117. package/out/test/monitor/Monitor.test.js.map +0 -1
  118. package/out/test/services/Services.test.d.ts +0 -2
  119. package/out/test/services/Services.test.d.ts.map +0 -1
  120. package/out/test/services/Services.test.js +0 -246
  121. package/out/test/services/Services.test.js.map +0 -1
  122. package/out/test/storage/KnexMigrations.test.d.ts +0 -2
  123. package/out/test/storage/KnexMigrations.test.d.ts.map +0 -1
  124. package/out/test/storage/KnexMigrations.test.js +0 -81
  125. package/out/test/storage/KnexMigrations.test.js.map +0 -1
  126. package/out/test/storage/StorageMySQLDojoReader.man.test.d.ts +0 -2
  127. package/out/test/storage/StorageMySQLDojoReader.man.test.d.ts.map +0 -1
  128. package/out/test/storage/StorageMySQLDojoReader.man.test.js +0 -86
  129. package/out/test/storage/StorageMySQLDojoReader.man.test.js.map +0 -1
  130. package/out/test/storage/count.test.d.ts +0 -2
  131. package/out/test/storage/count.test.d.ts.map +0 -1
  132. package/out/test/storage/count.test.js +0 -142
  133. package/out/test/storage/count.test.js.map +0 -1
  134. package/out/test/storage/find.test.d.ts +0 -2
  135. package/out/test/storage/find.test.d.ts.map +0 -1
  136. package/out/test/storage/find.test.js +0 -144
  137. package/out/test/storage/find.test.js.map +0 -1
  138. package/out/test/storage/findLegacy.test.d.ts +0 -2
  139. package/out/test/storage/findLegacy.test.d.ts.map +0 -1
  140. package/out/test/storage/findLegacy.test.js +0 -52
  141. package/out/test/storage/findLegacy.test.js.map +0 -1
  142. package/out/test/storage/idb/allocateChange.test.d.ts +0 -2
  143. package/out/test/storage/idb/allocateChange.test.d.ts.map +0 -1
  144. package/out/test/storage/idb/allocateChange.test.js +0 -110
  145. package/out/test/storage/idb/allocateChange.test.js.map +0 -1
  146. package/out/test/storage/idb/count.test.d.ts +0 -2
  147. package/out/test/storage/idb/count.test.d.ts.map +0 -1
  148. package/out/test/storage/idb/count.test.js +0 -129
  149. package/out/test/storage/idb/count.test.js.map +0 -1
  150. package/out/test/storage/idb/find.test.d.ts +0 -2
  151. package/out/test/storage/idb/find.test.d.ts.map +0 -1
  152. package/out/test/storage/idb/find.test.js +0 -131
  153. package/out/test/storage/idb/find.test.js.map +0 -1
  154. package/out/test/storage/idb/idbSpeed.test.d.ts +0 -2
  155. package/out/test/storage/idb/idbSpeed.test.d.ts.map +0 -1
  156. package/out/test/storage/idb/idbSpeed.test.js +0 -30
  157. package/out/test/storage/idb/idbSpeed.test.js.map +0 -1
  158. package/out/test/storage/idb/insert.test.d.ts +0 -2
  159. package/out/test/storage/idb/insert.test.d.ts.map +0 -1
  160. package/out/test/storage/idb/insert.test.js +0 -242
  161. package/out/test/storage/idb/insert.test.js.map +0 -1
  162. package/out/test/storage/idb/transactionAbort.test.d.ts +0 -2
  163. package/out/test/storage/idb/transactionAbort.test.d.ts.map +0 -1
  164. package/out/test/storage/idb/transactionAbort.test.js +0 -97
  165. package/out/test/storage/idb/transactionAbort.test.js.map +0 -1
  166. package/out/test/storage/idb/update.test.d.ts +0 -2
  167. package/out/test/storage/idb/update.test.d.ts.map +0 -1
  168. package/out/test/storage/idb/update.test.js +0 -902
  169. package/out/test/storage/idb/update.test.js.map +0 -1
  170. package/out/test/storage/insert.test.d.ts +0 -2
  171. package/out/test/storage/insert.test.d.ts.map +0 -1
  172. package/out/test/storage/insert.test.js +0 -256
  173. package/out/test/storage/insert.test.js.map +0 -1
  174. package/out/test/storage/update.test.d.ts +0 -2
  175. package/out/test/storage/update.test.d.ts.map +0 -1
  176. package/out/test/storage/update.test.js +0 -919
  177. package/out/test/storage/update.test.js.map +0 -1
  178. package/out/test/storage/update2.test.d.ts +0 -2
  179. package/out/test/storage/update2.test.d.ts.map +0 -1
  180. package/out/test/storage/update2.test.js +0 -767
  181. package/out/test/storage/update2.test.js.map +0 -1
  182. package/out/test/utils/TestUtilsWalletStorage.d.ts +0 -523
  183. package/out/test/utils/TestUtilsWalletStorage.d.ts.map +0 -1
  184. package/out/test/utils/TestUtilsWalletStorage.js +0 -1958
  185. package/out/test/utils/TestUtilsWalletStorage.js.map +0 -1
  186. package/out/test/utils/localWalletMethods.d.ts +0 -33
  187. package/out/test/utils/localWalletMethods.d.ts.map +0 -1
  188. package/out/test/utils/localWalletMethods.js +0 -304
  189. package/out/test/utils/localWalletMethods.js.map +0 -1
  190. package/out/test/wallet/action/abortAction.test.d.ts +0 -2
  191. package/out/test/wallet/action/abortAction.test.d.ts.map +0 -1
  192. package/out/test/wallet/action/abortAction.test.js +0 -44
  193. package/out/test/wallet/action/abortAction.test.js.map +0 -1
  194. package/out/test/wallet/action/createAction.test.d.ts +0 -2
  195. package/out/test/wallet/action/createAction.test.d.ts.map +0 -1
  196. package/out/test/wallet/action/createAction.test.js +0 -272
  197. package/out/test/wallet/action/createAction.test.js.map +0 -1
  198. package/out/test/wallet/action/createAction2.test.d.ts +0 -37
  199. package/out/test/wallet/action/createAction2.test.d.ts.map +0 -1
  200. package/out/test/wallet/action/createAction2.test.js +0 -1143
  201. package/out/test/wallet/action/createAction2.test.js.map +0 -1
  202. package/out/test/wallet/action/createActionToGenerateBeefs.man.test.d.ts +0 -2
  203. package/out/test/wallet/action/createActionToGenerateBeefs.man.test.d.ts.map +0 -1
  204. package/out/test/wallet/action/createActionToGenerateBeefs.man.test.js +0 -273
  205. package/out/test/wallet/action/createActionToGenerateBeefs.man.test.js.map +0 -1
  206. package/out/test/wallet/action/internalizeAction.test.d.ts +0 -2
  207. package/out/test/wallet/action/internalizeAction.test.d.ts.map +0 -1
  208. package/out/test/wallet/action/internalizeAction.test.js +0 -608
  209. package/out/test/wallet/action/internalizeAction.test.js.map +0 -1
  210. package/out/test/wallet/action/relinquishOutput.test.d.ts +0 -2
  211. package/out/test/wallet/action/relinquishOutput.test.d.ts.map +0 -1
  212. package/out/test/wallet/action/relinquishOutput.test.js +0 -31
  213. package/out/test/wallet/action/relinquishOutput.test.js.map +0 -1
  214. package/out/test/wallet/construct/Wallet.constructor.test.d.ts +0 -2
  215. package/out/test/wallet/construct/Wallet.constructor.test.d.ts.map +0 -1
  216. package/out/test/wallet/construct/Wallet.constructor.test.js +0 -49
  217. package/out/test/wallet/construct/Wallet.constructor.test.js.map +0 -1
  218. package/out/test/wallet/list/listActions.test.d.ts +0 -2
  219. package/out/test/wallet/list/listActions.test.d.ts.map +0 -1
  220. package/out/test/wallet/list/listActions.test.js +0 -271
  221. package/out/test/wallet/list/listActions.test.js.map +0 -1
  222. package/out/test/wallet/list/listActions2.test.d.ts +0 -2
  223. package/out/test/wallet/list/listActions2.test.d.ts.map +0 -1
  224. package/out/test/wallet/list/listActions2.test.js +0 -1141
  225. package/out/test/wallet/list/listActions2.test.js.map +0 -1
  226. package/out/test/wallet/list/listCertificates.test.d.ts +0 -2
  227. package/out/test/wallet/list/listCertificates.test.d.ts.map +0 -1
  228. package/out/test/wallet/list/listCertificates.test.js +0 -111
  229. package/out/test/wallet/list/listCertificates.test.js.map +0 -1
  230. package/out/test/wallet/list/listOutputs.test.d.ts +0 -2
  231. package/out/test/wallet/list/listOutputs.test.d.ts.map +0 -1
  232. package/out/test/wallet/list/listOutputs.test.js +0 -424
  233. package/out/test/wallet/list/listOutputs.test.js.map +0 -1
  234. package/out/test/wallet/sync/Wallet.sync.test.d.ts +0 -2
  235. package/out/test/wallet/sync/Wallet.sync.test.d.ts.map +0 -1
  236. package/out/test/wallet/sync/Wallet.sync.test.js +0 -155
  237. package/out/test/wallet/sync/Wallet.sync.test.js.map +0 -1
  238. package/out/tsconfig.all.tsbuildinfo +0 -1
  239. package/src/CWIStyleWalletManager.ts +0 -1999
  240. package/src/Setup.ts +0 -579
  241. package/src/SetupClient.ts +0 -322
  242. package/src/SetupWallet.ts +0 -108
  243. package/src/SimpleWalletManager.ts +0 -526
  244. package/src/Wallet.ts +0 -1169
  245. package/src/WalletAuthenticationManager.ts +0 -153
  246. package/src/WalletLogger.ts +0 -213
  247. package/src/WalletPermissionsManager.ts +0 -3660
  248. package/src/WalletSettingsManager.ts +0 -114
  249. package/src/__tests/CWIStyleWalletManager.test.d.ts.map +0 -1
  250. package/src/__tests/CWIStyleWalletManager.test.js.map +0 -1
  251. package/src/__tests/CWIStyleWalletManager.test.ts +0 -675
  252. package/src/__tests/WalletPermissionsManager.callbacks.test.ts +0 -323
  253. package/src/__tests/WalletPermissionsManager.checks.test.ts +0 -844
  254. package/src/__tests/WalletPermissionsManager.encryption.test.ts +0 -412
  255. package/src/__tests/WalletPermissionsManager.fixtures.ts +0 -307
  256. package/src/__tests/WalletPermissionsManager.flows.test.ts +0 -462
  257. package/src/__tests/WalletPermissionsManager.initialization.test.ts +0 -300
  258. package/src/__tests/WalletPermissionsManager.pmodules.test.ts +0 -798
  259. package/src/__tests/WalletPermissionsManager.proxying.test.ts +0 -724
  260. package/src/__tests/WalletPermissionsManager.tokens.test.ts +0 -503
  261. package/src/index.all.ts +0 -27
  262. package/src/index.client.ts +0 -25
  263. package/src/index.mobile.ts +0 -21
  264. package/src/index.ts +0 -1
  265. package/src/monitor/Monitor.ts +0 -412
  266. package/src/monitor/MonitorDaemon.ts +0 -188
  267. package/src/monitor/README.md +0 -3
  268. package/src/monitor/__test/MonitorDaemon.man.test.ts +0 -45
  269. package/src/monitor/tasks/TaskCheckForProofs.ts +0 -243
  270. package/src/monitor/tasks/TaskCheckNoSends.ts +0 -73
  271. package/src/monitor/tasks/TaskClock.ts +0 -33
  272. package/src/monitor/tasks/TaskFailAbandoned.ts +0 -54
  273. package/src/monitor/tasks/TaskMonitorCallHistory.ts +0 -26
  274. package/src/monitor/tasks/TaskNewHeader.ts +0 -93
  275. package/src/monitor/tasks/TaskPurge.ts +0 -68
  276. package/src/monitor/tasks/TaskReorg.ts +0 -89
  277. package/src/monitor/tasks/TaskReviewStatus.ts +0 -48
  278. package/src/monitor/tasks/TaskSendWaiting.ts +0 -122
  279. package/src/monitor/tasks/TaskSyncWhenIdle.ts +0 -26
  280. package/src/monitor/tasks/TaskUnFail.ts +0 -151
  281. package/src/monitor/tasks/WalletMonitorTask.ts +0 -47
  282. package/src/sdk/CertOpsWallet.ts +0 -18
  283. package/src/sdk/PrivilegedKeyManager.ts +0 -372
  284. package/src/sdk/README.md +0 -13
  285. package/src/sdk/WERR_errors.ts +0 -234
  286. package/src/sdk/WalletError.ts +0 -170
  287. package/src/sdk/WalletErrorFromJson.ts +0 -80
  288. package/src/sdk/WalletServices.interfaces.ts +0 -700
  289. package/src/sdk/WalletSigner.interfaces.ts +0 -11
  290. package/src/sdk/WalletStorage.interfaces.ts +0 -606
  291. package/src/sdk/__test/CertificateLifeCycle.test.ts +0 -131
  292. package/src/sdk/__test/PrivilegedKeyManager.test.ts +0 -738
  293. package/src/sdk/__test/WalletError.test.ts +0 -318
  294. package/src/sdk/__test/validationHelpers.test.ts +0 -21
  295. package/src/sdk/index.ts +0 -10
  296. package/src/sdk/types.ts +0 -226
  297. package/src/services/README.md +0 -11
  298. package/src/services/ServiceCollection.ts +0 -248
  299. package/src/services/Services.ts +0 -603
  300. package/src/services/__tests/ARC.man.test.ts +0 -123
  301. package/src/services/__tests/ARC.timeout.man.test.ts +0 -79
  302. package/src/services/__tests/ArcGorillaPool.man.test.ts +0 -108
  303. package/src/services/__tests/arcServices.test.ts +0 -8
  304. package/src/services/__tests/bitrails.test.ts +0 -56
  305. package/src/services/__tests/getMerklePath.test.ts +0 -15
  306. package/src/services/__tests/getRawTx.test.ts +0 -13
  307. package/src/services/__tests/postBeef.test.ts +0 -104
  308. package/src/services/__tests/verifyBeef.test.ts +0 -50
  309. package/src/services/chaintracker/BHServiceClient.ts +0 -212
  310. package/src/services/chaintracker/ChaintracksChainTracker.ts +0 -71
  311. package/src/services/chaintracker/__tests/ChaintracksChainTracker.test.ts +0 -33
  312. package/src/services/chaintracker/__tests/ChaintracksServiceClient.test.ts +0 -29
  313. package/src/services/chaintracker/chaintracks/Api/BlockHeaderApi.ts +0 -72
  314. package/src/services/chaintracker/chaintracks/Api/BulkIngestorApi.ts +0 -83
  315. package/src/services/chaintracker/chaintracks/Api/BulkStorageApi.ts +0 -92
  316. package/src/services/chaintracker/chaintracks/Api/ChaintracksApi.ts +0 -64
  317. package/src/services/chaintracker/chaintracks/Api/ChaintracksClientApi.ts +0 -189
  318. package/src/services/chaintracker/chaintracks/Api/ChaintracksFetchApi.ts +0 -18
  319. package/src/services/chaintracker/chaintracks/Api/ChaintracksFsApi.ts +0 -58
  320. package/src/services/chaintracker/chaintracks/Api/ChaintracksStorageApi.ts +0 -386
  321. package/src/services/chaintracker/chaintracks/Api/LiveIngestorApi.ts +0 -25
  322. package/src/services/chaintracker/chaintracks/Chaintracks.ts +0 -609
  323. package/src/services/chaintracker/chaintracks/ChaintracksService.ts +0 -199
  324. package/src/services/chaintracker/chaintracks/ChaintracksServiceClient.ts +0 -154
  325. package/src/services/chaintracker/chaintracks/Ingest/BulkIngestorBase.ts +0 -176
  326. package/src/services/chaintracker/chaintracks/Ingest/BulkIngestorCDN.ts +0 -174
  327. package/src/services/chaintracker/chaintracks/Ingest/BulkIngestorCDNBabbage.ts +0 -18
  328. package/src/services/chaintracker/chaintracks/Ingest/BulkIngestorWhatsOnChainCdn.ts +0 -113
  329. package/src/services/chaintracker/chaintracks/Ingest/BulkIngestorWhatsOnChainWs.ts +0 -81
  330. package/src/services/chaintracker/chaintracks/Ingest/LiveIngestorBase.ts +0 -86
  331. package/src/services/chaintracker/chaintracks/Ingest/LiveIngestorTeranodeP2P.ts +0 -59
  332. package/src/services/chaintracker/chaintracks/Ingest/LiveIngestorWhatsOnChainPoll.ts +0 -104
  333. package/src/services/chaintracker/chaintracks/Ingest/LiveIngestorWhatsOnChainWs.ts +0 -66
  334. package/src/services/chaintracker/chaintracks/Ingest/WhatsOnChainIngestorWs.ts +0 -566
  335. package/src/services/chaintracker/chaintracks/Ingest/WhatsOnChainServices.ts +0 -219
  336. package/src/services/chaintracker/chaintracks/Ingest/__tests/BulkIngestorCDNBabbage.test.ts +0 -54
  337. package/src/services/chaintracker/chaintracks/Ingest/__tests/LiveIngestorWhatsOnChainPoll.test.ts +0 -33
  338. package/src/services/chaintracker/chaintracks/Ingest/__tests/WhatsOnChainServices.test.ts +0 -124
  339. package/src/services/chaintracker/chaintracks/Storage/BulkStorageBase.ts +0 -92
  340. package/src/services/chaintracker/chaintracks/Storage/ChaintracksKnexMigrations.ts +0 -104
  341. package/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageBase.ts +0 -382
  342. package/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageIdb.ts +0 -574
  343. package/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageKnex.ts +0 -438
  344. package/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageMemory.ts +0 -29
  345. package/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageNoDb.ts +0 -304
  346. package/src/services/chaintracker/chaintracks/Storage/__tests/ChaintracksStorageIdb.test.ts +0 -102
  347. package/src/services/chaintracker/chaintracks/Storage/__tests/ChaintracksStorageKnex.test.ts +0 -45
  348. package/src/services/chaintracker/chaintracks/__tests/Chaintracks.test.ts +0 -77
  349. package/src/services/chaintracker/chaintracks/__tests/ChaintracksClientApi.test.ts +0 -192
  350. package/src/services/chaintracker/chaintracks/__tests/LocalCdnServer.ts +0 -75
  351. package/src/services/chaintracker/chaintracks/__tests/createIdbChaintracks.test.ts +0 -62
  352. package/src/services/chaintracker/chaintracks/__tests/data/cdnTest349/mainNetBlockHeaders.json +0 -1
  353. package/src/services/chaintracker/chaintracks/__tests/data/cdnTest349/mainNet_0.headers +0 -0
  354. package/src/services/chaintracker/chaintracks/__tests/data/cdnTest349/mainNet_1.headers +0 -0
  355. package/src/services/chaintracker/chaintracks/__tests/data/cdnTest349/mainNet_2.headers +0 -0
  356. package/src/services/chaintracker/chaintracks/__tests/data/cdnTest349/mainNet_3.headers +0 -0
  357. package/src/services/chaintracker/chaintracks/__tests/data/cdnTest379/mainNetBlockHeaders.json +0 -1
  358. package/src/services/chaintracker/chaintracks/__tests/data/cdnTest379/mainNet_0.headers +0 -0
  359. package/src/services/chaintracker/chaintracks/__tests/data/cdnTest379/mainNet_1.headers +0 -0
  360. package/src/services/chaintracker/chaintracks/__tests/data/cdnTest379/mainNet_2.headers +0 -0
  361. package/src/services/chaintracker/chaintracks/__tests/data/cdnTest379/mainNet_3.headers +0 -0
  362. package/src/services/chaintracker/chaintracks/__tests/data/cdnTest399/mainNetBlockHeaders.json +0 -1
  363. package/src/services/chaintracker/chaintracks/__tests/data/cdnTest399/mainNet_0.headers +0 -0
  364. package/src/services/chaintracker/chaintracks/__tests/data/cdnTest399/mainNet_1.headers +0 -0
  365. package/src/services/chaintracker/chaintracks/__tests/data/cdnTest399/mainNet_2.headers +0 -0
  366. package/src/services/chaintracker/chaintracks/__tests/data/cdnTest399/mainNet_3.headers +0 -0
  367. package/src/services/chaintracker/chaintracks/__tests/data/cdnTest402/mainNetBlockHeaders.json +0 -1
  368. package/src/services/chaintracker/chaintracks/__tests/data/cdnTest402/mainNet_0.headers +0 -0
  369. package/src/services/chaintracker/chaintracks/__tests/data/cdnTest402/mainNet_1.headers +0 -0
  370. package/src/services/chaintracker/chaintracks/__tests/data/cdnTest402/mainNet_2.headers +0 -0
  371. package/src/services/chaintracker/chaintracks/__tests/data/cdnTest402/mainNet_3.headers +0 -0
  372. package/src/services/chaintracker/chaintracks/__tests/data/cdnTest402/mainNet_4.headers +0 -0
  373. package/src/services/chaintracker/chaintracks/__tests/data/cdnTest499/mainNetBlockHeaders.json +0 -1
  374. package/src/services/chaintracker/chaintracks/__tests/data/cdnTest499/mainNet_0.headers +0 -0
  375. package/src/services/chaintracker/chaintracks/__tests/data/cdnTest499/mainNet_1.headers +0 -0
  376. package/src/services/chaintracker/chaintracks/__tests/data/cdnTest499/mainNet_2.headers +0 -0
  377. package/src/services/chaintracker/chaintracks/__tests/data/cdnTest499/mainNet_3.headers +0 -0
  378. package/src/services/chaintracker/chaintracks/__tests/data/cdnTest499/mainNet_4.headers +0 -0
  379. package/src/services/chaintracker/chaintracks/createDefaultIdbChaintracksOptions.ts +0 -92
  380. package/src/services/chaintracker/chaintracks/createDefaultKnexChaintracksOptions.ts +0 -111
  381. package/src/services/chaintracker/chaintracks/createDefaultNoDbChaintracksOptions.ts +0 -91
  382. package/src/services/chaintracker/chaintracks/createIdbChaintracks.ts +0 -60
  383. package/src/services/chaintracker/chaintracks/createKnexChaintracks.ts +0 -65
  384. package/src/services/chaintracker/chaintracks/createNoDbChaintracks.ts +0 -60
  385. package/src/services/chaintracker/chaintracks/index.all.ts +0 -12
  386. package/src/services/chaintracker/chaintracks/index.client.ts +0 -4
  387. package/src/services/chaintracker/chaintracks/index.mobile.ts +0 -37
  388. package/src/services/chaintracker/chaintracks/util/BulkFileDataManager.ts +0 -975
  389. package/src/services/chaintracker/chaintracks/util/BulkFileDataReader.ts +0 -60
  390. package/src/services/chaintracker/chaintracks/util/BulkFilesReader.ts +0 -336
  391. package/src/services/chaintracker/chaintracks/util/BulkHeaderFile.ts +0 -247
  392. package/src/services/chaintracker/chaintracks/util/ChaintracksFetch.ts +0 -69
  393. package/src/services/chaintracker/chaintracks/util/ChaintracksFs.ts +0 -141
  394. package/src/services/chaintracker/chaintracks/util/HeightRange.ts +0 -153
  395. package/src/services/chaintracker/chaintracks/util/SingleWriterMultiReaderLock.ts +0 -76
  396. package/src/services/chaintracker/chaintracks/util/__tests/BulkFileDataManager.test.ts +0 -304
  397. package/src/services/chaintracker/chaintracks/util/__tests/ChaintracksFetch.test.ts +0 -60
  398. package/src/services/chaintracker/chaintracks/util/__tests/HeightRange.test.ts +0 -67
  399. package/src/services/chaintracker/chaintracks/util/__tests/SingleWriterMultiReaderLock.test.ts +0 -49
  400. package/src/services/chaintracker/chaintracks/util/blockHeaderUtilities.ts +0 -573
  401. package/src/services/chaintracker/chaintracks/util/dirtyHashes.ts +0 -29
  402. package/src/services/chaintracker/chaintracks/util/validBulkHeaderFilesByFileHash.ts +0 -432
  403. package/src/services/chaintracker/index.all.ts +0 -4
  404. package/src/services/chaintracker/index.client.ts +0 -4
  405. package/src/services/chaintracker/index.mobile.ts +0 -4
  406. package/src/services/createDefaultWalletServicesOptions.ts +0 -77
  407. package/src/services/index.ts +0 -1
  408. package/src/services/processingErrors/arcSuccessError.json +0 -76
  409. package/src/services/providers/ARC.ts +0 -350
  410. package/src/services/providers/Bitails.ts +0 -256
  411. package/src/services/providers/SdkWhatsOnChain.ts +0 -83
  412. package/src/services/providers/WhatsOnChain.ts +0 -883
  413. package/src/services/providers/__tests/WhatsOnChain.test.ts +0 -242
  414. package/src/services/providers/__tests/exchangeRates.test.ts +0 -18
  415. package/src/services/providers/exchangeRates.ts +0 -265
  416. package/src/services/providers/getBeefForTxid.ts +0 -369
  417. package/src/signer/README.md +0 -5
  418. package/src/signer/WalletSigner.ts +0 -17
  419. package/src/signer/methods/acquireDirectCertificate.ts +0 -52
  420. package/src/signer/methods/buildSignableTransaction.ts +0 -183
  421. package/src/signer/methods/completeSignedTransaction.ts +0 -117
  422. package/src/signer/methods/createAction.ts +0 -172
  423. package/src/signer/methods/internalizeAction.ts +0 -106
  424. package/src/signer/methods/proveCertificate.ts +0 -43
  425. package/src/signer/methods/signAction.ts +0 -54
  426. package/src/storage/README.md +0 -14
  427. package/src/storage/StorageIdb.ts +0 -2304
  428. package/src/storage/StorageKnex.ts +0 -1425
  429. package/src/storage/StorageProvider.ts +0 -810
  430. package/src/storage/StorageReader.ts +0 -194
  431. package/src/storage/StorageReaderWriter.ts +0 -432
  432. package/src/storage/StorageSyncReader.ts +0 -34
  433. package/src/storage/WalletStorageManager.ts +0 -943
  434. package/src/storage/__test/StorageIdb.test.ts +0 -43
  435. package/src/storage/__test/WalletStorageManager.test.ts +0 -275
  436. package/src/storage/__test/adminStats.man.test.ts +0 -89
  437. package/src/storage/__test/getBeefForTransaction.test.ts +0 -385
  438. package/src/storage/index.all.ts +0 -11
  439. package/src/storage/index.client.ts +0 -7
  440. package/src/storage/index.mobile.ts +0 -6
  441. package/src/storage/methods/ListActionsSpecOp.ts +0 -70
  442. package/src/storage/methods/ListOutputsSpecOp.ts +0 -129
  443. package/src/storage/methods/__test/GenerateChange/generateChangeSdk.test.ts +0 -1057
  444. package/src/storage/methods/__test/GenerateChange/randomValsUsed1.ts +0 -20
  445. package/src/storage/methods/__test/offsetKey.test.ts +0 -274
  446. package/src/storage/methods/attemptToPostReqsToNetwork.ts +0 -389
  447. package/src/storage/methods/createAction.ts +0 -947
  448. package/src/storage/methods/generateChange.ts +0 -556
  449. package/src/storage/methods/getBeefForTransaction.ts +0 -139
  450. package/src/storage/methods/getSyncChunk.ts +0 -293
  451. package/src/storage/methods/internalizeAction.ts +0 -562
  452. package/src/storage/methods/listActionsIdb.ts +0 -183
  453. package/src/storage/methods/listActionsKnex.ts +0 -226
  454. package/src/storage/methods/listCertificates.ts +0 -73
  455. package/src/storage/methods/listOutputsIdb.ts +0 -203
  456. package/src/storage/methods/listOutputsKnex.ts +0 -263
  457. package/src/storage/methods/offsetKey.ts +0 -89
  458. package/src/storage/methods/processAction.ts +0 -420
  459. package/src/storage/methods/purgeData.ts +0 -251
  460. package/src/storage/methods/purgeDataIdb.ts +0 -10
  461. package/src/storage/methods/reviewStatus.ts +0 -101
  462. package/src/storage/methods/reviewStatusIdb.ts +0 -43
  463. package/src/storage/methods/utils.Buffer.ts +0 -33
  464. package/src/storage/methods/utils.ts +0 -56
  465. package/src/storage/remoting/StorageClient.ts +0 -567
  466. package/src/storage/remoting/StorageMobile.ts +0 -544
  467. package/src/storage/remoting/StorageServer.ts +0 -291
  468. package/src/storage/remoting/__test/StorageClient.test.ts +0 -113
  469. package/src/storage/schema/KnexMigrations.ts +0 -489
  470. package/src/storage/schema/StorageIdbSchema.ts +0 -150
  471. package/src/storage/schema/entities/EntityBase.ts +0 -210
  472. package/src/storage/schema/entities/EntityCertificate.ts +0 -188
  473. package/src/storage/schema/entities/EntityCertificateField.ts +0 -136
  474. package/src/storage/schema/entities/EntityCommission.ts +0 -148
  475. package/src/storage/schema/entities/EntityOutput.ts +0 -290
  476. package/src/storage/schema/entities/EntityOutputBasket.ts +0 -153
  477. package/src/storage/schema/entities/EntityOutputTag.ts +0 -121
  478. package/src/storage/schema/entities/EntityOutputTagMap.ts +0 -123
  479. package/src/storage/schema/entities/EntityProvenTx.ts +0 -319
  480. package/src/storage/schema/entities/EntityProvenTxReq.ts +0 -580
  481. package/src/storage/schema/entities/EntitySyncState.ts +0 -389
  482. package/src/storage/schema/entities/EntityTransaction.ts +0 -306
  483. package/src/storage/schema/entities/EntityTxLabel.ts +0 -121
  484. package/src/storage/schema/entities/EntityTxLabelMap.ts +0 -123
  485. package/src/storage/schema/entities/EntityUser.ts +0 -112
  486. package/src/storage/schema/entities/MergeEntity.ts +0 -73
  487. package/src/storage/schema/entities/__tests/CertificateFieldTests.test.ts +0 -353
  488. package/src/storage/schema/entities/__tests/CertificateTests.test.ts +0 -354
  489. package/src/storage/schema/entities/__tests/CommissionTests.test.ts +0 -371
  490. package/src/storage/schema/entities/__tests/OutputBasketTests.test.ts +0 -278
  491. package/src/storage/schema/entities/__tests/OutputTagMapTests.test.ts +0 -242
  492. package/src/storage/schema/entities/__tests/OutputTagTests.test.ts +0 -288
  493. package/src/storage/schema/entities/__tests/OutputTests.test.ts +0 -464
  494. package/src/storage/schema/entities/__tests/ProvenTxReqTests.test.ts +0 -340
  495. package/src/storage/schema/entities/__tests/ProvenTxTests.test.ts +0 -504
  496. package/src/storage/schema/entities/__tests/SyncStateTests.test.ts +0 -288
  497. package/src/storage/schema/entities/__tests/TransactionTests.test.ts +0 -604
  498. package/src/storage/schema/entities/__tests/TxLabelMapTests.test.ts +0 -361
  499. package/src/storage/schema/entities/__tests/TxLabelTests.test.ts +0 -198
  500. package/src/storage/schema/entities/__tests/stampLogTests.test.ts +0 -90
  501. package/src/storage/schema/entities/__tests/usersTests.test.ts +0 -340
  502. package/src/storage/schema/entities/index.ts +0 -16
  503. package/src/storage/schema/tables/TableCertificate.ts +0 -21
  504. package/src/storage/schema/tables/TableCertificateField.ts +0 -12
  505. package/src/storage/schema/tables/TableCommission.ts +0 -13
  506. package/src/storage/schema/tables/TableMonitorEvent.ts +0 -9
  507. package/src/storage/schema/tables/TableOutput.ts +0 -64
  508. package/src/storage/schema/tables/TableOutputBasket.ts +0 -12
  509. package/src/storage/schema/tables/TableOutputTag.ts +0 -10
  510. package/src/storage/schema/tables/TableOutputTagMap.ts +0 -9
  511. package/src/storage/schema/tables/TableProvenTx.ts +0 -14
  512. package/src/storage/schema/tables/TableProvenTxReq.ts +0 -65
  513. package/src/storage/schema/tables/TableSettings.ts +0 -17
  514. package/src/storage/schema/tables/TableSyncState.ts +0 -18
  515. package/src/storage/schema/tables/TableTransaction.ts +0 -54
  516. package/src/storage/schema/tables/TableTxLabel.ts +0 -10
  517. package/src/storage/schema/tables/TableTxLabelMap.ts +0 -9
  518. package/src/storage/schema/tables/TableUser.ts +0 -16
  519. package/src/storage/schema/tables/index.ts +0 -16
  520. package/src/storage/sync/StorageMySQLDojoReader.ts +0 -696
  521. package/src/storage/sync/index.ts +0 -1
  522. package/src/utility/Format.ts +0 -133
  523. package/src/utility/README.md +0 -3
  524. package/src/utility/ReaderUint8Array.ts +0 -187
  525. package/src/utility/ScriptTemplateBRC29.ts +0 -73
  526. package/src/utility/__tests/utilityHelpers.noBuffer.test.ts +0 -109
  527. package/src/utility/aggregateResults.ts +0 -68
  528. package/src/utility/identityUtils.ts +0 -159
  529. package/src/utility/index.all.ts +0 -7
  530. package/src/utility/index.client.ts +0 -7
  531. package/src/utility/parseTxScriptOffsets.ts +0 -29
  532. package/src/utility/stampLog.ts +0 -69
  533. package/src/utility/tscProofToMerklePath.ts +0 -48
  534. package/src/utility/utilityHelpers.buffer.ts +0 -34
  535. package/src/utility/utilityHelpers.noBuffer.ts +0 -60
  536. package/src/utility/utilityHelpers.ts +0 -275
  537. package/src/wab-client/WABClient.ts +0 -94
  538. package/src/wab-client/__tests/WABClient.man.test.ts +0 -59
  539. package/src/wab-client/auth-method-interactors/AuthMethodInteractor.ts +0 -47
  540. package/src/wab-client/auth-method-interactors/DevConsoleInteractor.ts +0 -73
  541. package/src/wab-client/auth-method-interactors/PersonaIDInteractor.ts +0 -35
  542. package/src/wab-client/auth-method-interactors/TwilioPhoneInteractor.ts +0 -72
  543. package/syncVersions.js +0 -71
  544. package/test/Wallet/StorageClient/storageClient.man.test.ts +0 -75
  545. package/test/Wallet/action/internalizeAction.a.test.ts +0 -286
  546. package/test/Wallet/certificate/acquireCertificate.test.ts +0 -298
  547. package/test/Wallet/certificate/listCertificates.test.ts +0 -346
  548. package/test/Wallet/get/getHeaderForHeight.test.ts +0 -82
  549. package/test/Wallet/get/getHeight.test.ts +0 -52
  550. package/test/Wallet/get/getKnownTxids.test.ts +0 -86
  551. package/test/Wallet/get/getNetwork.test.ts +0 -27
  552. package/test/Wallet/get/getVersion.test.ts +0 -27
  553. package/test/Wallet/live/walletLive.man.test.ts +0 -521
  554. package/test/Wallet/local/localWallet.man.test.ts +0 -93
  555. package/test/Wallet/local/localWallet2.man.test.ts +0 -277
  556. package/test/Wallet/signAction/mountaintop.man.test.ts +0 -130
  557. package/test/Wallet/specOps/specOps.man.test.ts +0 -220
  558. package/test/Wallet/support/janitor.man.test.ts +0 -40
  559. package/test/Wallet/support/operations.man.test.ts +0 -407
  560. package/test/Wallet/support/reqErrorReview.2025.05.06.man.test.ts +0 -347
  561. package/test/Wallet/sync/Wallet.updateWalletLegacyTestData.man.test.ts +0 -203
  562. package/test/Wallet/sync/setActive.test.ts +0 -170
  563. package/test/WalletClient/LocalKVStore.man.test.ts +0 -114
  564. package/test/WalletClient/WERR.man.test.ts +0 -35
  565. package/test/bsv-ts-sdk/LocalKVStore.test.ts +0 -102
  566. package/test/checkDB.ts +0 -57
  567. package/test/checkdb +0 -0
  568. package/test/examples/backup.man.test.ts +0 -59
  569. package/test/examples/pushdrop.test.ts +0 -282
  570. package/test/monitor/Monitor.test.ts +0 -620
  571. package/test/services/Services.test.ts +0 -263
  572. package/test/storage/KnexMigrations.test.ts +0 -86
  573. package/test/storage/StorageMySQLDojoReader.man.test.ts +0 -60
  574. package/test/storage/count.test.ts +0 -177
  575. package/test/storage/find.test.ts +0 -195
  576. package/test/storage/findLegacy.test.ts +0 -67
  577. package/test/storage/idb/allocateChange.test.ts +0 -251
  578. package/test/storage/idb/count.test.ts +0 -158
  579. package/test/storage/idb/find.test.ts +0 -177
  580. package/test/storage/idb/idbSpeed.test.ts +0 -36
  581. package/test/storage/idb/insert.test.ts +0 -268
  582. package/test/storage/idb/transactionAbort.test.ts +0 -108
  583. package/test/storage/idb/update.test.ts +0 -999
  584. package/test/storage/insert.test.ts +0 -278
  585. package/test/storage/update.test.ts +0 -1021
  586. package/test/storage/update2.test.ts +0 -897
  587. package/test/utils/TestUtilsWalletStorage.ts +0 -2526
  588. package/test/utils/localWalletMethods.ts +0 -363
  589. package/test/utils/removeFailedFromDatabase.sql +0 -17
  590. package/test/wallet/action/abortAction.test.ts +0 -47
  591. package/test/wallet/action/createAction.test.ts +0 -299
  592. package/test/wallet/action/createAction2.test.ts +0 -1273
  593. package/test/wallet/action/createActionToGenerateBeefs.man.test.ts +0 -293
  594. package/test/wallet/action/internalizeAction.test.ts +0 -682
  595. package/test/wallet/action/relinquishOutput.test.ts +0 -37
  596. package/test/wallet/construct/Wallet.constructor.test.ts +0 -57
  597. package/test/wallet/list/listActions.test.ts +0 -279
  598. package/test/wallet/list/listActions2.test.ts +0 -1381
  599. package/test/wallet/list/listCertificates.test.ts +0 -118
  600. package/test/wallet/list/listOutputs.test.ts +0 -447
  601. package/test/wallet/sync/Wallet.sync.test.ts +0 -215
  602. package/ts2md.json +0 -44
  603. package/tsconfig.all.json +0 -31
  604. package/tsconfig.client.json +0 -29
  605. package/tsconfig.json +0 -17
  606. package/tsconfig.mobile.json +0 -28
@@ -1,389 +0,0 @@
1
- import {
2
- RequestSyncChunkArgs,
3
- SyncChunk,
4
- SyncStatus,
5
- TrxToken,
6
- WalletStorageSync
7
- } from '../../../sdk/WalletStorage.interfaces'
8
- import { WERR_INVALID_PARAMETER } from '../../../sdk/WERR_errors'
9
- import { maxDate, verifyId, verifyTruthy } from '../../../utility/utilityHelpers'
10
- import { TableSettings } from '../tables/TableSettings'
11
- import { TableSyncState } from '../tables/TableSyncState'
12
- import { createSyncMap, EntityBase, EntityStorage, EntitySyncMap, SyncError, SyncMap } from './EntityBase'
13
- import { EntityCertificate } from './EntityCertificate'
14
- import { EntityCertificateField } from './EntityCertificateField'
15
- import { EntityCommission } from './EntityCommission'
16
- import { EntityOutput } from './EntityOutput'
17
- import { EntityOutputBasket } from './EntityOutputBasket'
18
- import { EntityOutputTag } from './EntityOutputTag'
19
- import { EntityOutputTagMap } from './EntityOutputTagMap'
20
- import { EntityProvenTx } from './EntityProvenTx'
21
- import { EntityProvenTxReq } from './EntityProvenTxReq'
22
- import { EntityTransaction } from './EntityTransaction'
23
- import { EntityTxLabel } from './EntityTxLabel'
24
- import { EntityTxLabelMap } from './EntityTxLabelMap'
25
- import { EntityUser } from './EntityUser'
26
- import { MergeEntity } from './MergeEntity'
27
-
28
- export class EntitySyncState extends EntityBase<TableSyncState> {
29
- constructor(api?: TableSyncState) {
30
- const now = new Date()
31
- super(
32
- api || {
33
- syncStateId: 0,
34
- created_at: now,
35
- updated_at: now,
36
- userId: 0,
37
- storageIdentityKey: '',
38
- storageName: '',
39
- init: false,
40
- refNum: '',
41
- status: 'unknown',
42
- when: undefined,
43
- errorLocal: undefined,
44
- errorOther: undefined,
45
- satoshis: undefined,
46
- syncMap: JSON.stringify(createSyncMap())
47
- }
48
- )
49
- this.errorLocal = this.api.errorLocal ? <SyncError>JSON.parse(this.api.errorLocal) : undefined
50
- this.errorOther = this.api.errorOther ? <SyncError>JSON.parse(this.api.errorOther) : undefined
51
- this.syncMap = <SyncMap>JSON.parse(this.api.syncMap)
52
- this.validateSyncMap(this.syncMap)
53
- }
54
-
55
- validateSyncMap(sm: SyncMap) {
56
- for (const key of Object.keys(sm)) {
57
- const esm: EntitySyncMap = sm[key]
58
- if (typeof esm.maxUpdated_at === 'string') esm.maxUpdated_at = new Date(esm.maxUpdated_at)
59
- }
60
- }
61
-
62
- static async fromStorage(
63
- storage: WalletStorageSync,
64
- userIdentityKey: string,
65
- remoteSettings: TableSettings
66
- ): Promise<EntitySyncState> {
67
- const { user } = verifyTruthy(await storage.findOrInsertUser(userIdentityKey))
68
- let { syncState: api } = verifyTruthy(
69
- await storage.findOrInsertSyncStateAuth(
70
- { userId: user.userId, identityKey: userIdentityKey },
71
- remoteSettings.storageIdentityKey,
72
- remoteSettings.storageName
73
- )
74
- )
75
- if (!api.syncMap || api.syncMap === '{}') api.syncMap = JSON.stringify(createSyncMap())
76
- const ss = new EntitySyncState(api)
77
- return ss
78
- }
79
-
80
- /**
81
- * Handles both insert and update based on id value: zero indicates insert.
82
- * @param storage
83
- * @param notSyncMap if not new and true, excludes updating syncMap in storage.
84
- * @param trx
85
- */
86
- async updateStorage(storage: EntityStorage, notSyncMap?: boolean, trx?: TrxToken) {
87
- this.updated_at = new Date()
88
- this.updateApi(notSyncMap && this.id > 0)
89
- if (this.id === 0) {
90
- await storage.insertSyncState(this.api)
91
- } else {
92
- const update: Partial<TableSyncState> = { ...this.api }
93
- if (notSyncMap) delete update.syncMap
94
- delete update.created_at
95
- await storage.updateSyncState(verifyId(this.id), update, trx)
96
- }
97
- }
98
-
99
- override updateApi(notSyncMap?: boolean): void {
100
- this.api.errorLocal = this.apiErrorLocal
101
- this.api.errorOther = this.apiErrorOther
102
- if (!notSyncMap) this.api.syncMap = this.apiSyncMap
103
- }
104
-
105
- // Pass through api properties
106
- set created_at(v: Date) {
107
- this.api.created_at = v
108
- }
109
- get created_at() {
110
- return this.api.created_at
111
- }
112
- set updated_at(v: Date) {
113
- this.api.updated_at = v
114
- }
115
- get updated_at() {
116
- return this.api.updated_at
117
- }
118
- set userId(v: number) {
119
- this.api.userId = v
120
- }
121
- get userId() {
122
- return this.api.userId
123
- }
124
- set storageIdentityKey(v: string) {
125
- this.api.storageIdentityKey = v
126
- }
127
- get storageIdentityKey() {
128
- return this.api.storageIdentityKey
129
- }
130
- set storageName(v: string) {
131
- this.api.storageName = v
132
- }
133
- get storageName() {
134
- return this.api.storageName
135
- }
136
- set init(v: boolean) {
137
- this.api.init = v
138
- }
139
- get init() {
140
- return this.api.init
141
- }
142
- set refNum(v: string) {
143
- this.api.refNum = v
144
- }
145
- get refNum() {
146
- return this.api.refNum
147
- }
148
- set status(v: SyncStatus) {
149
- this.api.status = v
150
- }
151
- get status(): SyncStatus {
152
- return this.api.status
153
- }
154
- set when(v: Date | undefined) {
155
- this.api.when = v
156
- }
157
- get when() {
158
- return this.api.when
159
- }
160
- set satoshis(v: number | undefined) {
161
- this.api.satoshis = v
162
- }
163
- get satoshis() {
164
- return this.api.satoshis
165
- }
166
-
167
- get apiErrorLocal() {
168
- return this.errorToString(this.errorLocal)
169
- }
170
- get apiErrorOther() {
171
- return this.errorToString(this.errorOther)
172
- }
173
- get apiSyncMap() {
174
- return JSON.stringify(this.syncMap)
175
- }
176
-
177
- override get id(): number {
178
- return this.api.syncStateId
179
- }
180
- set id(id: number) {
181
- this.api.syncStateId = id
182
- }
183
- override get entityName(): string {
184
- return 'syncState'
185
- }
186
- override get entityTable(): string {
187
- return 'sync_states'
188
- }
189
-
190
- static mergeIdMap(fromMap: Record<number, number>, toMap: Record<number, number>) {
191
- for (const [key, value] of Object.entries(fromMap)) {
192
- const fromValue = fromMap[key]
193
- const toValue = toMap[key]
194
- if (toValue !== undefined && toValue !== fromValue)
195
- throw new WERR_INVALID_PARAMETER(
196
- 'syncMap',
197
- `an unmapped id or the same mapped id. ${key} maps to ${toValue} not equal to ${fromValue}`
198
- )
199
- if (toValue === undefined) toMap[key] = value
200
- }
201
- }
202
- /**
203
- * Merge additions to the syncMap
204
- * @param iSyncMap
205
- */
206
- mergeSyncMap(iSyncMap: SyncMap) {
207
- EntitySyncState.mergeIdMap(iSyncMap.provenTx.idMap!, this.syncMap.provenTx.idMap!)
208
- EntitySyncState.mergeIdMap(iSyncMap.outputBasket.idMap!, this.syncMap.outputBasket.idMap!)
209
- EntitySyncState.mergeIdMap(iSyncMap.transaction.idMap!, this.syncMap.transaction.idMap!)
210
- EntitySyncState.mergeIdMap(iSyncMap.provenTxReq.idMap!, this.syncMap.provenTxReq.idMap!)
211
- EntitySyncState.mergeIdMap(iSyncMap.txLabel.idMap!, this.syncMap.txLabel.idMap!)
212
- EntitySyncState.mergeIdMap(iSyncMap.output.idMap!, this.syncMap.output.idMap!)
213
- EntitySyncState.mergeIdMap(iSyncMap.outputTag.idMap!, this.syncMap.outputTag.idMap!)
214
- EntitySyncState.mergeIdMap(iSyncMap.certificate.idMap!, this.syncMap.certificate.idMap!)
215
- EntitySyncState.mergeIdMap(iSyncMap.commission.idMap!, this.syncMap.commission.idMap!)
216
- }
217
-
218
- // stringified api properties
219
-
220
- errorLocal: SyncError | undefined
221
- errorOther: SyncError | undefined
222
- syncMap: SyncMap
223
-
224
- /**
225
- * Eliminate any properties besides code and description
226
- */
227
- private errorToString(e: SyncError | undefined): string | undefined {
228
- if (!e) return undefined
229
- const es: SyncError = {
230
- code: e.code,
231
- description: e.description,
232
- stack: e.stack
233
- }
234
- return JSON.stringify(es)
235
- }
236
-
237
- override equals(ei: TableSyncState, syncMap?: SyncMap | undefined): boolean {
238
- return false
239
- }
240
-
241
- override async mergeNew(storage: EntityStorage, userId: number, syncMap: SyncMap, trx?: TrxToken): Promise<void> {}
242
-
243
- override async mergeExisting(
244
- storage: EntityStorage,
245
- since: Date | undefined,
246
- ei: TableSyncState,
247
- syncMap: SyncMap,
248
- trx?: TrxToken
249
- ): Promise<boolean> {
250
- return false
251
- }
252
-
253
- makeRequestSyncChunkArgs(
254
- forIdentityKey: string,
255
- forStorageIdentityKey: string,
256
- maxRoughSize?: number,
257
- maxItems?: number
258
- ): RequestSyncChunkArgs {
259
- const a: RequestSyncChunkArgs = {
260
- identityKey: forIdentityKey,
261
- maxRoughSize: maxRoughSize || 10000000,
262
- maxItems: maxItems || 1000,
263
- offsets: [],
264
- since: this.when,
265
- fromStorageIdentityKey: this.storageIdentityKey,
266
- toStorageIdentityKey: forStorageIdentityKey
267
- }
268
- for (const ess of [
269
- this.syncMap.provenTx,
270
- this.syncMap.outputBasket,
271
- this.syncMap.outputTag,
272
- this.syncMap.txLabel,
273
- this.syncMap.transaction,
274
- this.syncMap.output,
275
- this.syncMap.txLabelMap,
276
- this.syncMap.outputTagMap,
277
- this.syncMap.certificate,
278
- this.syncMap.certificateField,
279
- this.syncMap.commission,
280
- this.syncMap.provenTxReq
281
- ]) {
282
- if (!ess || !ess.entityName) debugger
283
- a.offsets.push({ name: ess.entityName, offset: ess.count })
284
- }
285
- return a
286
- }
287
-
288
- static syncChunkSummary(c: SyncChunk): string {
289
- let log = ''
290
- log += `SYNC CHUNK SUMMARY
291
- from storage: ${c.fromStorageIdentityKey}
292
- to storage: ${c.toStorageIdentityKey}
293
- for user: ${c.userIdentityKey}
294
- `
295
- if (c.user) log += ` USER activeStorage ${c.user.activeStorage}\n`
296
- if (!!c.provenTxs) {
297
- log += ` PROVEN_TXS\n`
298
- for (const r of c.provenTxs) {
299
- log += ` ${r.provenTxId} ${r.txid}\n`
300
- }
301
- }
302
- if (!!c.provenTxReqs) {
303
- log += ` PROVEN_TX_REQS\n`
304
- for (const r of c.provenTxReqs) {
305
- log += ` ${r.provenTxReqId} ${r.txid} ${r.status} ${r.provenTxId || ''}\n`
306
- }
307
- }
308
- if (!!c.transactions) {
309
- log += ` TRANSACTIONS\n`
310
- for (const r of c.transactions) {
311
- log += ` ${r.transactionId} ${r.txid} ${r.status} ${r.provenTxId || ''} sats:${r.satoshis}\n`
312
- }
313
- }
314
- if (!!c.outputs) {
315
- log += ` OUTPUTS\n`
316
- for (const r of c.outputs) {
317
- log += ` ${r.outputId} ${r.txid}.${r.vout} ${r.transactionId} ${r.spendable ? 'spendable' : ''} sats:${r.satoshis}\n`
318
- }
319
- }
320
- return log
321
- }
322
-
323
- async processSyncChunk(
324
- writer: EntityStorage,
325
- args: RequestSyncChunkArgs,
326
- chunk: SyncChunk
327
- ): Promise<{
328
- done: boolean
329
- maxUpdated_at: Date | undefined
330
- updates: number
331
- inserts: number
332
- }> {
333
- const mes = [
334
- new MergeEntity(chunk.provenTxs, EntityProvenTx.mergeFind, this.syncMap.provenTx),
335
- new MergeEntity(chunk.outputBaskets, EntityOutputBasket.mergeFind, this.syncMap.outputBasket),
336
- new MergeEntity(chunk.outputTags, EntityOutputTag.mergeFind, this.syncMap.outputTag),
337
- new MergeEntity(chunk.txLabels, EntityTxLabel.mergeFind, this.syncMap.txLabel),
338
- new MergeEntity(chunk.transactions, EntityTransaction.mergeFind, this.syncMap.transaction),
339
- new MergeEntity(chunk.outputs, EntityOutput.mergeFind, this.syncMap.output),
340
- new MergeEntity(chunk.txLabelMaps, EntityTxLabelMap.mergeFind, this.syncMap.txLabelMap),
341
- new MergeEntity(chunk.outputTagMaps, EntityOutputTagMap.mergeFind, this.syncMap.outputTagMap),
342
- new MergeEntity(chunk.certificates, EntityCertificate.mergeFind, this.syncMap.certificate),
343
- new MergeEntity(chunk.certificateFields, EntityCertificateField.mergeFind, this.syncMap.certificateField),
344
- new MergeEntity(chunk.commissions, EntityCommission.mergeFind, this.syncMap.commission),
345
- new MergeEntity(chunk.provenTxReqs, EntityProvenTxReq.mergeFind, this.syncMap.provenTxReq)
346
- ]
347
-
348
- let updates = 0
349
- let inserts = 0
350
- let maxUpdated_at: Date | undefined = undefined
351
- let done = true
352
-
353
- // Merge User
354
- if (chunk.user) {
355
- const ei = chunk.user
356
- const { found, eo } = await EntityUser.mergeFind(writer, this.userId, ei)
357
- if (found) {
358
- if (await eo.mergeExisting(writer, args.since, ei)) {
359
- maxUpdated_at = maxDate(maxUpdated_at, ei.updated_at)
360
- updates++
361
- }
362
- }
363
- }
364
-
365
- // Merge everything else...
366
- for (const me of mes) {
367
- const r = await me.merge(args.since, writer, this.userId, this.syncMap)
368
- // The counts become the offsets for the next chunk.
369
- me.esm.count += me.stateArray?.length || 0
370
- updates += r.updates
371
- inserts += r.inserts
372
- maxUpdated_at = maxDate(maxUpdated_at, me.esm.maxUpdated_at)
373
- // If any entity type either did not report results or if there were at least one, then we aren't done.
374
- if (me.stateArray === undefined || me.stateArray.length > 0) done = false
375
- //if (me.stateArray !== undefined && me.stateArray.length > 0)
376
- // console.log(`merged ${me.stateArray?.length} ${me.esm.entityName} ${r.inserts} inserted, ${r.updates} updated`);
377
- }
378
-
379
- if (done) {
380
- // Next batch starts further in the future with offsets of zero.
381
- this.when = maxUpdated_at
382
- for (const me of mes) me.esm.count = 0
383
- }
384
-
385
- await this.updateStorage(writer, false)
386
-
387
- return { done, maxUpdated_at, updates, inserts }
388
- }
389
- }
@@ -1,306 +0,0 @@
1
- import { TransactionStatus } from '../../../sdk/types'
2
- import { TrxToken } from '../../../sdk/WalletStorage.interfaces'
3
- import { optionalArraysEqual, verifyId, verifyOneOrNone } from '../../../utility/utilityHelpers'
4
- import { TableOutput } from '../tables/TableOutput'
5
- import { TableTransaction } from '../tables/TableTransaction'
6
- import { EntityBase, EntityStorage, SyncMap } from './EntityBase'
7
- import { EntityProvenTx } from './EntityProvenTx'
8
- import { Transaction as BsvTransaction, TransactionInput } from '@bsv/sdk'
9
-
10
- export class EntityTransaction extends EntityBase<TableTransaction> {
11
- /**
12
- * @returns @bsv/sdk Transaction object from parsed rawTx.
13
- * If rawTx is undefined, returns undefined.
14
- */
15
- getBsvTx(): BsvTransaction | undefined {
16
- if (!this.rawTx) return undefined
17
- return BsvTransaction.fromBinary(this.rawTx)
18
- }
19
-
20
- /**
21
- * @returns array of @bsv/sdk TransactionInput objects from parsed rawTx.
22
- * If rawTx is undefined, an empty array is returned.
23
- */
24
- getBsvTxIns(): TransactionInput[] {
25
- const tx = this.getBsvTx()
26
- if (!tx) return []
27
- return tx.inputs
28
- }
29
-
30
- /**
31
- * Returns an array of "known" inputs to this transaction which belong to the same userId.
32
- * Uses both spentBy and rawTx inputs (if available) to locate inputs from among user's outputs.
33
- * Not all transaction inputs correspond to prior storage outputs.
34
- */
35
- async getInputs(storage: EntityStorage, trx?: TrxToken): Promise<TableOutput[]> {
36
- const inputs = await storage.findOutputs({
37
- partial: { userId: this.userId, spentBy: this.id },
38
- trx
39
- })
40
- // Merge "inputs" by spentBy and userId
41
- for (const input of this.getBsvTxIns()) {
42
- //console.log(`getInputs of ${this.id}: ${input.txid()} ${input.txOutNum}`)
43
- const pso = verifyOneOrNone(
44
- await storage.findOutputs({
45
- partial: {
46
- userId: this.userId,
47
- txid: input.sourceTXID,
48
- vout: input.sourceOutputIndex
49
- },
50
- trx
51
- })
52
- )
53
- if (pso && !inputs.some(i => i.outputId === pso.outputId)) inputs.push(pso)
54
- }
55
- return inputs
56
- }
57
-
58
- constructor(api?: TableTransaction) {
59
- const now = new Date()
60
- super(
61
- api || {
62
- transactionId: 0,
63
- created_at: now,
64
- updated_at: now,
65
- userId: 0,
66
- txid: '',
67
- status: 'unprocessed',
68
- reference: '',
69
- satoshis: 0,
70
- description: '',
71
- isOutgoing: false,
72
- rawTx: undefined,
73
- inputBEEF: undefined
74
- }
75
- )
76
- }
77
-
78
- override updateApi(): void {
79
- /* nothing needed yet... */
80
- }
81
-
82
- get transactionId() {
83
- return this.api.transactionId
84
- }
85
- set transactionId(v: number) {
86
- this.api.transactionId = v
87
- }
88
-
89
- get created_at() {
90
- return this.api.created_at
91
- }
92
- set created_at(v: Date) {
93
- this.api.created_at = v
94
- }
95
-
96
- get updated_at() {
97
- return this.api.updated_at
98
- }
99
- set updated_at(v: Date) {
100
- this.api.updated_at = v
101
- }
102
-
103
- get version() {
104
- return this.api.version
105
- }
106
- set version(v: number | undefined) {
107
- this.api.version = v
108
- }
109
-
110
- get lockTime() {
111
- return this.api.lockTime
112
- }
113
- set lockTime(v: number | undefined) {
114
- this.api.lockTime = v
115
- }
116
-
117
- get isOutgoing() {
118
- return this.api.isOutgoing
119
- }
120
- set isOutgoing(v: boolean) {
121
- this.api.isOutgoing = v
122
- }
123
-
124
- get status() {
125
- return this.api.status
126
- }
127
- set status(v: TransactionStatus) {
128
- this.api.status = v
129
- }
130
-
131
- get userId() {
132
- return this.api.userId
133
- }
134
- set userId(v: number) {
135
- this.api.userId = v
136
- }
137
-
138
- get provenTxId() {
139
- return this.api.provenTxId
140
- }
141
- set provenTxId(v: number | undefined) {
142
- this.api.provenTxId = v
143
- }
144
-
145
- get satoshis() {
146
- return this.api.satoshis
147
- }
148
- set satoshis(v: number) {
149
- this.api.satoshis = v
150
- }
151
-
152
- get txid() {
153
- return this.api.txid
154
- }
155
- set txid(v: string | undefined) {
156
- this.api.txid = v
157
- }
158
-
159
- get reference() {
160
- return this.api.reference
161
- }
162
- set reference(v: string) {
163
- this.api.reference = v
164
- }
165
-
166
- get inputBEEF() {
167
- return this.api.inputBEEF
168
- }
169
- set inputBEEF(v: number[] | undefined) {
170
- this.api.inputBEEF = v
171
- }
172
-
173
- get description() {
174
- return this.api.description
175
- }
176
- set description(v: string) {
177
- this.api.description = v
178
- }
179
-
180
- get rawTx() {
181
- return this.api.rawTx
182
- }
183
- set rawTx(v: number[] | undefined) {
184
- this.api.rawTx = v
185
- }
186
-
187
- // Extended (computed / dependent entity) Properties
188
- //get labels() { return this.api.labels }
189
- //set labels(v: string[] | undefined) { this.api.labels = v }
190
-
191
- override get id(): number {
192
- return this.api.transactionId
193
- }
194
- override set id(v: number) {
195
- this.api.transactionId = v
196
- }
197
- override get entityName(): string {
198
- return 'transaction'
199
- }
200
- override get entityTable(): string {
201
- return 'transactions'
202
- }
203
-
204
- override equals(ei: TableTransaction, syncMap?: SyncMap | undefined): boolean {
205
- const eo = this.toApi()
206
-
207
- // Properties that are never updated
208
- if (
209
- eo.transactionId !== (syncMap ? syncMap.transaction.idMap[verifyId(ei.transactionId)] : ei.transactionId) ||
210
- eo.reference !== ei.reference
211
- )
212
- return false
213
-
214
- if (
215
- eo.version !== ei.version ||
216
- eo.lockTime !== ei.lockTime ||
217
- eo.isOutgoing !== ei.isOutgoing ||
218
- eo.status !== ei.status ||
219
- eo.satoshis !== ei.satoshis ||
220
- eo.txid !== ei.txid ||
221
- eo.description !== ei.description ||
222
- !optionalArraysEqual(eo.rawTx, ei.rawTx) ||
223
- !optionalArraysEqual(eo.inputBEEF, ei.inputBEEF)
224
- )
225
- return false
226
-
227
- if (
228
- !eo.provenTxId !== !ei.provenTxId ||
229
- (ei.provenTxId && eo.provenTxId !== (syncMap ? syncMap.provenTx.idMap[verifyId(ei.provenTxId)] : ei.provenTxId))
230
- )
231
- return false
232
-
233
- return true
234
- }
235
-
236
- static async mergeFind(
237
- storage: EntityStorage,
238
- userId: number,
239
- ei: TableTransaction,
240
- syncMap: SyncMap,
241
- trx?: TrxToken
242
- ): Promise<{ found: boolean; eo: EntityTransaction; eiId: number }> {
243
- const ef = verifyOneOrNone(
244
- await storage.findTransactions({
245
- partial: { reference: ei.reference, userId },
246
- trx
247
- })
248
- )
249
- return {
250
- found: !!ef,
251
- eo: new EntityTransaction(ef || { ...ei }),
252
- eiId: verifyId(ei.transactionId)
253
- }
254
- }
255
-
256
- override async mergeNew(storage: EntityStorage, userId: number, syncMap: SyncMap, trx?: TrxToken): Promise<void> {
257
- if (this.provenTxId) this.provenTxId = syncMap.provenTx.idMap[this.provenTxId]
258
- this.userId = userId
259
- this.transactionId = 0
260
- this.transactionId = await storage.insertTransaction(this.toApi(), trx)
261
- }
262
-
263
- override async mergeExisting(
264
- storage: EntityStorage,
265
- since: Date | undefined,
266
- ei: TableTransaction,
267
- syncMap: SyncMap,
268
- trx?: TrxToken
269
- ): Promise<boolean> {
270
- let wasMerged = false
271
- if (ei.updated_at > this.updated_at) {
272
- // Properties that are never updated:
273
- // transactionId
274
- // userId
275
- // reference
276
-
277
- // Merged properties
278
- this.version = ei.version
279
- this.lockTime = ei.lockTime
280
- this.isOutgoing = ei.isOutgoing
281
- this.status = ei.status
282
- this.provenTxId = ei.provenTxId ? syncMap.provenTx.idMap[ei.provenTxId] : undefined
283
- this.satoshis = ei.satoshis
284
- this.txid = ei.txid
285
- this.description = ei.description
286
- this.rawTx = ei.rawTx
287
- this.inputBEEF = ei.inputBEEF
288
- this.updated_at = new Date(Math.max(ei.updated_at.getTime(), this.updated_at.getTime()))
289
- await storage.updateTransaction(this.id, this.toApi(), trx)
290
- wasMerged = true
291
- }
292
- return wasMerged
293
- }
294
-
295
- async getProvenTx(storage: EntityStorage, trx?: TrxToken): Promise<EntityProvenTx | undefined> {
296
- if (!this.provenTxId) return undefined
297
- const p = verifyOneOrNone(
298
- await storage.findProvenTxs({
299
- partial: { provenTxId: this.provenTxId },
300
- trx
301
- })
302
- )
303
- if (!p) return undefined
304
- return new EntityProvenTx(p)
305
- }
306
- }