@bsv/wallet-toolbox 1.1.7 → 1.1.9

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 (317) hide show
  1. package/docs/client.md +3872 -1555
  2. package/docs/monitor.md +29 -27
  3. package/docs/services.md +22 -22
  4. package/docs/setup.md +23 -23
  5. package/docs/storage.md +2747 -438
  6. package/docs/wallet.md +3872 -1555
  7. package/out/src/monitor/tasks/TaskCheckForProofs.d.ts +4 -4
  8. package/out/src/monitor/tasks/TaskCheckForProofs.d.ts.map +1 -1
  9. package/out/src/monitor/tasks/TaskCheckForProofs.js +2 -2
  10. package/out/src/monitor/tasks/TaskCheckForProofs.js.map +1 -1
  11. package/out/src/monitor/tasks/TaskSendWaiting.d.ts +2 -2
  12. package/out/src/monitor/tasks/TaskSendWaiting.d.ts.map +1 -1
  13. package/out/src/monitor/tasks/TaskSendWaiting.js +2 -2
  14. package/out/src/monitor/tasks/TaskSendWaiting.js.map +1 -1
  15. package/out/src/sdk/StorageSyncReader.d.ts +30 -30
  16. package/out/src/sdk/StorageSyncReader.d.ts.map +1 -1
  17. package/out/src/sdk/StorageSyncReaderWriter.d.ts +60 -60
  18. package/out/src/sdk/StorageSyncReaderWriter.d.ts.map +1 -1
  19. package/out/src/sdk/WalletStorage.interfaces.d.ts +36 -36
  20. package/out/src/sdk/WalletStorage.interfaces.d.ts.map +1 -1
  21. package/out/src/signer/methods/acquireDirectCertificate.d.ts.map +1 -1
  22. package/out/src/signer/methods/acquireDirectCertificate.js.map +1 -1
  23. package/out/src/storage/StorageKnex.d.ts +61 -61
  24. package/out/src/storage/StorageKnex.d.ts.map +1 -1
  25. package/out/src/storage/StorageKnex.js +13 -4
  26. package/out/src/storage/StorageKnex.js.map +1 -1
  27. package/out/src/storage/StorageProvider.d.ts +16 -15
  28. package/out/src/storage/StorageProvider.d.ts.map +1 -1
  29. package/out/src/storage/StorageProvider.js +8 -8
  30. package/out/src/storage/StorageProvider.js.map +1 -1
  31. package/out/src/storage/StorageReader.d.ts +21 -21
  32. package/out/src/storage/StorageReader.d.ts.map +1 -1
  33. package/out/src/storage/StorageReader.js.map +1 -1
  34. package/out/src/storage/StorageReaderWriter.d.ts +60 -60
  35. package/out/src/storage/StorageReaderWriter.d.ts.map +1 -1
  36. package/out/src/storage/StorageReaderWriter.js.map +1 -1
  37. package/out/src/storage/StorageSyncReader.d.ts +17 -17
  38. package/out/src/storage/StorageSyncReader.d.ts.map +1 -1
  39. package/out/src/storage/StorageSyncReader.js.map +1 -1
  40. package/out/src/storage/WalletStorageManager.d.ts +9 -9
  41. package/out/src/storage/WalletStorageManager.d.ts.map +1 -1
  42. package/out/src/storage/WalletStorageManager.js +2 -2
  43. package/out/src/storage/WalletStorageManager.js.map +1 -1
  44. package/out/src/storage/index.all.d.ts +2 -2
  45. package/out/src/storage/index.all.d.ts.map +1 -1
  46. package/out/src/storage/index.all.js +3 -3
  47. package/out/src/storage/index.all.js.map +1 -1
  48. package/out/src/storage/index.client.d.ts +2 -2
  49. package/out/src/storage/index.client.d.ts.map +1 -1
  50. package/out/src/storage/index.client.js +2 -25
  51. package/out/src/storage/index.client.js.map +1 -1
  52. package/out/src/storage/methods/attemptToPostReqsToNetwork.d.ts +3 -3
  53. package/out/src/storage/methods/attemptToPostReqsToNetwork.d.ts.map +1 -1
  54. package/out/src/storage/methods/attemptToPostReqsToNetwork.js.map +1 -1
  55. package/out/src/storage/methods/createAction.d.ts.map +1 -1
  56. package/out/src/storage/methods/createAction.js +1 -1
  57. package/out/src/storage/methods/createAction.js.map +1 -1
  58. package/out/src/storage/methods/getBeefForTransaction.js +2 -2
  59. package/out/src/storage/methods/getBeefForTransaction.js.map +1 -1
  60. package/out/src/storage/methods/getSyncChunk.d.ts.map +1 -1
  61. package/out/src/storage/methods/getSyncChunk.js.map +1 -1
  62. package/out/src/storage/methods/internalizeAction.d.ts.map +1 -1
  63. package/out/src/storage/methods/internalizeAction.js +1 -1
  64. package/out/src/storage/methods/internalizeAction.js.map +1 -1
  65. package/out/src/storage/methods/listActions.js.map +1 -1
  66. package/out/src/storage/methods/listCertificates.d.ts.map +1 -1
  67. package/out/src/storage/methods/listCertificates.js.map +1 -1
  68. package/out/src/storage/methods/listOutputs.js.map +1 -1
  69. package/out/src/storage/methods/processAction.d.ts +4 -4
  70. package/out/src/storage/methods/processAction.d.ts.map +1 -1
  71. package/out/src/storage/methods/processAction.js +2 -2
  72. package/out/src/storage/methods/processAction.js.map +1 -1
  73. package/out/src/storage/methods/purgeData.d.ts.map +1 -1
  74. package/out/src/storage/methods/purgeData.js.map +1 -1
  75. package/out/src/storage/methods/reviewStatus.js.map +1 -1
  76. package/out/src/storage/remoting/StorageClient.d.ts +230 -15
  77. package/out/src/storage/remoting/StorageClient.d.ts.map +1 -1
  78. package/out/src/storage/remoting/StorageClient.js +222 -7
  79. package/out/src/storage/remoting/StorageClient.js.map +1 -1
  80. package/out/src/storage/schema/entities/Certificate.d.ts +9 -9
  81. package/out/src/storage/schema/entities/Certificate.d.ts.map +1 -1
  82. package/out/src/storage/schema/entities/Certificate.js +5 -5
  83. package/out/src/storage/schema/entities/Certificate.js.map +1 -1
  84. package/out/src/storage/schema/entities/CertificateField.d.ts +9 -9
  85. package/out/src/storage/schema/entities/CertificateField.d.ts.map +1 -1
  86. package/out/src/storage/schema/entities/CertificateField.js +5 -5
  87. package/out/src/storage/schema/entities/CertificateField.js.map +1 -1
  88. package/out/src/storage/schema/entities/Commission.d.ts +9 -9
  89. package/out/src/storage/schema/entities/Commission.d.ts.map +1 -1
  90. package/out/src/storage/schema/entities/Commission.js +5 -5
  91. package/out/src/storage/schema/entities/Commission.js.map +1 -1
  92. package/out/src/storage/schema/entities/EntityBase.d.ts +1 -1
  93. package/out/src/storage/schema/entities/MergeEntity.d.ts +6 -7
  94. package/out/src/storage/schema/entities/MergeEntity.d.ts.map +1 -1
  95. package/out/src/storage/schema/entities/MergeEntity.js.map +1 -1
  96. package/out/src/storage/schema/entities/Output.d.ts +9 -9
  97. package/out/src/storage/schema/entities/Output.d.ts.map +1 -1
  98. package/out/src/storage/schema/entities/Output.js +5 -5
  99. package/out/src/storage/schema/entities/Output.js.map +1 -1
  100. package/out/src/storage/schema/entities/OutputBasket.d.ts +9 -9
  101. package/out/src/storage/schema/entities/OutputBasket.d.ts.map +1 -1
  102. package/out/src/storage/schema/entities/OutputBasket.js +5 -5
  103. package/out/src/storage/schema/entities/OutputBasket.js.map +1 -1
  104. package/out/src/storage/schema/entities/OutputTag.d.ts +9 -9
  105. package/out/src/storage/schema/entities/OutputTag.d.ts.map +1 -1
  106. package/out/src/storage/schema/entities/OutputTag.js +5 -5
  107. package/out/src/storage/schema/entities/OutputTag.js.map +1 -1
  108. package/out/src/storage/schema/entities/OutputTagMap.d.ts +9 -9
  109. package/out/src/storage/schema/entities/OutputTagMap.d.ts.map +1 -1
  110. package/out/src/storage/schema/entities/OutputTagMap.js +5 -5
  111. package/out/src/storage/schema/entities/OutputTagMap.js.map +1 -1
  112. package/out/src/storage/schema/entities/ProvenTx.d.ts +11 -11
  113. package/out/src/storage/schema/entities/ProvenTx.d.ts.map +1 -1
  114. package/out/src/storage/schema/entities/ProvenTx.js +11 -11
  115. package/out/src/storage/schema/entities/ProvenTx.js.map +1 -1
  116. package/out/src/storage/schema/entities/ProvenTxReq.d.ts +19 -19
  117. package/out/src/storage/schema/entities/ProvenTxReq.d.ts.map +1 -1
  118. package/out/src/storage/schema/entities/ProvenTxReq.js +13 -13
  119. package/out/src/storage/schema/entities/ProvenTxReq.js.map +1 -1
  120. package/out/src/storage/schema/entities/SyncState.d.ts +11 -11
  121. package/out/src/storage/schema/entities/SyncState.d.ts.map +1 -1
  122. package/out/src/storage/schema/entities/SyncState.js +27 -27
  123. package/out/src/storage/schema/entities/SyncState.js.map +1 -1
  124. package/out/src/storage/schema/entities/Transaction.d.ts +11 -11
  125. package/out/src/storage/schema/entities/Transaction.d.ts.map +1 -1
  126. package/out/src/storage/schema/entities/Transaction.js +6 -6
  127. package/out/src/storage/schema/entities/Transaction.js.map +1 -1
  128. package/out/src/storage/schema/entities/TxLabel.d.ts +9 -9
  129. package/out/src/storage/schema/entities/TxLabel.d.ts.map +1 -1
  130. package/out/src/storage/schema/entities/TxLabel.js +5 -5
  131. package/out/src/storage/schema/entities/TxLabel.js.map +1 -1
  132. package/out/src/storage/schema/entities/TxLabelMap.d.ts +9 -9
  133. package/out/src/storage/schema/entities/TxLabelMap.d.ts.map +1 -1
  134. package/out/src/storage/schema/entities/TxLabelMap.js +5 -5
  135. package/out/src/storage/schema/entities/TxLabelMap.js.map +1 -1
  136. package/out/src/storage/schema/entities/User.d.ts +9 -9
  137. package/out/src/storage/schema/entities/User.d.ts.map +1 -1
  138. package/out/src/storage/schema/entities/User.js +5 -5
  139. package/out/src/storage/schema/entities/User.js.map +1 -1
  140. package/out/src/storage/schema/entities/__tests/CertificateFieldTests.test.js +20 -307
  141. package/out/src/storage/schema/entities/__tests/CertificateFieldTests.test.js.map +1 -1
  142. package/out/src/storage/schema/entities/__tests/CertificateTests.test.js +17 -158
  143. package/out/src/storage/schema/entities/__tests/CertificateTests.test.js.map +1 -1
  144. package/out/src/storage/schema/entities/__tests/CommissionTests.test.js +23 -309
  145. package/out/src/storage/schema/entities/__tests/CommissionTests.test.js.map +1 -1
  146. package/out/src/storage/schema/entities/__tests/OutputBasketTests.test.js +19 -306
  147. package/out/src/storage/schema/entities/__tests/OutputBasketTests.test.js.map +1 -1
  148. package/out/src/storage/schema/entities/__tests/OutputTagMapTests.test.js +19 -306
  149. package/out/src/storage/schema/entities/__tests/OutputTagMapTests.test.js.map +1 -1
  150. package/out/src/storage/schema/entities/__tests/OutputTagTests.test.js +23 -237
  151. package/out/src/storage/schema/entities/__tests/OutputTagTests.test.js.map +1 -1
  152. package/out/src/storage/schema/entities/__tests/OutputTests.test.js +20 -233
  153. package/out/src/storage/schema/entities/__tests/OutputTests.test.js.map +1 -1
  154. package/out/src/storage/schema/entities/__tests/ProvenTxReqTests.test.js +27 -98
  155. package/out/src/storage/schema/entities/__tests/ProvenTxReqTests.test.js.map +1 -1
  156. package/out/src/storage/schema/entities/__tests/ProvenTxTests.test.js +25 -241
  157. package/out/src/storage/schema/entities/__tests/ProvenTxTests.test.js.map +1 -1
  158. package/out/src/storage/schema/entities/__tests/SyncStateTests.test.js +38 -112
  159. package/out/src/storage/schema/entities/__tests/SyncStateTests.test.js.map +1 -1
  160. package/out/src/storage/schema/entities/__tests/TransactionTests.test.js +39 -323
  161. package/out/src/storage/schema/entities/__tests/TransactionTests.test.js.map +1 -1
  162. package/out/src/storage/schema/entities/__tests/TxLabelMapTests.test.js +31 -169
  163. package/out/src/storage/schema/entities/__tests/TxLabelMapTests.test.js.map +1 -1
  164. package/out/src/storage/schema/entities/__tests/TxLabelTests.test.js +16 -159
  165. package/out/src/storage/schema/entities/__tests/TxLabelTests.test.js.map +1 -1
  166. package/out/src/storage/schema/entities/__tests/usersTests.test.js +21 -168
  167. package/out/src/storage/schema/entities/__tests/usersTests.test.js.map +1 -1
  168. package/out/src/storage/schema/tables/Certificate.d.ts +4 -4
  169. package/out/src/storage/schema/tables/Certificate.d.ts.map +1 -1
  170. package/out/src/storage/schema/tables/CertificateField.d.ts +1 -1
  171. package/out/src/storage/schema/tables/CertificateField.d.ts.map +1 -1
  172. package/out/src/storage/schema/tables/Commission.d.ts +1 -1
  173. package/out/src/storage/schema/tables/Commission.d.ts.map +1 -1
  174. package/out/src/storage/schema/tables/MonitorEvent.d.ts +1 -1
  175. package/out/src/storage/schema/tables/MonitorEvent.d.ts.map +1 -1
  176. package/out/src/storage/schema/tables/Output.d.ts +5 -5
  177. package/out/src/storage/schema/tables/Output.d.ts.map +1 -1
  178. package/out/src/storage/schema/tables/OutputBasket.d.ts +1 -1
  179. package/out/src/storage/schema/tables/OutputBasket.d.ts.map +1 -1
  180. package/out/src/storage/schema/tables/OutputTag.d.ts +1 -1
  181. package/out/src/storage/schema/tables/OutputTag.d.ts.map +1 -1
  182. package/out/src/storage/schema/tables/OutputTagMap.d.ts +1 -1
  183. package/out/src/storage/schema/tables/OutputTagMap.d.ts.map +1 -1
  184. package/out/src/storage/schema/tables/ProvenTx.d.ts +1 -1
  185. package/out/src/storage/schema/tables/ProvenTx.d.ts.map +1 -1
  186. package/out/src/storage/schema/tables/ProvenTxReq.d.ts +2 -2
  187. package/out/src/storage/schema/tables/ProvenTxReq.d.ts.map +1 -1
  188. package/out/src/storage/schema/tables/SyncState.d.ts +1 -1
  189. package/out/src/storage/schema/tables/SyncState.d.ts.map +1 -1
  190. package/out/src/storage/schema/tables/{Settings.d.ts → TableSettings.d.ts} +2 -2
  191. package/out/src/storage/schema/tables/TableSettings.d.ts.map +1 -0
  192. package/out/src/storage/schema/tables/{Settings.js → TableSettings.js} +1 -1
  193. package/out/src/storage/schema/tables/TableSettings.js.map +1 -0
  194. package/out/src/storage/schema/tables/Transaction.d.ts +1 -1
  195. package/out/src/storage/schema/tables/Transaction.d.ts.map +1 -1
  196. package/out/src/storage/schema/tables/TxLabel.d.ts +1 -1
  197. package/out/src/storage/schema/tables/TxLabel.d.ts.map +1 -1
  198. package/out/src/storage/schema/tables/TxLabelMap.d.ts +1 -1
  199. package/out/src/storage/schema/tables/TxLabelMap.d.ts.map +1 -1
  200. package/out/src/storage/schema/tables/User.d.ts +1 -1
  201. package/out/src/storage/schema/tables/User.d.ts.map +1 -1
  202. package/out/src/storage/schema/tables/index.d.ts +1 -1
  203. package/out/src/storage/schema/tables/index.d.ts.map +1 -1
  204. package/out/src/storage/schema/tables/index.js +1 -1
  205. package/out/src/storage/schema/tables/index.js.map +1 -1
  206. package/out/src/storage/sync/StorageMySQLDojoReader.d.ts +17 -17
  207. package/out/src/storage/sync/StorageMySQLDojoReader.d.ts.map +1 -1
  208. package/out/src/storage/sync/StorageMySQLDojoReader.js +2 -2
  209. package/out/src/storage/sync/StorageMySQLDojoReader.js.map +1 -1
  210. package/out/test/Wallet/certificate/listCertificates.test.js.map +1 -1
  211. package/out/test/Wallet/live/walletLive.man.test.js +1 -1
  212. package/out/test/Wallet/live/walletLive.man.test.js.map +1 -1
  213. package/out/test/monitor/Monitor.test.js +7 -7
  214. package/out/test/monitor/Monitor.test.js.map +1 -1
  215. package/out/test/storage/StorageMySQLDojoReader.man.test.js +1 -1
  216. package/out/test/storage/StorageMySQLDojoReader.man.test.js.map +1 -1
  217. package/out/test/storage/insert.test.js.map +1 -1
  218. package/out/test/storage/update.test.js.map +1 -1
  219. package/out/test/storage/update2.test.js.map +1 -1
  220. package/out/test/utils/TestUtilsWalletStorage.d.ts +56 -56
  221. package/out/test/utils/TestUtilsWalletStorage.d.ts.map +1 -1
  222. package/out/test/utils/TestUtilsWalletStorage.js +11 -4
  223. package/out/test/utils/TestUtilsWalletStorage.js.map +1 -1
  224. package/out/test/wallet/action/createActionToGenerateBeefs.man.test.js.map +1 -1
  225. package/out/tsconfig.all.tsbuildinfo +1 -1
  226. package/package.json +2 -2
  227. package/src/monitor/tasks/TaskCheckForProofs.ts +11 -10
  228. package/src/monitor/tasks/TaskSendWaiting.ts +5 -5
  229. package/src/sdk/StorageSyncReader.ts +48 -30
  230. package/src/sdk/StorageSyncReaderWriter.ts +77 -63
  231. package/src/sdk/WalletStorage.interfaces.ts +55 -36
  232. package/src/signer/methods/acquireDirectCertificate.ts +2 -2
  233. package/src/storage/StorageKnex.ts +137 -106
  234. package/src/storage/StorageProvider.ts +43 -30
  235. package/src/storage/StorageReader.ts +37 -21
  236. package/src/storage/StorageReaderWriter.ts +78 -65
  237. package/src/storage/StorageSyncReader.ts +35 -17
  238. package/src/storage/WalletStorageManager.ts +18 -12
  239. package/src/storage/index.all.ts +2 -2
  240. package/src/storage/index.client.ts +2 -2
  241. package/src/storage/methods/attemptToPostReqsToNetwork.ts +3 -3
  242. package/src/storage/methods/createAction.ts +29 -26
  243. package/src/storage/methods/getBeefForTransaction.ts +3 -3
  244. package/src/storage/methods/getSyncChunk.ts +28 -13
  245. package/src/storage/methods/internalizeAction.ts +19 -17
  246. package/src/storage/methods/listActions.ts +5 -5
  247. package/src/storage/methods/listCertificates.ts +2 -2
  248. package/src/storage/methods/listOutputs.ts +5 -5
  249. package/src/storage/methods/processAction.ts +21 -17
  250. package/src/storage/methods/purgeData.ts +17 -11
  251. package/src/storage/methods/reviewStatus.ts +4 -4
  252. package/src/storage/remoting/StorageClient.ts +250 -26
  253. package/src/storage/schema/entities/Certificate.ts +16 -17
  254. package/src/storage/schema/entities/CertificateField.ts +17 -18
  255. package/src/storage/schema/entities/Commission.ts +16 -20
  256. package/src/storage/schema/entities/EntityBase.ts +1 -1
  257. package/src/storage/schema/entities/MergeEntity.ts +7 -7
  258. package/src/storage/schema/entities/Output.ts +16 -20
  259. package/src/storage/schema/entities/OutputBasket.ts +16 -17
  260. package/src/storage/schema/entities/OutputTag.ts +16 -20
  261. package/src/storage/schema/entities/OutputTagMap.ts +17 -18
  262. package/src/storage/schema/entities/ProvenTx.ts +24 -28
  263. package/src/storage/schema/entities/ProvenTxReq.ts +42 -45
  264. package/src/storage/schema/entities/SyncState.ts +61 -38
  265. package/src/storage/schema/entities/Transaction.ts +23 -23
  266. package/src/storage/schema/entities/TxLabel.ts +16 -17
  267. package/src/storage/schema/entities/TxLabelMap.ts +16 -20
  268. package/src/storage/schema/entities/User.ts +15 -19
  269. package/src/storage/schema/entities/__tests/CertificateFieldTests.test.ts +39 -318
  270. package/src/storage/schema/entities/__tests/CertificateTests.test.ts +29 -169
  271. package/src/storage/schema/entities/__tests/CommissionTests.test.ts +47 -325
  272. package/src/storage/schema/entities/__tests/OutputBasketTests.test.ts +35 -316
  273. package/src/storage/schema/entities/__tests/OutputTagMapTests.test.ts +38 -318
  274. package/src/storage/schema/entities/__tests/OutputTagTests.test.ts +36 -249
  275. package/src/storage/schema/entities/__tests/OutputTests.test.ts +30 -244
  276. package/src/storage/schema/entities/__tests/ProvenTxReqTests.test.ts +35 -101
  277. package/src/storage/schema/entities/__tests/ProvenTxTests.test.ts +27 -243
  278. package/src/storage/schema/entities/__tests/SyncStateTests.test.ts +54 -122
  279. package/src/storage/schema/entities/__tests/TransactionTests.test.ts +53 -333
  280. package/src/storage/schema/entities/__tests/TxLabelMapTests.test.ts +44 -177
  281. package/src/storage/schema/entities/__tests/TxLabelTests.test.ts +19 -163
  282. package/src/storage/schema/entities/__tests/usersTests.test.ts +31 -179
  283. package/src/storage/schema/tables/Certificate.ts +4 -4
  284. package/src/storage/schema/tables/CertificateField.ts +1 -1
  285. package/src/storage/schema/tables/Commission.ts +1 -1
  286. package/src/storage/schema/tables/MonitorEvent.ts +1 -1
  287. package/src/storage/schema/tables/Output.ts +5 -5
  288. package/src/storage/schema/tables/OutputBasket.ts +1 -1
  289. package/src/storage/schema/tables/OutputTag.ts +1 -1
  290. package/src/storage/schema/tables/OutputTagMap.ts +1 -1
  291. package/src/storage/schema/tables/ProvenTx.ts +1 -1
  292. package/src/storage/schema/tables/ProvenTxReq.ts +2 -2
  293. package/src/storage/schema/tables/SyncState.ts +1 -1
  294. package/src/storage/schema/tables/{Settings.ts → TableSettings.ts} +3 -1
  295. package/src/storage/schema/tables/Transaction.ts +1 -1
  296. package/src/storage/schema/tables/TxLabel.ts +1 -1
  297. package/src/storage/schema/tables/TxLabelMap.ts +1 -1
  298. package/src/storage/schema/tables/User.ts +1 -1
  299. package/src/storage/schema/tables/index.ts +1 -1
  300. package/src/storage/sync/StorageMySQLDojoReader.ts +68 -50
  301. package/test/Wallet/certificate/listCertificates.test.ts +12 -8
  302. package/test/Wallet/live/walletLive.man.test.ts +6 -6
  303. package/test/monitor/Monitor.test.ts +8 -8
  304. package/test/storage/StorageMySQLDojoReader.man.test.ts +1 -1
  305. package/test/storage/insert.test.ts +2 -2
  306. package/test/storage/update.test.ts +30 -30
  307. package/test/storage/update2.test.ts +23 -24
  308. package/test/utils/TestUtilsWalletStorage.ts +103 -82
  309. package/test/wallet/action/createActionToGenerateBeefs.man.test.ts +1 -2
  310. package/ts2md.json +1 -1
  311. package/out/src/storage/index.db.d.ts +0 -1
  312. package/out/src/storage/index.db.d.ts.map +0 -1
  313. package/out/src/storage/index.db.js +0 -2
  314. package/out/src/storage/index.db.js.map +0 -1
  315. package/out/src/storage/schema/tables/Settings.d.ts.map +0 -1
  316. package/out/src/storage/schema/tables/Settings.js.map +0 -1
  317. package/src/storage/index.db.ts +0 -0
