@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,567 +0,0 @@
1
- import {
2
- AbortActionArgs,
3
- AbortActionResult,
4
- InternalizeActionArgs,
5
- ListActionsResult,
6
- ListCertificatesResult,
7
- ListOutputsResult,
8
- RelinquishCertificateArgs,
9
- RelinquishOutputArgs,
10
- WalletInterface,
11
- AuthFetch,
12
- Validation,
13
- WalletLoggerInterface
14
- } from '@bsv/sdk'
15
- import {
16
- AuthId,
17
- FindCertificatesArgs,
18
- FindOutputBasketsArgs,
19
- FindOutputsArgs,
20
- FindProvenTxReqsArgs,
21
- ProcessSyncChunkResult,
22
- RequestSyncChunkArgs,
23
- StorageCreateActionResult,
24
- StorageInternalizeActionResult,
25
- StorageProcessActionArgs,
26
- StorageProcessActionResults,
27
- SyncChunk,
28
- UpdateProvenTxReqWithNewProvenTxArgs,
29
- UpdateProvenTxReqWithNewProvenTxResult,
30
- WalletStorageProvider
31
- } from '../../sdk/WalletStorage.interfaces'
32
- import { TableSettings } from '../schema/tables/TableSettings'
33
- import { WERR_INVALID_OPERATION } from '../../sdk/WERR_errors'
34
- import { WalletServices } from '../../sdk/WalletServices.interfaces'
35
- import { TableUser } from '../schema/tables/TableUser'
36
- import { TableSyncState } from '../schema/tables/TableSyncState'
37
- import { TableCertificateX } from '../schema/tables/TableCertificate'
38
- import { TableOutputBasket } from '../schema/tables/TableOutputBasket'
39
- import { TableOutput } from '../schema/tables/TableOutput'
40
- import { TableProvenTxReq } from '../schema/tables/TableProvenTxReq'
41
- import { EntityTimeStamp } from '../../sdk/types'
42
- import { WalletError } from '../../sdk/WalletError'
43
- import { WalletErrorFromJson } from '../../sdk/WalletErrorFromJson'
44
- import { logWalletError } from '../../WalletLogger'
45
-
46
- /**
47
- * `StorageClient` implements the `WalletStorageProvider` interface which allows it to
48
- * serve as a BRC-100 wallet's active storage.
49
- *
50
- * Internally, it uses JSON-RPC over HTTPS to make requests of a remote server.
51
- * Typically this server uses the `StorageServer` class to implement the service.
52
- *
53
- * The `AuthFetch` component is used to secure and authenticate the requests to the remote server.
54
- *
55
- * `AuthFetch` is initialized with a BRC-100 wallet which establishes the identity of
56
- * the party making requests of the remote service.
57
- *
58
- * For details of the API implemented, follow the "See also" link for the `WalletStorageProvider` interface.
59
- */
60
- export class StorageClient implements WalletStorageProvider {
61
- readonly endpointUrl: string
62
- private readonly authClient: AuthFetch
63
- private nextId = 1
64
-
65
- // Track ephemeral (in-memory) "settings" if you wish to align with isAvailable() checks
66
- public settings?: TableSettings
67
-
68
- constructor(wallet: WalletInterface, endpointUrl: string) {
69
- this.authClient = new AuthFetch(wallet)
70
- this.endpointUrl = endpointUrl
71
- }
72
-
73
- /**
74
- * The `StorageClient` implements the `WalletStorageProvider` interface.
75
- * It does not implement the lower level `StorageProvider` interface.
76
- *
77
- * @returns false
78
- */
79
- isStorageProvider(): boolean {
80
- return false
81
- }
82
-
83
- //////////////////////////////////////////////////////////////////////////////
84
- // JSON-RPC helper
85
- //////////////////////////////////////////////////////////////////////////////
86
-
87
- /**
88
- * Make a JSON-RPC call to the remote server.
89
- * @param method The WalletStorage method name to call.
90
- * @param params The array of parameters to pass to the method in order.
91
- */
92
- private async rpcCall<T>(method: string, params: unknown[]): Promise<T> {
93
- let logger: WalletLoggerInterface | undefined = params[1]?.['logger']
94
-
95
- try {
96
- const id = this.nextId++
97
-
98
- if (logger) {
99
- // Replace logger object with seed json object to continue logging on request server.
100
- logger.group(`StorageClient ${method}`)
101
- params[1]!['logger'] = { indent: logger.indent || 0 }
102
- }
103
-
104
- const body = {
105
- jsonrpc: '2.0',
106
- method,
107
- params,
108
- id
109
- }
110
-
111
- let response: Response
112
- try {
113
- response = await this.authClient.fetch(this.endpointUrl, {
114
- method: 'POST',
115
- headers: { 'Content-Type': 'application/json' },
116
- body: JSON.stringify(body)
117
- })
118
- } catch (eu: unknown) {
119
- logWalletError(eu, logger, 'error requesting remote service')
120
- throw eu
121
- }
122
-
123
- if (!response.ok) {
124
- throw new Error(`WalletStorageClient rpcCall: network error ${response.status} ${response.statusText}`)
125
- }
126
-
127
- const json = await response.json()
128
- if (json.error) {
129
- logWalletError(json.error, logger, 'error from remote service')
130
- const werr = WalletErrorFromJson(json.error)
131
- throw werr
132
- }
133
-
134
- if (logger) {
135
- // merge log data from request processing
136
- logger.merge?.(json.result?.['log'])
137
- logger.groupEnd()
138
- }
139
-
140
- return json.result
141
- } catch (eu: unknown) {
142
- logWalletError(eu, logger, 'error setting up request to remote service')
143
- throw eu
144
- } finally {
145
- if (logger) {
146
- // Restore original logger in params
147
- params[1]!['logger'] = logger
148
- }
149
- }
150
- }
151
-
152
- /**
153
- * @returns true once storage `TableSettings` have been retreived from remote storage.
154
- */
155
- isAvailable(): boolean {
156
- // We'll just say "yes" if we have settings
157
- return !!this.settings
158
- }
159
-
160
- /**
161
- * @returns remote storage `TableSettings` if they have been retreived by `makeAvailable`.
162
- * @throws WERR_INVALID_OPERATION if `makeAvailable` has not yet been called.
163
- */
164
- getSettings(): TableSettings {
165
- if (!this.settings) {
166
- throw new WERR_INVALID_OPERATION('call makeAvailable at least once before getSettings')
167
- }
168
- return this.settings
169
- }
170
-
171
- /**
172
- * Must be called prior to making use of storage.
173
- * Retreives `TableSettings` from remote storage provider.
174
- * @returns remote storage `TableSettings`
175
- */
176
- async makeAvailable(): Promise<TableSettings> {
177
- if (!this.settings) {
178
- this.settings = await this.rpcCall<TableSettings>('makeAvailable', [])
179
- }
180
- return this.settings
181
- }
182
-
183
- //////////////////////////////////////////////////////////////////////////////
184
- //
185
- // Implementation of all WalletStorage interface methods
186
- // They are simple pass-thrus to rpcCall
187
- //
188
- // IMPORTANT: The parameter ordering must match exactly as in your interface.
189
- //////////////////////////////////////////////////////////////////////////////
190
-
191
- /**
192
- * Called to cleanup resources when no further use of this object will occur.
193
- */
194
- async destroy(): Promise<void> {
195
- return this.rpcCall<void>('destroy', [])
196
- }
197
-
198
- /**
199
- * Requests schema migration to latest.
200
- * Typically remote storage will ignore this request.
201
- * @param storageName Unique human readable name for remote storage if it does not yet exist.
202
- * @param storageIdentityKey Unique identity key for remote storage if it does not yet exist.
203
- * @returns current schema migration identifier
204
- */
205
- async migrate(storageName: string, storageIdentityKey: string): Promise<string> {
206
- return this.rpcCall<string>('migrate', [storageName])
207
- }
208
-
209
- /**
210
- * Remote storage does not offer `Services` to remote clients.
211
- * @throws WERR_INVALID_OPERATION
212
- */
213
- getServices(): WalletServices {
214
- // Typically, the client would not store or retrieve "Services" from a remote server.
215
- // The "services" in local in-memory usage is a no-op or your own approach:
216
- throw new WERR_INVALID_OPERATION(
217
- 'getServices() not implemented in remote client. This method typically is not used remotely.'
218
- )
219
- }
220
-
221
- /**
222
- * Ignored. Remote storage cannot share `Services` with remote clients.
223
- */
224
- setServices(v: WalletServices): void {
225
- // Typically no-op for remote client
226
- // Because "services" are usually local definitions to the Storage.
227
- }
228
-
229
- /**
230
- * Storage level processing for wallet `internalizeAction`.
231
- * Updates internalized outputs in remote storage.
232
- * Triggers proof validation of containing transaction.
233
- * @param auth Identifies client by identity key and the storage identity key of their currently active storage.
234
- * This must match the `AuthFetch` identity securing the remote conneciton.
235
- * @param args Original wallet `internalizeAction` arguments.
236
- * @returns `internalizeAction` results
237
- */
238
- async internalizeAction(auth: AuthId, args: InternalizeActionArgs): Promise<StorageInternalizeActionResult> {
239
- return this.rpcCall<StorageInternalizeActionResult>('internalizeAction', [auth, args])
240
- }
241
-
242
- /**
243
- * Storage level processing for wallet `createAction`.
244
- * @param auth Identifies client by identity key and the storage identity key of their currently active storage.
245
- * This must match the `AuthFetch` identity securing the remote conneciton.
246
- * @param args Validated extension of original wallet `createAction` arguments.
247
- * @returns `StorageCreateActionResults` supporting additional wallet processing to yield `createAction` results.
248
- */
249
- async createAction(auth: AuthId, args: Validation.ValidCreateActionArgs): Promise<StorageCreateActionResult> {
250
- return this.rpcCall<StorageCreateActionResult>('createAction', [auth, args])
251
- }
252
-
253
- /**
254
- * Storage level processing for wallet `createAction` and `signAction`.
255
- *
256
- * Handles remaining storage tasks once a fully signed transaction has been completed. This is common to both `createAction` and `signAction`.
257
- *
258
- * @param auth Identifies client by identity key and the storage identity key of their currently active storage.
259
- * This must match the `AuthFetch` identity securing the remote conneciton.
260
- * @param args `StorageProcessActionArgs` convey completed signed transaction to storage.
261
- * @returns `StorageProcessActionResults` supporting final wallet processing to yield `createAction` or `signAction` results.
262
- */
263
- async processAction(auth: AuthId, args: StorageProcessActionArgs): Promise<StorageProcessActionResults> {
264
- return this.rpcCall<StorageProcessActionResults>('processAction', [auth, args])
265
- }
266
-
267
- /**
268
- * Aborts an action by `reference` string.
269
- * @param auth Identifies client by identity key and the storage identity key of their currently active storage.
270
- * This must match the `AuthFetch` identity securing the remote conneciton.
271
- * @param args original wallet `abortAction` args.
272
- * @returns `abortAction` result.
273
- */
274
- async abortAction(auth: AuthId, args: AbortActionArgs): Promise<AbortActionResult> {
275
- return this.rpcCall<AbortActionResult>('abortAction', [auth, args])
276
- }
277
-
278
- /**
279
- * Used to both find and initialize a new user by identity key.
280
- * It is up to the remote storage whether to allow creation of new users by this method.
281
- * @param identityKey of the user.
282
- * @returns `TableUser` for the user and whether a new user was created.
283
- */
284
- async findOrInsertUser(identityKey): Promise<{ user: TableUser; isNew: boolean }> {
285
- return this.rpcCall<{ user: TableUser; isNew: boolean }>('findOrInsertUser', [identityKey])
286
- }
287
-
288
- /**
289
- * Used to both find and insert a `TableSyncState` record for the user to track wallet data replication across storage providers.
290
- * @param auth Identifies client by identity key and the storage identity key of their currently active storage.
291
- * This must match the `AuthFetch` identity securing the remote conneciton.
292
- * @param storageName the name of the remote storage being sync'd
293
- * @param storageIdentityKey the identity key of the remote storage being sync'd
294
- * @returns `TableSyncState` and whether a new record was created.
295
- */
296
- async findOrInsertSyncStateAuth(
297
- auth: AuthId,
298
- storageIdentityKey: string,
299
- storageName: string
300
- ): Promise<{ syncState: TableSyncState; isNew: boolean }> {
301
- const r = await this.rpcCall<{ syncState: TableSyncState; isNew: boolean }>('findOrInsertSyncStateAuth', [
302
- auth,
303
- storageIdentityKey,
304
- storageName
305
- ])
306
- r.syncState = this.validateEntity(r.syncState, ['when'])
307
- return r
308
- }
309
-
310
- /**
311
- * Inserts a new certificate with fields and keyring into remote storage.
312
- * @param auth Identifies client by identity key and the storage identity key of their currently active storage.
313
- * This must match the `AuthFetch` identity securing the remote conneciton.
314
- * @param certificate the certificate to insert.
315
- * @returns record Id of the inserted `TableCertificate` record.
316
- */
317
- async insertCertificateAuth(auth: AuthId, certificate: TableCertificateX): Promise<number> {
318
- const r = await this.rpcCall<number>('insertCertificateAuth', [auth, certificate])
319
- return r
320
- }
321
-
322
- /**
323
- * Storage level processing for wallet `listActions`.
324
- * @param auth Identifies client by identity key and the storage identity key of their currently active storage.
325
- * This must match the `AuthFetch` identity securing the remote conneciton.
326
- * @param args Validated extension of original wallet `listActions` arguments.
327
- * @returns `listActions` results.
328
- */
329
- async listActions(auth: AuthId, vargs: Validation.ValidListActionsArgs): Promise<ListActionsResult> {
330
- const r = await this.rpcCall<ListActionsResult>('listActions', [auth, vargs])
331
- return r
332
- }
333
-
334
- /**
335
- * Storage level processing for wallet `listOutputs`.
336
- * @param auth Identifies client by identity key and the storage identity key of their currently active storage.
337
- * This must match the `AuthFetch` identity securing the remote conneciton.
338
- * @param args Validated extension of original wallet `listOutputs` arguments.
339
- * @returns `listOutputs` results.
340
- */
341
- async listOutputs(auth: AuthId, vargs: Validation.ValidListOutputsArgs): Promise<ListOutputsResult> {
342
- const r = await this.rpcCall<ListOutputsResult>('listOutputs', [auth, vargs])
343
- return r
344
- }
345
-
346
- /**
347
- * Storage level processing for wallet `listCertificates`.
348
- * @param auth Identifies client by identity key and the storage identity key of their currently active storage.
349
- * This must match the `AuthFetch` identity securing the remote conneciton.
350
- * @param args Validated extension of original wallet `listCertificates` arguments.
351
- * @returns `listCertificates` results.
352
- */
353
- async listCertificates(auth: AuthId, vargs: Validation.ValidListCertificatesArgs): Promise<ListCertificatesResult> {
354
- const r = await this.rpcCall<ListCertificatesResult>('listCertificates', [auth, vargs])
355
- return r
356
- }
357
-
358
- /**
359
- * Find user certificates, optionally with fields.
360
- *
361
- * This certificate retrieval method supports internal wallet operations.
362
- * Field values are stored and retrieved encrypted.
363
- *
364
- * @param auth Identifies client by identity key and the storage identity key of their currently active storage.
365
- * This must match the `AuthFetch` identity securing the remote conneciton.
366
- * @param args `FindCertificatesArgs` determines which certificates to retrieve and whether to include fields.
367
- * @returns array of certificates matching args.
368
- */
369
- async findCertificatesAuth(auth: AuthId, args: FindCertificatesArgs): Promise<TableCertificateX[]> {
370
- const r = await this.rpcCall<TableCertificateX[]>('findCertificatesAuth', [auth, args])
371
- this.validateEntities(r)
372
- if (args.includeFields) {
373
- for (const c of r) {
374
- if (c.fields) this.validateEntities(c.fields)
375
- }
376
- }
377
- return r
378
- }
379
-
380
- /**
381
- * Find output baskets.
382
- *
383
- * This retrieval method supports internal wallet operations.
384
- *
385
- * @param auth Identifies client by identity key and the storage identity key of their currently active storage.
386
- * This must match the `AuthFetch` identity securing the remote conneciton.
387
- * @param args `FindOutputBasketsArgs` determines which baskets to retrieve.
388
- * @returns array of output baskets matching args.
389
- */
390
- async findOutputBasketsAuth(auth: AuthId, args: FindOutputBasketsArgs): Promise<TableOutputBasket[]> {
391
- const r = await this.rpcCall<TableOutputBasket[]>('findOutputBaskets', [auth, args])
392
- this.validateEntities(r)
393
- return r
394
- }
395
-
396
- /**
397
- * Find outputs.
398
- *
399
- * This retrieval method supports internal wallet operations.
400
- *
401
- * @param auth Identifies client by identity key and the storage identity key of their currently active storage.
402
- * This must match the `AuthFetch` identity securing the remote conneciton.
403
- * @param args `FindOutputsArgs` determines which outputs to retrieve.
404
- * @returns array of outputs matching args.
405
- */
406
- async findOutputsAuth(auth: AuthId, args: FindOutputsArgs): Promise<TableOutput[]> {
407
- const r = await this.rpcCall<TableOutput[]>('findOutputsAuth', [auth, args])
408
- this.validateEntities(r)
409
- return r
410
- }
411
-
412
- /**
413
- * Find requests for transaction proofs.
414
- *
415
- * This retrieval method supports internal wallet operations.
416
- *
417
- * @param auth Identifies client by identity key and the storage identity key of their currently active storage.
418
- * This must match the `AuthFetch` identity securing the remote conneciton.
419
- * @param args `FindProvenTxReqsArgs` determines which proof requests to retrieve.
420
- * @returns array of proof requests matching args.
421
- */
422
- async findProvenTxReqs(args: FindProvenTxReqsArgs): Promise<TableProvenTxReq[]> {
423
- const r = await this.rpcCall<TableProvenTxReq[]>('findProvenTxReqs', [args])
424
- this.validateEntities(r)
425
- return r
426
- }
427
-
428
- /**
429
- * Relinquish a certificate.
430
- *
431
- * For storage supporting replication records must be kept of deletions. Therefore certificates are marked as deleted
432
- * when relinquished, and no longer returned by `listCertificates`, but are still retained by storage.
433
- *
434
- * @param auth Identifies client by identity key and the storage identity key of their currently active storage.
435
- * This must match the `AuthFetch` identity securing the remote conneciton.
436
- * @param args original wallet `relinquishCertificate` args.
437
- */
438
- async relinquishCertificate(auth: AuthId, args: RelinquishCertificateArgs): Promise<number> {
439
- return this.rpcCall<number>('relinquishCertificate', [auth, args])
440
- }
441
-
442
- /**
443
- * Relinquish an output.
444
- *
445
- * Relinquishing an output removes the output from whatever basket was tracking it.
446
- *
447
- * @param auth Identifies client by identity key and the storage identity key of their currently active storage.
448
- * This must match the `AuthFetch` identity securing the remote conneciton.
449
- * @param args original wallet `relinquishOutput` args.
450
- */
451
- async relinquishOutput(auth: AuthId, args: RelinquishOutputArgs): Promise<number> {
452
- return this.rpcCall<number>('relinquishOutput', [auth, args])
453
- }
454
-
455
- /**
456
- * Process a "chunk" of replication data for the user.
457
- *
458
- * The normal data flow is for the active storage to push backups as a sequence of data chunks to backup storage providers.
459
- *
460
- * @param args a copy of the replication request args that initiated the sequence of data chunks.
461
- * @param chunk the current data chunk to process.
462
- * @returns whether processing is done, counts of inserts and udpates, and related progress tracking properties.
463
- */
464
- async processSyncChunk(args: RequestSyncChunkArgs, chunk: SyncChunk): Promise<ProcessSyncChunkResult> {
465
- const r = await this.rpcCall<ProcessSyncChunkResult>('processSyncChunk', [args, chunk])
466
- return r
467
- }
468
-
469
- /**
470
- * Request a "chunk" of replication data for a specific user and storage provider.
471
- *
472
- * The normal data flow is for the active storage to push backups as a sequence of data chunks to backup storage providers.
473
- * Also supports recovery where non-active storage can attempt to merge available data prior to becoming active.
474
- *
475
- * @param args that identify the non-active storage which will receive replication data and constrains the replication process.
476
- * @returns the next "chunk" of replication data
477
- */
478
- async getSyncChunk(args: RequestSyncChunkArgs): Promise<SyncChunk> {
479
- const r = await this.rpcCall<SyncChunk>('getSyncChunk', [args])
480
- if (r.certificateFields) r.certificateFields = this.validateEntities(r.certificateFields)
481
- if (r.certificates) r.certificates = this.validateEntities(r.certificates)
482
- if (r.commissions) r.commissions = this.validateEntities(r.commissions)
483
- if (r.outputBaskets) r.outputBaskets = this.validateEntities(r.outputBaskets)
484
- if (r.outputTagMaps) r.outputTagMaps = this.validateEntities(r.outputTagMaps)
485
- if (r.outputTags) r.outputTags = this.validateEntities(r.outputTags)
486
- if (r.outputs) r.outputs = this.validateEntities(r.outputs)
487
- if (r.provenTxReqs) r.provenTxReqs = this.validateEntities(r.provenTxReqs)
488
- if (r.provenTxs) r.provenTxs = this.validateEntities(r.provenTxs)
489
- if (r.transactions) r.transactions = this.validateEntities(r.transactions)
490
- if (r.txLabelMaps) r.txLabelMaps = this.validateEntities(r.txLabelMaps)
491
- if (r.txLabels) r.txLabels = this.validateEntities(r.txLabels)
492
- if (r.user) r.user = this.validateEntity(r.user)
493
- return r
494
- }
495
-
496
- /**
497
- * Handles the data received when a new transaction proof is found in response to an outstanding request for proof data:
498
- *
499
- * - Creates a new `TableProvenTx` record.
500
- * - Notifies all user transaction records of the new status.
501
- * - Updates the proof request record to 'completed' status which enables delayed deletion.
502
- *
503
- * @param args proof request and new transaction proof data
504
- * @returns results of updates
505
- */
506
- async updateProvenTxReqWithNewProvenTx(
507
- args: UpdateProvenTxReqWithNewProvenTxArgs
508
- ): Promise<UpdateProvenTxReqWithNewProvenTxResult> {
509
- const r = await this.rpcCall<UpdateProvenTxReqWithNewProvenTxResult>('updateProvenTxReqWithNewProvenTx', [args])
510
- return r
511
- }
512
-
513
- /**
514
- * Ensures up-to-date wallet data replication to all configured backup storage providers,
515
- * then promotes one of the configured backups to active,
516
- * demoting the current active to new backup.
517
- *
518
- * @param auth Identifies client by identity key and the storage identity key of their currently active storage.
519
- * This must match the `AuthFetch` identity securing the remote conneciton.
520
- * @param newActiveStorageIdentityKey which must be a currently configured backup storage provider.
521
- */
522
- async setActive(auth: AuthId, newActiveStorageIdentityKey: string): Promise<number> {
523
- return this.rpcCall<number>('setActive', [auth, newActiveStorageIdentityKey])
524
- }
525
-
526
- validateDate(date: Date | string | number): Date {
527
- let r: Date
528
- if (date instanceof Date) r = date
529
- else r = new Date(date)
530
- return r
531
- }
532
-
533
- /**
534
- * Helper to force uniform behavior across database engines.
535
- * Use to process all individual records with time stamps retreived from database.
536
- */
537
- validateEntity<T extends EntityTimeStamp>(entity: T, dateFields?: string[]): T {
538
- entity.created_at = this.validateDate(entity.created_at)
539
- entity.updated_at = this.validateDate(entity.updated_at)
540
- if (dateFields) {
541
- for (const df of dateFields) {
542
- if (entity[df]) entity[df] = this.validateDate(entity[df])
543
- }
544
- }
545
- for (const key of Object.keys(entity)) {
546
- const val = entity[key]
547
- if (val === null) {
548
- entity[key] = undefined
549
- } else if (val instanceof Uint8Array) {
550
- entity[key] = Array.from(val)
551
- }
552
- }
553
- return entity
554
- }
555
-
556
- /**
557
- * Helper to force uniform behavior across database engines.
558
- * Use to process all arrays of records with time stamps retreived from database.
559
- * @returns input `entities` array with contained values validated.
560
- */
561
- validateEntities<T extends EntityTimeStamp>(entities: T[], dateFields?: string[]): T[] {
562
- for (let i = 0; i < entities.length; i++) {
563
- entities[i] = this.validateEntity(entities[i], dateFields)
564
- }
565
- return entities
566
- }
567
- }