@@ -1,6 +1,6 @@
1
1
  export * from './WalletStorageManager'
2
2
  export * from './StorageProvider'
3
3
  export * from './StorageSyncReader'
4
- export * as table from './schema/tables'
5
- export * as entity from './schema/entities'
4
+ export * from './schema/tables/index'
5
+ export * from './schema/entities/index'
6
6
  export * from './remoting/StorageClient'
@@ -1,6 +1,6 @@
1
1
  import { Beef } from '@bsv/sdk'
2
2
  import { StorageProvider } from '../StorageProvider'
3
- import { entity, sdk } from '../../index.client'
3
+ import { EntityProvenTxReq, sdk } from '../../index.client'
4
4
 
5
5
  /**
6
6
  * Attempt to post one or more `ProvenTxReq` with status 'unsent'
@@ -10,7 +10,7 @@ import { entity, sdk } from '../../index.client'
10
10
  */
11
11
  export async function attemptToPostReqsToNetwork(
12
12
  storage: StorageProvider,
13
- reqs: entity.ProvenTxReq[],
13
+ reqs: EntityProvenTxReq[],
14
14
  trx?: sdk.TrxToken
15
15
  ): Promise<PostReqsToNetworkResult> {
16
16
  const r: PostReqsToNetworkResult = {
@@ -169,7 +169,7 @@ export type PostReqsToNetworkDetailsStatus =
169
169
 
170
170
  export interface PostReqsToNetworkDetails {
171
171
  txid: string
172
- req: entity.ProvenTxReq
172
+ req: EntityProvenTxReq
173
173
  status: PostReqsToNetworkDetailsStatus
174
174
  pbrft: sdk.PostTxResultForTxid
175
175
  data?: string
@@ -14,14 +14,17 @@ import {
14
14
  import {
15
15
  asArray,
16
16
  asString,
17
- entity,
17
+ EntityProvenTx,
18
18
  randomBytesBase64,
19
19
  sdk,
20
20
  sha256Hash,
21
21
  stampLog,
22
22
  stampLogFormat,
23
23
  StorageProvider,
24
- table,
24
+ TableOutput,
25
+ TableOutputBasket,
26
+ TableOutputTag,
27
+ TableTransaction,
25
28
  validateStorageFeeModel,
26
29
  verifyId,
27
30
  verifyNumber,
@@ -157,8 +160,8 @@ export async function createAction(
157
160
  interface CreateTransactionSdkContext {
158
161
  xinputs: XValidCreateActionInput[]
159
162
  xoutputs: XValidCreateActionOutput[]
160
- changeBasket: table.OutputBasket
161
- noSendChangeIn: table.Output[]
163
+ changeBasket: TableOutputBasket
164
+ noSendChangeIn: TableOutput[]
162
165
  availableChangeCount: number
163
166
  feeModel: sdk.StorageFeeModel
164
167
  transactionId: number
@@ -168,7 +171,7 @@ interface XValidCreateActionInput extends sdk.ValidCreateActionInput {
168
171
  vin: number
169
172
  lockingScript: Script
170
173
  satoshis: number
171
- output?: table.Output
174
+ output?: TableOutput
172
175
  }
173
176
 
174
177
  export interface XValidCreateActionOutput extends sdk.ValidCreateActionOutput {
@@ -184,9 +187,9 @@ function makeDefaultOutput(
184
187
  transactionId: number,
185
188
  satoshis: number,
186
189
  vout: number
187
- ): table.Output {
190
+ ): TableOutput {
188
191
  const now = new Date()
189
- const output: table.Output = {
192
+ const output: TableOutput = {
190
193
  created_at: now,
191
194
  updated_at: now,
192
195
  outputId: 0,
@@ -219,13 +222,13 @@ async function createNewInputs(
219
222
  userId: number,
220
223
  vargs: sdk.ValidCreateActionArgs,
221
224
  ctx: CreateTransactionSdkContext,
222
- allocatedChange: table.Output[]
225
+ allocatedChange: TableOutput[]
223
226
  ): Promise<sdk.StorageCreateTransactionSdkInput[]> {
224
227
  const r: sdk.StorageCreateTransactionSdkInput[] = []
225
228
 
226
229
  const newInputs: {
227
230
  i?: XValidCreateActionInput
228
- o?: table.Output
231
+ o?: TableOutput
229
232
  unlockLen?: number
230
233
  }[] = []
231
234
  for (const i of ctx.xinputs) {
@@ -298,7 +301,7 @@ async function createNewOutputs(
298
301
  userId: number,
299
302
  vargs: sdk.ValidCreateActionArgs,
300
303
  ctx: CreateTransactionSdkContext,
301
- changeOutputs: table.Output[]
304
+ changeOutputs: TableOutput[]
302
305
  ): Promise<{
303
306
  outputs: sdk.StorageCreateTransactionSdkOutput[]
304
307
  changeVouts: number[]
@@ -306,7 +309,7 @@ async function createNewOutputs(
306
309
  const outputs: sdk.StorageCreateTransactionSdkOutput[] = []
307
310
 
308
311
  // Lookup output baskets
309
- const txBaskets: Record<string, table.OutputBasket> = {}
312
+ const txBaskets: Record<string, TableOutputBasket> = {}
310
313
  for (const xo of ctx.xoutputs) {
311
314
  if (xo.basket !== undefined && !txBaskets[xo.basket])
312
315
  txBaskets[xo.basket] = await storage.findOrInsertOutputBasket(
@@ -315,14 +318,14 @@ async function createNewOutputs(
315
318
  )
316
319
  }
317
320
  // Lookup output tags
318
- const txTags: Record<string, table.OutputTag> = {}
321
+ const txTags: Record<string, TableOutputTag> = {}
319
322
  for (const xo of ctx.xoutputs) {
320
323
  for (const tag of xo.tags) {
321
324
  txTags[tag] = await storage.findOrInsertOutputTag(userId, tag)
322
325
  }
323
326
  }
324
327
 
325
- const newOutputs: { o: table.Output; tags: string[] }[] = []
328
+ const newOutputs: { o: TableOutput; tags: string[] }[] = []
326
329
 
327
330
  for (const xo of ctx.xoutputs) {
328
331
  const lockingScript = asArray(xo.lockingScript)
@@ -463,9 +466,9 @@ async function createNewTxRecord(
463
466
  userId: number,
464
467
  vargs: sdk.ValidCreateActionArgs,
465
468
  storageBeef: Beef
466
- ): Promise<table.Transaction> {
469
+ ): Promise<TableTransaction> {
467
470
  const now = new Date()
468
- const newTx: table.Transaction = {
471
+ const newTx: TableTransaction = {
469
472
  created_at: now,
470
473
  updated_at: now,
471
474
  transactionId: 0,
@@ -695,7 +698,7 @@ async function validateRequiredInputs(
695
698
  `valid and contain proof data for ${txid}`
696
699
  )
697
700
  btx = beef.mergeRawTx(asArray(rawTx))
698
- if (proven) beef.mergeBump(new entity.ProvenTx(proven).getMerklePath())
701
+ if (proven) beef.mergeBump(new EntityProvenTx(proven).getMerklePath())
699
702
  }
700
703
  // btx is valid has parsed transaction data.
701
704
  if (vout >= btx.tx.outputs.length)
@@ -716,9 +719,9 @@ async function validateNoSendChange(
716
719
  storage: StorageProvider,
717
720
  userId: number,
718
721
  vargs: sdk.ValidCreateActionArgs,
719
- changeBasket: table.OutputBasket
720
- ): Promise<table.Output[]> {
721
- const r: table.Output[] = []
722
+ changeBasket: TableOutputBasket
723
+ ): Promise<TableOutput[]> {
724
+ const r: TableOutput[] = []
722
725
 
723
726
  if (!vargs.isNoSend) return []
724
727
 
@@ -761,8 +764,8 @@ async function fundNewTransactionSdk(
761
764
  vargs: sdk.ValidCreateActionArgs,
762
765
  ctx: CreateTransactionSdkContext
763
766
  ): Promise<{
764
- allocatedChange: table.Output[]
765
- changeOutputs: table.Output[]
767
+ allocatedChange: TableOutput[]
768
+ changeOutputs: TableOutput[]
766
769
  derivationPrefix: string
767
770
  }> {
768
771
  const params: GenerateChangeSdkParams = {
@@ -788,7 +791,7 @@ async function fundNewTransactionSdk(
788
791
  }
789
792
 
790
793
  const noSendChange = [...ctx.noSendChangeIn]
791
- const outputs: Record<number, table.Output> = {}
794
+ const outputs: Record<number, TableOutput> = {}
792
795
 
793
796
  const allocateChangeInput = async (
794
797
  targetSatoshis: number,
@@ -885,14 +888,14 @@ async function fundNewTransactionSdk(
885
888
  const derivationPrefix = randomDerivation(16)
886
889
 
887
890
  const r: {
888
- allocatedChange: table.Output[]
889
- changeOutputs: table.Output[]
891
+ allocatedChange: TableOutput[]
892
+ changeOutputs: TableOutput[]
890
893
  derivationPrefix: string
891
894
  } = {
892
895
  allocatedChange: gcr.allocatedChangeInputs.map(i => outputs[i.outputId]),
893
896
  changeOutputs: gcr.changeOutputs.map(
894
897
  (o, i) =>
895
- <table.Output>{
898
+ <TableOutput>{
896
899
  // what we knnow now and can insert into the database for this new transaction's change output
897
900
  created_at: new Date(),
898
901
  updated_at: new Date(),
@@ -949,7 +952,7 @@ async function mergeAllocatedChangeBeefs(
949
952
  storage: StorageProvider,
950
953
  userId: number,
951
954
  vargs: sdk.ValidCreateActionArgs,
952
- allocatedChange: table.Output[],
955
+ allocatedChange: TableOutput[],
953
956
  beef: Beef
954
957
  ): Promise<number[] | undefined> {
955
958
  const options: sdk.StorageGetBeefOptions = {
@@ -1,7 +1,7 @@
1
1
  import { Beef } from '@bsv/sdk'
2
2
  import {
3
3
  asBsvSdkTx,
4
- entity,
4
+ EntityProvenTx,
5
5
  sdk,
6
6
  StorageProvider,
7
7
  verifyTruthy
@@ -51,7 +51,7 @@ async function getProvenOrRawTxFromServices(
51
51
  options: sdk.StorageGetBeefOptions
52
52
  ): Promise<sdk.ProvenOrRawTx> {
53
53
  const services = storage.getServices()
54
- const por = await entity.ProvenTx.fromTxid(txid, await storage.getServices())
54
+ const por = await EntityProvenTx.fromTxid(txid, await storage.getServices())
55
55
  if (por.proven && !options.ignoreStorage && !options.ignoreNewProven) {
56
56
  por.proven.provenTxId = await storage.insertProvenTx(por.proven.toApi())
57
57
  }
@@ -111,7 +111,7 @@ async function mergeBeefForTransactionRecurse(
111
111
  // storage has proven this txid,
112
112
  // merge both the raw transaction and its merkle path
113
113
  beef.mergeRawTx(r.proven.rawTx)
114
- beef.mergeBump(new entity.ProvenTx(r.proven).getMerklePath())
114
+ beef.mergeBump(new EntityProvenTx(r.proven).getMerklePath())
115
115
  return beef
116
116
  }
117
117
 
@@ -1,4 +1,19 @@
1
- import { sdk, table, verifyTruthy } from '../../index.client'
1
+ import {
2
+ sdk,
3
+ TableCertificate,
4
+ TableCertificateField,
5
+ TableCommission,
6
+ TableOutput,
7
+ TableOutputBasket,
8
+ TableOutputTag,
9
+ TableOutputTagMap,
10
+ TableProvenTx,
11
+ TableProvenTxReq,
12
+ TableTransaction,
13
+ TableTxLabel,
14
+ TableTxLabelMap,
15
+ verifyTruthy
16
+ } from '../../index.client'
2
17
  import { StorageReader } from '../StorageReader'
3
18
 
4
19
  /**
@@ -34,7 +49,7 @@ export async function getSyncChunk(
34
49
  preAdd: () => {
35
50
  r.provenTxs = []
36
51
  },
37
- addItem: (i: table.ProvenTx) => {
52
+ addItem: (i: TableProvenTx) => {
38
53
  r.provenTxs!.push(i)
39
54
  },
40
55
  findItems: async (
@@ -50,7 +65,7 @@ export async function getSyncChunk(
50
65
  preAdd: () => {
51
66
  r.outputBaskets = []
52
67
  },
53
- addItem: (i: table.OutputBasket) => {
68
+ addItem: (i: TableOutputBasket) => {
54
69
  r.outputBaskets!.push(i)
55
70
  },
56
71
  findItems: async (
@@ -70,7 +85,7 @@ export async function getSyncChunk(
70
85
  preAdd: () => {
71
86
  r.outputTags = []
72
87
  },
73
- addItem: (i: table.OutputTag) => {
88
+ addItem: (i: TableOutputTag) => {
74
89
  r.outputTags!.push(i)
75
90
  },
76
91
  findItems: async (
@@ -90,7 +105,7 @@ export async function getSyncChunk(
90
105
  preAdd: () => {
91
106
  r.txLabels = []
92
107
  },
93
- addItem: (i: table.TxLabel) => {
108
+ addItem: (i: TableTxLabel) => {
94
109
  r.txLabels!.push(i)
95
110
  },
96
111
  findItems: async (
@@ -110,7 +125,7 @@ export async function getSyncChunk(
110
125
  preAdd: () => {
111
126
  r.transactions = []
112
127
  },
113
- addItem: (i: table.Transaction) => {
128
+ addItem: (i: TableTransaction) => {
114
129
  r.transactions!.push(i)
115
130
  },
116
131
  findItems: async (
@@ -130,7 +145,7 @@ export async function getSyncChunk(
130
145
  preAdd: () => {
131
146
  r.outputs = []
132
147
  },
133
- addItem: (i: table.Output) => {
148
+ addItem: (i: TableOutput) => {
134
149
  r.outputs!.push(i)
135
150
  },
136
151
  findItems: async (
@@ -150,7 +165,7 @@ export async function getSyncChunk(
150
165
  preAdd: () => {
151
166
  r.txLabelMaps = []
152
167
  },
153
- addItem: (i: table.TxLabelMap) => {
168
+ addItem: (i: TableTxLabelMap) => {
154
169
  r.txLabelMaps!.push(i)
155
170
  },
156
171
  findItems: async (
@@ -166,7 +181,7 @@ export async function getSyncChunk(
166
181
  preAdd: () => {
167
182
  r.outputTagMaps = []
168
183
  },
169
- addItem: (i: table.OutputTagMap) => {
184
+ addItem: (i: TableOutputTagMap) => {
170
185
  r.outputTagMaps!.push(i)
171
186
  },
172
187
  findItems: async (
@@ -182,7 +197,7 @@ export async function getSyncChunk(
182
197
  preAdd: () => {
183
198
  r.certificates = []
184
199
  },
185
- addItem: (i: table.Certificate) => {
200
+ addItem: (i: TableCertificate) => {
186
201
  r.certificates!.push(i)
187
202
  },
188
203
  findItems: async (
@@ -202,7 +217,7 @@ export async function getSyncChunk(
202
217
  preAdd: () => {
203
218
  r.certificateFields = []
204
219
  },
205
- addItem: (i: table.CertificateField) => {
220
+ addItem: (i: TableCertificateField) => {
206
221
  r.certificateFields!.push(i)
207
222
  },
208
223
  findItems: async (
@@ -222,7 +237,7 @@ export async function getSyncChunk(
222
237
  preAdd: () => {
223
238
  r.commissions = []
224
239
  },
225
- addItem: (i: table.Commission) => {
240
+ addItem: (i: TableCommission) => {
226
241
  r.commissions!.push(i)
227
242
  },
228
243
  findItems: async (
@@ -242,7 +257,7 @@ export async function getSyncChunk(
242
257
  preAdd: () => {
243
258
  r.provenTxReqs = []
244
259
  },
245
- addItem: (i: table.ProvenTxReq) => {
260
+ addItem: (i: TableProvenTxReq) => {
246
261
  r.provenTxReqs!.push(i)
247
262
  },
248
263
  findItems: async (
@@ -10,12 +10,14 @@ import {
10
10
  Beef
11
11
  } from '@bsv/sdk'
12
12
  import {
13
- entity,
13
+ EntityProvenTxReq,
14
14
  randomBytesBase64,
15
15
  sdk,
16
16
  stampLog,
17
17
  StorageProvider,
18
- table,
18
+ TableOutput,
19
+ TableOutputBasket,
20
+ TableTransaction,
19
21
  verifyId,
20
22
  verifyOne,
21
23
  verifyOneOrNone
@@ -77,7 +79,7 @@ interface BasketInsertionX extends BasketInsertion {
77
79
  /** incoming transaction output */
78
80
  txo: TransactionOutput
79
81
  /** if valid, corresponding storage output */
80
- eo?: table.Output
82
+ eo?: TableOutput
81
83
  }
82
84
 
83
85
  interface WalletPaymentX extends WalletPayment {
@@ -86,7 +88,7 @@ interface WalletPaymentX extends WalletPayment {
86
88
  /** incoming transaction output */
87
89
  txo: TransactionOutput
88
90
  /** if valid, corresponding storage output */
89
- eo?: table.Output
91
+ eo?: TableOutput
90
92
  /** corresponds to an existing change output */
91
93
  ignore: boolean
92
94
  }
@@ -99,13 +101,13 @@ class InternalizeActionContext {
99
101
  /** the incoming transaction extracted from AtomicBEEF */
100
102
  tx: BsvTransaction
101
103
  /** the user's change basket */
102
- changeBasket: table.OutputBasket
104
+ changeBasket: TableOutputBasket
103
105
  /** cached baskets referenced by basket insertions */
104
- baskets: Record<string, table.OutputBasket>
106
+ baskets: Record<string, TableOutputBasket>
105
107
  /** existing storage transaction for this txid and userId */
106
- etx?: table.Transaction
108
+ etx?: TableTransaction
107
109
  /** existing outputs */
108
- eos: table.Output[]
110
+ eos: TableOutput[]
109
111
  /** all the basket insertions from incoming outputs array */
110
112
  basketInsertions: BasketInsertionX[]
111
113
  /** all the wallet payments from incoming outputs array */
@@ -128,7 +130,7 @@ class InternalizeActionContext {
128
130
  }
129
131
  this.ab = new Beef()
130
132
  this.tx = new BsvTransaction()
131
- this.changeBasket = {} as table.OutputBasket
133
+ this.changeBasket = {} as TableOutputBasket
132
134
  this.baskets = {}
133
135
  this.basketInsertions = []
134
136
  this.walletPayments = []
@@ -154,7 +156,7 @@ class InternalizeActionContext {
154
156
  this.r.satoshis = v
155
157
  }
156
158
 
157
- async getBasket(basketName: string): Promise<table.OutputBasket> {
159
+ async getBasket(basketName: string): Promise<TableOutputBasket> {
158
160
  let b = this.baskets[basketName]
159
161
  if (b) return b
160
162
  b = await this.storage.findOrInsertOutputBasket(this.userId, basketName)
@@ -322,9 +324,9 @@ class InternalizeActionContext {
322
324
  async findOrInsertTargetTransaction(
323
325
  satoshis: number,
324
326
  status: sdk.TransactionStatus
325
- ): Promise<table.Transaction> {
327
+ ): Promise<TableTransaction> {
326
328
  const now = new Date()
327
- const newTx: table.Transaction = {
329
+ const newTx: TableTransaction = {
328
330
  created_at: now,
329
331
  updated_at: now,
330
332
  transactionId: 0,
@@ -386,7 +388,7 @@ class InternalizeActionContext {
386
388
 
387
389
  // transaction record for user is new, but the txid may not be new to storage
388
390
  // make sure storage pursues getting a proof for it.
389
- const newReq = entity.ProvenTxReq.fromTxid(
391
+ const newReq = EntityProvenTxReq.fromTxid(
390
392
  this.txid,
391
393
  this.tx.toBinary(),
392
394
  this.args.tx
@@ -428,7 +430,7 @@ class InternalizeActionContext {
428
430
  payment: WalletPaymentX
429
431
  ): Promise<void> {
430
432
  const now = new Date()
431
- const txOut: table.Output = {
433
+ const txOut: TableOutput = {
432
434
  created_at: now,
433
435
  updated_at: now,
434
436
  outputId: 0,
@@ -462,7 +464,7 @@ class InternalizeActionContext {
462
464
  payment: WalletPaymentX
463
465
  ) {
464
466
  const outputId = payment.eo!.outputId!
465
- const update: Partial<table.Output> = {
467
+ const update: Partial<TableOutput> = {
466
468
  basketId: this.changeBasket.basketId,
467
469
  type: 'P2PKH',
468
470
  customInstructions: undefined,
@@ -482,7 +484,7 @@ class InternalizeActionContext {
482
484
  basket: BasketInsertionX
483
485
  ) {
484
486
  const outputId = basket.eo!.outputId!
485
- const update: Partial<table.Output> = {
487
+ const update: Partial<TableOutput> = {
486
488
  basketId: (await this.getBasket(basket.basket)).basketId,
487
489
  type: 'custom',
488
490
  customInstructions: basket.customInstructions,
@@ -502,7 +504,7 @@ class InternalizeActionContext {
502
504
  basket: BasketInsertionX
503
505
  ): Promise<void> {
504
506
  const now = new Date()
505
- const txOut: table.Output = {
507
+ const txOut: TableOutput = {
506
508
  created_at: now,
507
509
  updated_at: now,
508
510
  outputId: 0,
@@ -6,7 +6,7 @@ import {
6
6
  WalletActionOutput,
7
7
  WalletActionInput
8
8
  } from '@bsv/sdk'
9
- import { table } from '../index.client'
9
+ import { TableOutputX, TableTransaction, TableTxLabel } from '../index.client'
10
10
  import { asString, sdk, verifyOne } from '../../index.client'
11
11
  import { StorageKnex } from '../StorageKnex'
12
12
 
@@ -27,7 +27,7 @@ export async function listActions(
27
27
 
28
28
  let labelIds: number[] = []
29
29
  if (vargs.labels.length > 0) {
30
- const q = k<table.TxLabel>('tx_labels')
30
+ const q = k<TableTxLabel>('tx_labels')
31
31
  .where({
32
32
  userId: auth.userId,
33
33
  isDeleted: false
@@ -107,7 +107,7 @@ export async function listActions(
107
107
 
108
108
  q.limit(limit).offset(offset).orderBy('transactionId', 'asc')
109
109
 
110
- const txs: Partial<table.Transaction>[] = await q
110
+ const txs: Partial<TableTransaction>[] = await q
111
111
 
112
112
  if (!limit || txs.length < limit) r.totalActions = txs.length
113
113
  else {
@@ -141,7 +141,7 @@ export async function listActions(
141
141
  ).map(l => l.label)
142
142
  }
143
143
  if (vargs.includeOutputs) {
144
- const outputs: table.OutputX[] = await storage.findOutputs({
144
+ const outputs: TableOutputX[] = await storage.findOutputs({
145
145
  partial: { transactionId: tx.transactionId },
146
146
  noScript: !vargs.includeOutputLockingScripts
147
147
  })
@@ -162,7 +162,7 @@ export async function listActions(
162
162
  }
163
163
  }
164
164
  if (vargs.includeInputs) {
165
- const inputs: table.OutputX[] = await storage.findOutputs({
165
+ const inputs: TableOutputX[] = await storage.findOutputs({
166
166
  partial: { spentBy: tx.transactionId },
167
167
  noScript: !vargs.includeInputSourceLockingScripts
168
168
  })
@@ -2,7 +2,7 @@ import {
2
2
  ListCertificatesResult,
3
3
  OriginatorDomainNameStringUnder250Bytes
4
4
  } from '@bsv/sdk'
5
- import { StorageProvider, table } from '../index.client'
5
+ import { StorageProvider, TableCertificate } from '../index.client'
6
6
  import { sdk } from '../../index.client'
7
7
 
8
8
  export async function listCertificates(
@@ -13,7 +13,7 @@ export async function listCertificates(
13
13
  ): Promise<ListCertificatesResult> {
14
14
  const paged: sdk.Paged = { limit: vargs.limit, offset: vargs.offset }
15
15
 
16
- const partial: Partial<table.Certificate> = {
16
+ const partial: Partial<TableCertificate> = {
17
17
  userId: auth.userId,
18
18
  isDeleted: false
19
19
  }
@@ -4,7 +4,7 @@ import {
4
4
  OriginatorDomainNameStringUnder250Bytes,
5
5
  WalletOutput
6
6
  } from '@bsv/sdk'
7
- import { table } from '../index.client'
7
+ import { TableOutput, TableOutputBasket, TableOutputTag } from '../index.client'
8
8
  import { asString, sdk, verifyId, verifyOne } from '../../index.client'
9
9
  import { StorageKnex } from '../StorageKnex'
10
10
 
@@ -39,7 +39,7 @@ export async function listOutputs(
39
39
  */
40
40
 
41
41
  let basketId: number | undefined = undefined
42
- const basketsById: Record<number, table.OutputBasket> = {}
42
+ const basketsById: Record<number, TableOutputBasket> = {}
43
43
  if (vargs.basket) {
44
44
  const baskets = await dsk.findOutputBaskets({
45
45
  partial: { userId, name: vargs.basket },
@@ -56,7 +56,7 @@ export async function listOutputs(
56
56
 
57
57
  let tagIds: number[] = []
58
58
  if (vargs.tags && vargs.tags.length > 0) {
59
- const q = k<table.OutputTag>('output_tags')
59
+ const q = k<TableOutputTag>('output_tags')
60
60
  .where({
61
61
  userId: userId,
62
62
  isDeleted: false
@@ -119,7 +119,7 @@ export async function listOutputs(
119
119
  }
120
120
 
121
121
  const makeWithoutTagsQueries = () => {
122
- const where: Partial<table.Output> = { userId }
122
+ const where: Partial<TableOutput> = { userId }
123
123
  if (basketId) where.basketId = basketId
124
124
  if (!includeSpent) where.spendable = true
125
125
  const q = k('outputs').where(where).whereRaw(txStatusOk)
@@ -134,7 +134,7 @@ export async function listOutputs(
134
134
  // Sort order when limit and offset are possible must be ascending for determinism.
135
135
  q.limit(limit).offset(offset).orderBy('outputId', 'asc')
136
136
 
137
- const outputs: table.Output[] = await q
137
+ const outputs: TableOutput[] = await q
138
138
 
139
139
  if (!limit || outputs.length < limit) r.totalOutputs = outputs.length
140
140
  else {