@bsv/wallet-toolbox-client 1.1.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 (390) hide show
  1. package/out/src/Wallet.d.ts +83 -0
  2. package/out/src/Wallet.d.ts.map +1 -0
  3. package/out/src/Wallet.js +415 -0
  4. package/out/src/Wallet.js.map +1 -0
  5. package/out/src/index.client.d.ts +8 -0
  6. package/out/src/index.client.d.ts.map +1 -0
  7. package/out/src/index.client.js +47 -0
  8. package/out/src/index.client.js.map +1 -0
  9. package/out/src/monitor/Monitor.d.ts +89 -0
  10. package/out/src/monitor/Monitor.d.ts.map +1 -0
  11. package/out/src/monitor/Monitor.js +253 -0
  12. package/out/src/monitor/Monitor.js.map +1 -0
  13. package/out/src/monitor/tasks/TaskCheckForProofs.d.ts +53 -0
  14. package/out/src/monitor/tasks/TaskCheckForProofs.d.ts.map +1 -0
  15. package/out/src/monitor/tasks/TaskCheckForProofs.js +197 -0
  16. package/out/src/monitor/tasks/TaskCheckForProofs.js.map +1 -0
  17. package/out/src/monitor/tasks/TaskClock.d.ts +14 -0
  18. package/out/src/monitor/tasks/TaskClock.d.ts.map +1 -0
  19. package/out/src/monitor/tasks/TaskClock.js +27 -0
  20. package/out/src/monitor/tasks/TaskClock.js.map +1 -0
  21. package/out/src/monitor/tasks/TaskFailAbandoned.d.ts +20 -0
  22. package/out/src/monitor/tasks/TaskFailAbandoned.d.ts.map +1 -0
  23. package/out/src/monitor/tasks/TaskFailAbandoned.js +52 -0
  24. package/out/src/monitor/tasks/TaskFailAbandoned.js.map +1 -0
  25. package/out/src/monitor/tasks/TaskNewHeader.d.ts +15 -0
  26. package/out/src/monitor/tasks/TaskNewHeader.d.ts.map +1 -0
  27. package/out/src/monitor/tasks/TaskNewHeader.js +45 -0
  28. package/out/src/monitor/tasks/TaskNewHeader.js.map +1 -0
  29. package/out/src/monitor/tasks/TaskPurge.d.ts +45 -0
  30. package/out/src/monitor/tasks/TaskPurge.d.ts.map +1 -0
  31. package/out/src/monitor/tasks/TaskPurge.js +35 -0
  32. package/out/src/monitor/tasks/TaskPurge.js.map +1 -0
  33. package/out/src/monitor/tasks/TaskReviewStatus.d.ts +26 -0
  34. package/out/src/monitor/tasks/TaskReviewStatus.d.ts.map +1 -0
  35. package/out/src/monitor/tasks/TaskReviewStatus.js +44 -0
  36. package/out/src/monitor/tasks/TaskReviewStatus.js.map +1 -0
  37. package/out/src/monitor/tasks/TaskSendWaiting.d.ts +32 -0
  38. package/out/src/monitor/tasks/TaskSendWaiting.d.ts.map +1 -0
  39. package/out/src/monitor/tasks/TaskSendWaiting.js +99 -0
  40. package/out/src/monitor/tasks/TaskSendWaiting.js.map +1 -0
  41. package/out/src/monitor/tasks/TaskSyncWhenIdle.d.ts +12 -0
  42. package/out/src/monitor/tasks/TaskSyncWhenIdle.d.ts.map +1 -0
  43. package/out/src/monitor/tasks/TaskSyncWhenIdle.js +22 -0
  44. package/out/src/monitor/tasks/TaskSyncWhenIdle.js.map +1 -0
  45. package/out/src/monitor/tasks/WalletMonitorTask.d.ts +40 -0
  46. package/out/src/monitor/tasks/WalletMonitorTask.d.ts.map +1 -0
  47. package/out/src/monitor/tasks/WalletMonitorTask.js +37 -0
  48. package/out/src/monitor/tasks/WalletMonitorTask.js.map +1 -0
  49. package/out/src/sdk/CertOps.d.ts +66 -0
  50. package/out/src/sdk/CertOps.d.ts.map +1 -0
  51. package/out/src/sdk/CertOps.js +198 -0
  52. package/out/src/sdk/CertOps.js.map +1 -0
  53. package/out/src/sdk/PrivilegedKeyManager.d.ts +125 -0
  54. package/out/src/sdk/PrivilegedKeyManager.d.ts.map +1 -0
  55. package/out/src/sdk/PrivilegedKeyManager.js +293 -0
  56. package/out/src/sdk/PrivilegedKeyManager.js.map +1 -0
  57. package/out/src/sdk/StorageSyncReader.d.ts +121 -0
  58. package/out/src/sdk/StorageSyncReader.d.ts.map +1 -0
  59. package/out/src/sdk/StorageSyncReader.js +3 -0
  60. package/out/src/sdk/StorageSyncReader.js.map +1 -0
  61. package/out/src/sdk/StorageSyncReaderWriter.d.ts +89 -0
  62. package/out/src/sdk/StorageSyncReaderWriter.d.ts.map +1 -0
  63. package/out/src/sdk/StorageSyncReaderWriter.js +3 -0
  64. package/out/src/sdk/StorageSyncReaderWriter.js.map +1 -0
  65. package/out/src/sdk/WERR_errors.d.ts +90 -0
  66. package/out/src/sdk/WERR_errors.d.ts.map +1 -0
  67. package/out/src/sdk/WERR_errors.js +128 -0
  68. package/out/src/sdk/WERR_errors.js.map +1 -0
  69. package/out/src/sdk/WalletError.d.ts +45 -0
  70. package/out/src/sdk/WalletError.d.ts.map +1 -0
  71. package/out/src/sdk/WalletError.js +122 -0
  72. package/out/src/sdk/WalletError.js.map +1 -0
  73. package/out/src/sdk/WalletServices.interfaces.d.ts +325 -0
  74. package/out/src/sdk/WalletServices.interfaces.d.ts.map +1 -0
  75. package/out/src/sdk/WalletServices.interfaces.js +3 -0
  76. package/out/src/sdk/WalletServices.interfaces.js.map +1 -0
  77. package/out/src/sdk/WalletSigner.interfaces.d.ts +10 -0
  78. package/out/src/sdk/WalletSigner.interfaces.d.ts.map +1 -0
  79. package/out/src/sdk/WalletSigner.interfaces.js +3 -0
  80. package/out/src/sdk/WalletSigner.interfaces.js.map +1 -0
  81. package/out/src/sdk/WalletStorage.interfaces.d.ts +299 -0
  82. package/out/src/sdk/WalletStorage.interfaces.d.ts.map +1 -0
  83. package/out/src/sdk/WalletStorage.interfaces.js +3 -0
  84. package/out/src/sdk/WalletStorage.interfaces.js.map +1 -0
  85. package/out/src/sdk/index.d.ts +12 -0
  86. package/out/src/sdk/index.d.ts.map +1 -0
  87. package/out/src/sdk/index.js +28 -0
  88. package/out/src/sdk/index.js.map +1 -0
  89. package/out/src/sdk/types.d.ts +74 -0
  90. package/out/src/sdk/types.d.ts.map +1 -0
  91. package/out/src/sdk/types.js +20 -0
  92. package/out/src/sdk/types.js.map +1 -0
  93. package/out/src/sdk/validationHelpers.d.ts +288 -0
  94. package/out/src/sdk/validationHelpers.d.ts.map +1 -0
  95. package/out/src/sdk/validationHelpers.js +630 -0
  96. package/out/src/sdk/validationHelpers.js.map +1 -0
  97. package/out/src/services/ServiceCollection.d.ts +25 -0
  98. package/out/src/services/ServiceCollection.d.ts.map +1 -0
  99. package/out/src/services/ServiceCollection.js +43 -0
  100. package/out/src/services/ServiceCollection.js.map +1 -0
  101. package/out/src/services/Services.d.ts +60 -0
  102. package/out/src/services/Services.d.ts.map +1 -0
  103. package/out/src/services/Services.js +342 -0
  104. package/out/src/services/Services.js.map +1 -0
  105. package/out/src/services/chaintracker/ChaintracksChainTracker.d.ts +15 -0
  106. package/out/src/services/chaintracker/ChaintracksChainTracker.d.ts.map +1 -0
  107. package/out/src/services/chaintracker/ChaintracksChainTracker.js +51 -0
  108. package/out/src/services/chaintracker/ChaintracksChainTracker.js.map +1 -0
  109. package/out/src/services/chaintracker/chaintracks/BlockHeaderApi.d.ts +98 -0
  110. package/out/src/services/chaintracker/chaintracks/BlockHeaderApi.d.ts.map +1 -0
  111. package/out/src/services/chaintracker/chaintracks/BlockHeaderApi.js +38 -0
  112. package/out/src/services/chaintracker/chaintracks/BlockHeaderApi.js.map +1 -0
  113. package/out/src/services/chaintracker/chaintracks/ChaintracksServiceClient.d.ts +36 -0
  114. package/out/src/services/chaintracker/chaintracks/ChaintracksServiceClient.d.ts.map +1 -0
  115. package/out/src/services/chaintracker/chaintracks/ChaintracksServiceClient.js +130 -0
  116. package/out/src/services/chaintracker/chaintracks/ChaintracksServiceClient.js.map +1 -0
  117. package/out/src/services/chaintracker/chaintracks/index.d.ts +3 -0
  118. package/out/src/services/chaintracker/chaintracks/index.d.ts.map +1 -0
  119. package/out/src/services/chaintracker/chaintracks/index.js +19 -0
  120. package/out/src/services/chaintracker/chaintracks/index.js.map +1 -0
  121. package/out/src/services/chaintracker/index.d.ts +3 -0
  122. package/out/src/services/chaintracker/index.d.ts.map +1 -0
  123. package/out/src/services/chaintracker/index.js +19 -0
  124. package/out/src/services/chaintracker/index.js.map +1 -0
  125. package/out/src/services/createDefaultWalletServicesOptions.d.ts +3 -0
  126. package/out/src/services/createDefaultWalletServicesOptions.d.ts.map +1 -0
  127. package/out/src/services/createDefaultWalletServicesOptions.js +34 -0
  128. package/out/src/services/createDefaultWalletServicesOptions.js.map +1 -0
  129. package/out/src/services/providers/arcServices.d.ts +62 -0
  130. package/out/src/services/providers/arcServices.d.ts.map +1 -0
  131. package/out/src/services/providers/arcServices.js +368 -0
  132. package/out/src/services/providers/arcServices.js.map +1 -0
  133. package/out/src/services/providers/echangeRates.d.ts +12 -0
  134. package/out/src/services/providers/echangeRates.d.ts.map +1 -0
  135. package/out/src/services/providers/echangeRates.js +237 -0
  136. package/out/src/services/providers/echangeRates.js.map +1 -0
  137. package/out/src/services/providers/whatsonchain.d.ts +17 -0
  138. package/out/src/services/providers/whatsonchain.d.ts.map +1 -0
  139. package/out/src/services/providers/whatsonchain.js +130 -0
  140. package/out/src/services/providers/whatsonchain.js.map +1 -0
  141. package/out/src/signer/WalletSigner.d.ts +11 -0
  142. package/out/src/signer/WalletSigner.d.ts.map +1 -0
  143. package/out/src/signer/WalletSigner.js +13 -0
  144. package/out/src/signer/WalletSigner.js.map +1 -0
  145. package/out/src/signer/methods/acquireDirectCertificate.d.ts +4 -0
  146. package/out/src/signer/methods/acquireDirectCertificate.d.ts.map +1 -0
  147. package/out/src/signer/methods/acquireDirectCertificate.js +47 -0
  148. package/out/src/signer/methods/acquireDirectCertificate.js.map +1 -0
  149. package/out/src/signer/methods/createAction.d.ts +7 -0
  150. package/out/src/signer/methods/createAction.d.ts.map +1 -0
  151. package/out/src/signer/methods/createAction.js +250 -0
  152. package/out/src/signer/methods/createAction.js.map +1 -0
  153. package/out/src/signer/methods/internalizeAction.d.ts +31 -0
  154. package/out/src/signer/methods/internalizeAction.d.ts.map +1 -0
  155. package/out/src/signer/methods/internalizeAction.js +95 -0
  156. package/out/src/signer/methods/internalizeAction.js.map +1 -0
  157. package/out/src/signer/methods/proveCertificate.d.ts +4 -0
  158. package/out/src/signer/methods/proveCertificate.d.ts.map +1 -0
  159. package/out/src/signer/methods/proveCertificate.js +45 -0
  160. package/out/src/signer/methods/proveCertificate.js.map +1 -0
  161. package/out/src/signer/methods/signAction.d.ts +6 -0
  162. package/out/src/signer/methods/signAction.d.ts.map +1 -0
  163. package/out/src/signer/methods/signAction.js +79 -0
  164. package/out/src/signer/methods/signAction.js.map +1 -0
  165. package/out/src/storage/StorageProvider.d.ts +140 -0
  166. package/out/src/storage/StorageProvider.d.ts.map +1 -0
  167. package/out/src/storage/StorageProvider.js +539 -0
  168. package/out/src/storage/StorageProvider.js.map +1 -0
  169. package/out/src/storage/StorageReader.d.ts +76 -0
  170. package/out/src/storage/StorageReader.d.ts.map +1 -0
  171. package/out/src/storage/StorageReader.js +124 -0
  172. package/out/src/storage/StorageReader.js.map +1 -0
  173. package/out/src/storage/StorageReaderWriter.d.ts +87 -0
  174. package/out/src/storage/StorageReaderWriter.d.ts.map +1 -0
  175. package/out/src/storage/StorageReaderWriter.js +337 -0
  176. package/out/src/storage/StorageReaderWriter.js.map +1 -0
  177. package/out/src/storage/StorageSyncReader.d.ts +33 -0
  178. package/out/src/storage/StorageSyncReader.d.ts.map +1 -0
  179. package/out/src/storage/StorageSyncReader.js +142 -0
  180. package/out/src/storage/StorageSyncReader.js.map +1 -0
  181. package/out/src/storage/WalletStorageManager.d.ts +103 -0
  182. package/out/src/storage/WalletStorageManager.d.ts.map +1 -0
  183. package/out/src/storage/WalletStorageManager.js +408 -0
  184. package/out/src/storage/WalletStorageManager.js.map +1 -0
  185. package/out/src/storage/index.client.d.ts +7 -0
  186. package/out/src/storage/index.client.d.ts.map +1 -0
  187. package/out/src/storage/index.client.js +46 -0
  188. package/out/src/storage/index.client.js.map +1 -0
  189. package/out/src/storage/methods/attemptToPostReqsToNetwork.d.ts +27 -0
  190. package/out/src/storage/methods/attemptToPostReqsToNetwork.d.ts.map +1 -0
  191. package/out/src/storage/methods/attemptToPostReqsToNetwork.js +148 -0
  192. package/out/src/storage/methods/attemptToPostReqsToNetwork.js.map +1 -0
  193. package/out/src/storage/methods/createAction.d.ts +23 -0
  194. package/out/src/storage/methods/createAction.d.ts.map +1 -0
  195. package/out/src/storage/methods/createAction.js +663 -0
  196. package/out/src/storage/methods/createAction.js.map +1 -0
  197. package/out/src/storage/methods/generateChange.d.ts +108 -0
  198. package/out/src/storage/methods/generateChange.d.ts.map +1 -0
  199. package/out/src/storage/methods/generateChange.js +422 -0
  200. package/out/src/storage/methods/generateChange.js.map +1 -0
  201. package/out/src/storage/methods/getBeefForTransaction.d.ts +22 -0
  202. package/out/src/storage/methods/getBeefForTransaction.d.ts.map +1 -0
  203. package/out/src/storage/methods/getBeefForTransaction.js +94 -0
  204. package/out/src/storage/methods/getBeefForTransaction.js.map +1 -0
  205. package/out/src/storage/methods/getSyncChunk.d.ts +10 -0
  206. package/out/src/storage/methods/getSyncChunk.d.ts.map +1 -0
  207. package/out/src/storage/methods/getSyncChunk.js +271 -0
  208. package/out/src/storage/methods/getSyncChunk.js.map +1 -0
  209. package/out/src/storage/methods/internalizeAction.d.ts +38 -0
  210. package/out/src/storage/methods/internalizeAction.d.ts.map +1 -0
  211. package/out/src/storage/methods/internalizeAction.js +378 -0
  212. package/out/src/storage/methods/internalizeAction.js.map +1 -0
  213. package/out/src/storage/methods/listCertificates.d.ts +5 -0
  214. package/out/src/storage/methods/listCertificates.d.ts.map +1 -0
  215. package/out/src/storage/methods/listCertificates.js +68 -0
  216. package/out/src/storage/methods/listCertificates.js.map +1 -0
  217. package/out/src/storage/methods/processAction.d.ts +35 -0
  218. package/out/src/storage/methods/processAction.d.ts.map +1 -0
  219. package/out/src/storage/methods/processAction.js +271 -0
  220. package/out/src/storage/methods/processAction.js.map +1 -0
  221. package/out/src/storage/remoting/StorageClient.d.ts +56 -0
  222. package/out/src/storage/remoting/StorageClient.d.ts.map +1 -0
  223. package/out/src/storage/remoting/StorageClient.js +181 -0
  224. package/out/src/storage/remoting/StorageClient.js.map +1 -0
  225. package/out/src/storage/schema/entities/Certificate.d.ts +43 -0
  226. package/out/src/storage/schema/entities/Certificate.d.ts.map +1 -0
  227. package/out/src/storage/schema/entities/Certificate.js +162 -0
  228. package/out/src/storage/schema/entities/Certificate.js.map +1 -0
  229. package/out/src/storage/schema/entities/CertificateField.d.ts +32 -0
  230. package/out/src/storage/schema/entities/CertificateField.d.ts.map +1 -0
  231. package/out/src/storage/schema/entities/CertificateField.js +114 -0
  232. package/out/src/storage/schema/entities/CertificateField.js.map +1 -0
  233. package/out/src/storage/schema/entities/Commission.d.ts +37 -0
  234. package/out/src/storage/schema/entities/Commission.d.ts.map +1 -0
  235. package/out/src/storage/schema/entities/Commission.js +130 -0
  236. package/out/src/storage/schema/entities/Commission.js.map +1 -0
  237. package/out/src/storage/schema/entities/EntityBase.d.ts +105 -0
  238. package/out/src/storage/schema/entities/EntityBase.d.ts.map +1 -0
  239. package/out/src/storage/schema/entities/EntityBase.js +100 -0
  240. package/out/src/storage/schema/entities/EntityBase.js.map +1 -0
  241. package/out/src/storage/schema/entities/MergeEntity.d.ts +34 -0
  242. package/out/src/storage/schema/entities/MergeEntity.d.ts.map +1 -0
  243. package/out/src/storage/schema/entities/MergeEntity.js +57 -0
  244. package/out/src/storage/schema/entities/MergeEntity.js.map +1 -0
  245. package/out/src/storage/schema/entities/Output.d.ts +67 -0
  246. package/out/src/storage/schema/entities/Output.d.ts.map +1 -0
  247. package/out/src/storage/schema/entities/Output.js +281 -0
  248. package/out/src/storage/schema/entities/Output.js.map +1 -0
  249. package/out/src/storage/schema/entities/OutputBasket.d.ts +35 -0
  250. package/out/src/storage/schema/entities/OutputBasket.d.ts.map +1 -0
  251. package/out/src/storage/schema/entities/OutputBasket.js +133 -0
  252. package/out/src/storage/schema/entities/OutputBasket.js.map +1 -0
  253. package/out/src/storage/schema/entities/OutputTag.d.ts +31 -0
  254. package/out/src/storage/schema/entities/OutputTag.d.ts.map +1 -0
  255. package/out/src/storage/schema/entities/OutputTag.js +104 -0
  256. package/out/src/storage/schema/entities/OutputTag.js.map +1 -0
  257. package/out/src/storage/schema/entities/OutputTagMap.d.ts +28 -0
  258. package/out/src/storage/schema/entities/OutputTagMap.d.ts.map +1 -0
  259. package/out/src/storage/schema/entities/OutputTagMap.js +101 -0
  260. package/out/src/storage/schema/entities/OutputTagMap.js.map +1 -0
  261. package/out/src/storage/schema/entities/ProvenTx.d.ts +84 -0
  262. package/out/src/storage/schema/entities/ProvenTx.d.ts.map +1 -0
  263. package/out/src/storage/schema/entities/ProvenTx.js +283 -0
  264. package/out/src/storage/schema/entities/ProvenTx.js.map +1 -0
  265. package/out/src/storage/schema/entities/ProvenTxReq.d.ts +130 -0
  266. package/out/src/storage/schema/entities/ProvenTxReq.d.ts.map +1 -0
  267. package/out/src/storage/schema/entities/ProvenTxReq.js +521 -0
  268. package/out/src/storage/schema/entities/ProvenTxReq.js.map +1 -0
  269. package/out/src/storage/schema/entities/SyncState.d.ts +66 -0
  270. package/out/src/storage/schema/entities/SyncState.d.ts.map +1 -0
  271. package/out/src/storage/schema/entities/SyncState.js +284 -0
  272. package/out/src/storage/schema/entities/SyncState.js.map +1 -0
  273. package/out/src/storage/schema/entities/Transaction.d.ts +67 -0
  274. package/out/src/storage/schema/entities/Transaction.d.ts.map +1 -0
  275. package/out/src/storage/schema/entities/Transaction.js +264 -0
  276. package/out/src/storage/schema/entities/Transaction.js.map +1 -0
  277. package/out/src/storage/schema/entities/TxLabel.d.ts +31 -0
  278. package/out/src/storage/schema/entities/TxLabel.d.ts.map +1 -0
  279. package/out/src/storage/schema/entities/TxLabel.js +104 -0
  280. package/out/src/storage/schema/entities/TxLabel.js.map +1 -0
  281. package/out/src/storage/schema/entities/TxLabelMap.d.ts +28 -0
  282. package/out/src/storage/schema/entities/TxLabelMap.d.ts.map +1 -0
  283. package/out/src/storage/schema/entities/TxLabelMap.js +103 -0
  284. package/out/src/storage/schema/entities/TxLabelMap.js.map +1 -0
  285. package/out/src/storage/schema/entities/User.d.ts +29 -0
  286. package/out/src/storage/schema/entities/User.d.ts.map +1 -0
  287. package/out/src/storage/schema/entities/User.js +100 -0
  288. package/out/src/storage/schema/entities/User.js.map +1 -0
  289. package/out/src/storage/schema/entities/index.d.ts +17 -0
  290. package/out/src/storage/schema/entities/index.d.ts.map +1 -0
  291. package/out/src/storage/schema/entities/index.js +33 -0
  292. package/out/src/storage/schema/entities/index.js.map +1 -0
  293. package/out/src/storage/schema/tables/Certificate.d.ts +20 -0
  294. package/out/src/storage/schema/tables/Certificate.d.ts.map +1 -0
  295. package/out/src/storage/schema/tables/Certificate.js +3 -0
  296. package/out/src/storage/schema/tables/Certificate.js.map +1 -0
  297. package/out/src/storage/schema/tables/CertificateField.d.ts +12 -0
  298. package/out/src/storage/schema/tables/CertificateField.d.ts.map +1 -0
  299. package/out/src/storage/schema/tables/CertificateField.js +3 -0
  300. package/out/src/storage/schema/tables/CertificateField.js.map +1 -0
  301. package/out/src/storage/schema/tables/Commission.d.ts +13 -0
  302. package/out/src/storage/schema/tables/Commission.d.ts.map +1 -0
  303. package/out/src/storage/schema/tables/Commission.js +3 -0
  304. package/out/src/storage/schema/tables/Commission.js.map +1 -0
  305. package/out/src/storage/schema/tables/MonitorEvent.d.ts +9 -0
  306. package/out/src/storage/schema/tables/MonitorEvent.d.ts.map +1 -0
  307. package/out/src/storage/schema/tables/MonitorEvent.js +3 -0
  308. package/out/src/storage/schema/tables/MonitorEvent.js.map +1 -0
  309. package/out/src/storage/schema/tables/Output.d.ts +36 -0
  310. package/out/src/storage/schema/tables/Output.d.ts.map +1 -0
  311. package/out/src/storage/schema/tables/Output.js +31 -0
  312. package/out/src/storage/schema/tables/Output.js.map +1 -0
  313. package/out/src/storage/schema/tables/OutputBasket.d.ts +12 -0
  314. package/out/src/storage/schema/tables/OutputBasket.d.ts.map +1 -0
  315. package/out/src/storage/schema/tables/OutputBasket.js +3 -0
  316. package/out/src/storage/schema/tables/OutputBasket.js.map +1 -0
  317. package/out/src/storage/schema/tables/OutputTag.d.ts +10 -0
  318. package/out/src/storage/schema/tables/OutputTag.d.ts.map +1 -0
  319. package/out/src/storage/schema/tables/OutputTag.js +3 -0
  320. package/out/src/storage/schema/tables/OutputTag.js.map +1 -0
  321. package/out/src/storage/schema/tables/OutputTagMap.d.ts +9 -0
  322. package/out/src/storage/schema/tables/OutputTagMap.d.ts.map +1 -0
  323. package/out/src/storage/schema/tables/OutputTagMap.js +3 -0
  324. package/out/src/storage/schema/tables/OutputTagMap.js.map +1 -0
  325. package/out/src/storage/schema/tables/ProvenTx.d.ts +14 -0
  326. package/out/src/storage/schema/tables/ProvenTx.d.ts.map +1 -0
  327. package/out/src/storage/schema/tables/ProvenTx.js +3 -0
  328. package/out/src/storage/schema/tables/ProvenTx.js.map +1 -0
  329. package/out/src/storage/schema/tables/ProvenTxReq.d.ts +64 -0
  330. package/out/src/storage/schema/tables/ProvenTxReq.d.ts.map +1 -0
  331. package/out/src/storage/schema/tables/ProvenTxReq.js +3 -0
  332. package/out/src/storage/schema/tables/ProvenTxReq.js.map +1 -0
  333. package/out/src/storage/schema/tables/Settings.d.ts +17 -0
  334. package/out/src/storage/schema/tables/Settings.d.ts.map +1 -0
  335. package/out/src/storage/schema/tables/Settings.js +3 -0
  336. package/out/src/storage/schema/tables/Settings.js.map +1 -0
  337. package/out/src/storage/schema/tables/SyncState.d.ts +18 -0
  338. package/out/src/storage/schema/tables/SyncState.d.ts.map +1 -0
  339. package/out/src/storage/schema/tables/SyncState.js +3 -0
  340. package/out/src/storage/schema/tables/SyncState.js.map +1 -0
  341. package/out/src/storage/schema/tables/Transaction.d.ts +37 -0
  342. package/out/src/storage/schema/tables/Transaction.d.ts.map +1 -0
  343. package/out/src/storage/schema/tables/Transaction.js +21 -0
  344. package/out/src/storage/schema/tables/Transaction.js.map +1 -0
  345. package/out/src/storage/schema/tables/TxLabel.d.ts +10 -0
  346. package/out/src/storage/schema/tables/TxLabel.d.ts.map +1 -0
  347. package/out/src/storage/schema/tables/TxLabel.js +3 -0
  348. package/out/src/storage/schema/tables/TxLabel.js.map +1 -0
  349. package/out/src/storage/schema/tables/TxLabelMap.d.ts +9 -0
  350. package/out/src/storage/schema/tables/TxLabelMap.d.ts.map +1 -0
  351. package/out/src/storage/schema/tables/TxLabelMap.js +3 -0
  352. package/out/src/storage/schema/tables/TxLabelMap.js.map +1 -0
  353. package/out/src/storage/schema/tables/User.d.ts +16 -0
  354. package/out/src/storage/schema/tables/User.d.ts.map +1 -0
  355. package/out/src/storage/schema/tables/User.js +3 -0
  356. package/out/src/storage/schema/tables/User.js.map +1 -0
  357. package/out/src/storage/schema/tables/index.d.ts +17 -0
  358. package/out/src/storage/schema/tables/index.d.ts.map +1 -0
  359. package/out/src/storage/schema/tables/index.js +33 -0
  360. package/out/src/storage/schema/tables/index.js.map +1 -0
  361. package/out/src/utility/ScriptTemplateSABPPP.d.ts +25 -0
  362. package/out/src/utility/ScriptTemplateSABPPP.d.ts.map +1 -0
  363. package/out/src/utility/ScriptTemplateSABPPP.js +46 -0
  364. package/out/src/utility/ScriptTemplateSABPPP.js.map +1 -0
  365. package/out/src/utility/index.client.d.ts +7 -0
  366. package/out/src/utility/index.client.d.ts.map +1 -0
  367. package/out/src/utility/index.client.js +23 -0
  368. package/out/src/utility/index.client.js.map +1 -0
  369. package/out/src/utility/parseTxScriptOffsets.d.ts +14 -0
  370. package/out/src/utility/parseTxScriptOffsets.d.ts.map +1 -0
  371. package/out/src/utility/parseTxScriptOffsets.js +26 -0
  372. package/out/src/utility/parseTxScriptOffsets.js.map +1 -0
  373. package/out/src/utility/stampLog.d.ts +18 -0
  374. package/out/src/utility/stampLog.d.ts.map +1 -0
  375. package/out/src/utility/stampLog.js +72 -0
  376. package/out/src/utility/stampLog.js.map +1 -0
  377. package/out/src/utility/tscProofToMerklePath.d.ts +8 -0
  378. package/out/src/utility/tscProofToMerklePath.d.ts.map +1 -0
  379. package/out/src/utility/tscProofToMerklePath.js +41 -0
  380. package/out/src/utility/tscProofToMerklePath.js.map +1 -0
  381. package/out/src/utility/utilityHelpers.d.ts +129 -0
  382. package/out/src/utility/utilityHelpers.d.ts.map +1 -0
  383. package/out/src/utility/utilityHelpers.js +268 -0
  384. package/out/src/utility/utilityHelpers.js.map +1 -0
  385. package/out/src/utility/utilityHelpers.noBuffer.d.ts +9 -0
  386. package/out/src/utility/utilityHelpers.noBuffer.d.ts.map +1 -0
  387. package/out/src/utility/utilityHelpers.noBuffer.js +23 -0
  388. package/out/src/utility/utilityHelpers.noBuffer.js.map +1 -0
  389. package/out/tsconfig.client.tsbuildinfo +1 -0
  390. package/package.json +27 -0
@@ -0,0 +1,271 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.processAction = processAction;
4
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
5
+ const sdk_1 = require("@bsv/sdk");
6
+ const index_client_1 = require("../../index.client");
7
+ async function processAction(storage, auth, args) {
8
+ (0, index_client_1.stampLog)(args.log, `start storage processActionSdk`);
9
+ const userId = (0, index_client_1.verifyId)(auth.userId);
10
+ const r = {
11
+ sendWithResults: undefined
12
+ };
13
+ let req;
14
+ const txidsOfReqsToShareWithWorld = [...args.sendWith];
15
+ if (args.isNewTx) {
16
+ const vargs = await validateCommitNewTxToStorageArgs(storage, userId, args);
17
+ ({ req, log: args.log } = await commitNewTxToStorage(storage, userId, vargs));
18
+ if (!req)
19
+ throw new index_client_1.sdk.WERR_INTERNAL();
20
+ // Add the new txid to sendWith unless there are no others to send and the noSend option is set.
21
+ if (args.isNoSend && !args.isSendWith)
22
+ (0, index_client_1.stampLog)(args.log, `... storage processActionSdk newTx committed noSend`);
23
+ else {
24
+ txidsOfReqsToShareWithWorld.push(req.txid);
25
+ (0, index_client_1.stampLog)(args.log, `... storage processActionSdk newTx committed sendWith ${req.txid}`);
26
+ }
27
+ }
28
+ const swr = await shareReqsWithWorld(storage, userId, txidsOfReqsToShareWithWorld, args.isDelayed);
29
+ if (args.isSendWith) {
30
+ r.sendWithResults = swr;
31
+ }
32
+ (0, index_client_1.stampLog)(args.log, `end storage processActionSdk`);
33
+ return r;
34
+ }
35
+ /**
36
+ * Verifies that all the txids are known reqs with ready-to-share status.
37
+ * Assigns a batch identifier and updates all the provenTxReqs.
38
+ * If not isDelayed, triggers an initial attempt to broadcast the batch and returns the results.
39
+ *
40
+ * @param storage
41
+ * @param userId
42
+ * @param txids
43
+ * @param isDelayed
44
+ */
45
+ async function shareReqsWithWorld(storage, userId, txids, isDelayed) {
46
+ if (txids.length < 1)
47
+ return [];
48
+ // Collect what we know about these sendWith transaction txids from storage.
49
+ const r = await storage.getReqsAndBeefToShareWithWorld(txids, []);
50
+ // Initialize aggregate results for each txid
51
+ const ars = [];
52
+ for (const getReq of r.details)
53
+ ars.push({ txid: getReq.txid, getReq });
54
+ // Filter original txids down to reqIds that are available and need sending
55
+ const readyToSendReqs = r.details
56
+ .filter(d => d.status === 'readyToSend')
57
+ .map(d => new index_client_1.entity.ProvenTxReq(d.req));
58
+ const readyToSendReqIds = readyToSendReqs.map(r => r.id);
59
+ const transactionIds = readyToSendReqs
60
+ .map(r => r.notify.transactionIds || [])
61
+ .flat();
62
+ // If there are reqs to send, verify that we have a valid aggregate beef for them.
63
+ // If isDelayed, this (or a different beef) will have to be rebuilt at the time of sending.
64
+ if (readyToSendReqs.length > 0) {
65
+ const beefIsValid = await r.beef.verify(await storage.getServices().getChainTracker());
66
+ if (!beefIsValid)
67
+ throw new index_client_1.sdk.WERR_INTERNAL(`merged Beef failed validation.`);
68
+ }
69
+ // Set req batch property for the reqs being sent
70
+ // If delayed, also bump status to 'unsent' and we're done here
71
+ const batch = txids.length > 1 ? (0, index_client_1.randomBytesBase64)(16) : undefined;
72
+ if (isDelayed) {
73
+ // Just bump the req status to 'unsent' to enable background sending...
74
+ if (readyToSendReqIds.length > 0) {
75
+ await storage.transaction(async (trx) => {
76
+ await storage.updateProvenTxReq(readyToSendReqIds, { status: 'unsent', batch }, trx);
77
+ await storage.updateTransaction(transactionIds, { status: 'sending' }, trx);
78
+ });
79
+ }
80
+ return createSendWithResults();
81
+ }
82
+ if (readyToSendReqIds.length < 1) {
83
+ return createSendWithResults();
84
+ }
85
+ if (batch) {
86
+ // Keep batch values in sync...
87
+ for (const req of readyToSendReqs)
88
+ req.batch = batch;
89
+ await storage.updateProvenTxReq(readyToSendReqIds, { batch });
90
+ }
91
+ //
92
+ // Handle the NON-DELAYED-SEND-NOW case
93
+ //
94
+ const prtn = await storage.attemptToPostReqsToNetwork(readyToSendReqs);
95
+ // merge the individual PostBeefResultForTxid results to postBeef in aggregate results.
96
+ for (const ar of ars) {
97
+ const d = prtn.details.find(d => d.txid === ar.txid);
98
+ if (d) {
99
+ ar.postBeef = d.pbrft;
100
+ }
101
+ }
102
+ const rs = createSendWithResults();
103
+ return rs;
104
+ function createSendWithResults() {
105
+ var _a;
106
+ const rs = [];
107
+ for (const ar of ars) {
108
+ let status = 'failed';
109
+ if (ar.getReq.status === 'alreadySent')
110
+ status = 'unproven';
111
+ else if (ar.getReq.status === 'readyToSend' &&
112
+ (isDelayed || ((_a = ar.postBeef) === null || _a === void 0 ? void 0 : _a.status) === 'success'))
113
+ status = 'sending';
114
+ rs.push({
115
+ txid: ar.txid,
116
+ status
117
+ });
118
+ }
119
+ return rs;
120
+ }
121
+ }
122
+ async function validateCommitNewTxToStorageArgs(storage, userId, params) {
123
+ if (!params.reference || !params.txid || !params.rawTx)
124
+ throw new index_client_1.sdk.WERR_INVALID_OPERATION('One or more expected params are undefined.');
125
+ let tx;
126
+ try {
127
+ tx = sdk_1.Transaction.fromBinary(params.rawTx);
128
+ }
129
+ catch (e) {
130
+ throw new index_client_1.sdk.WERR_INVALID_OPERATION('Parsing serialized transaction failed.');
131
+ }
132
+ if (params.txid !== tx.id('hex'))
133
+ throw new index_client_1.sdk.WERR_INVALID_OPERATION(`Hash of serialized transaction doesn't match expected txid`);
134
+ if (!(await storage.getServices()).nLockTimeIsFinal(tx)) {
135
+ throw new index_client_1.sdk.WERR_INVALID_OPERATION(`This transaction is not final.
136
+ Ensure that the transaction meets the rules for being a finalized
137
+ which can be found at https://wiki.bitcoinsv.io/index.php/NLocktime_and_nSequence`);
138
+ }
139
+ const txScriptOffsets = (0, index_client_1.parseTxScriptOffsets)(params.rawTx);
140
+ const transaction = (0, index_client_1.verifyOne)(await storage.findTransactions({
141
+ partial: { userId, reference: params.reference }
142
+ }));
143
+ if (!transaction.isOutgoing)
144
+ throw new index_client_1.sdk.WERR_INVALID_OPERATION('isOutgoing is not true');
145
+ if (!transaction.inputBEEF)
146
+ throw new index_client_1.sdk.WERR_INVALID_OPERATION();
147
+ const beef = sdk_1.Beef.fromBinary((0, index_client_1.asArray)(transaction.inputBEEF));
148
+ // TODO: Could check beef validates transaction inputs...
149
+ // Transaction must have unsigned or unprocessed status
150
+ if (transaction.status !== 'unsigned' && transaction.status !== 'unprocessed')
151
+ throw new index_client_1.sdk.WERR_INVALID_OPERATION(`invalid transaction status ${transaction.status}`);
152
+ const transactionId = (0, index_client_1.verifyId)(transaction.transactionId);
153
+ const outputOutputs = await storage.findOutputs({
154
+ partial: { userId, transactionId }
155
+ });
156
+ const inputOutputs = await storage.findOutputs({
157
+ partial: { userId, spentBy: transactionId }
158
+ });
159
+ const commission = (0, index_client_1.verifyOneOrNone)(await storage.findCommissions({ partial: { transactionId, userId } }));
160
+ if (storage.commissionSatoshis > 0) {
161
+ // A commission is required...
162
+ if (!commission)
163
+ throw new index_client_1.sdk.WERR_INTERNAL();
164
+ const commissionValid = tx.outputs.some(x => x.satoshis === commission.satoshis &&
165
+ x.lockingScript.toHex() === (0, index_client_1.asString)(commission.lockingScript));
166
+ if (!commissionValid)
167
+ throw new index_client_1.sdk.WERR_INVALID_OPERATION('Transaction did not include an output to cover service fee.');
168
+ }
169
+ const req = index_client_1.entity.ProvenTxReq.fromTxid(params.txid, params.rawTx, transaction.inputBEEF);
170
+ req.addNotifyTransactionId(transactionId);
171
+ // "Processing" a transaction is the final step of creating a new one.
172
+ // If it is to be sent to the network directly (prior to return from processAction),
173
+ // then there is status pre-send and post-send.
174
+ // Otherwise there is no post-send status.
175
+ // Note that isSendWith trumps isNoSend, e.g. isNoSend && !isSendWith
176
+ //
177
+ // Determine what status the req and transaction should have pre- at the end of processing.
178
+ // Pre-Status (to newReq/newTx) Post-Status (to all sent reqs/txs)
179
+ // req tx req tx
180
+ // isNoSend noSend noSend
181
+ // !isNoSend && isDelayed unsent unprocessed
182
+ // !isNoSend && !isDelayed unprocessed unprocessed sending/unmined sending/unproven This is the only case that sends immediately.
183
+ let postStatus = undefined;
184
+ let status;
185
+ if (params.isNoSend && !params.isSendWith)
186
+ status = { req: 'nosend', tx: 'nosend' };
187
+ else if (!params.isNoSend && params.isDelayed)
188
+ status = { req: 'unsent', tx: 'unprocessed' };
189
+ else if (!params.isNoSend && !params.isDelayed) {
190
+ status = { req: 'unprocessed', tx: 'unprocessed' };
191
+ postStatus = { req: 'unmined', tx: 'unproven' };
192
+ }
193
+ else
194
+ throw new index_client_1.sdk.WERR_INTERNAL('logic error');
195
+ req.status = status.req;
196
+ const vargs = {
197
+ reference: params.reference,
198
+ txid: params.txid,
199
+ rawTx: params.rawTx,
200
+ isSendWith: !!params.sendWith && params.sendWith.length > 0,
201
+ isDelayed: params.isDelayed,
202
+ isNoSend: params.isNoSend,
203
+ // Properties with values added during validation.
204
+ tx,
205
+ txScriptOffsets,
206
+ transactionId,
207
+ transaction,
208
+ inputOutputs,
209
+ outputOutputs,
210
+ commission,
211
+ beef,
212
+ req,
213
+ outputUpdates: [],
214
+ // update txid, status in transactions table and drop rawTransaction value
215
+ transactionUpdate: {
216
+ txid: params.txid,
217
+ rawTx: undefined,
218
+ inputBEEF: undefined,
219
+ status: status.tx
220
+ },
221
+ postStatus
222
+ };
223
+ // update outputs with txid, script offsets and lengths, drop long output scripts from outputs table
224
+ // outputs spendable will be updated for change to true and all others to !!o.tracked when tx has been broadcast
225
+ // MAX_OUTPUTSCRIPT_LENGTH is limit for scripts left in outputs table
226
+ for (const o of vargs.outputOutputs) {
227
+ const vout = (0, index_client_1.verifyTruthy)(o.vout);
228
+ const offset = vargs.txScriptOffsets.outputs[vout];
229
+ const rawTxScript = (0, index_client_1.asString)(vargs.rawTx.slice(offset.offset, offset.offset + offset.length));
230
+ if (o.lockingScript && rawTxScript !== (0, index_client_1.asString)(o.lockingScript))
231
+ throw new index_client_1.sdk.WERR_INVALID_OPERATION(`rawTx output locking script for vout ${vout} not equal to expected output script.`);
232
+ if (tx.outputs[vout].lockingScript.toHex() !== rawTxScript)
233
+ throw new index_client_1.sdk.WERR_INVALID_OPERATION(`parsed transaction output locking script for vout ${vout} not equal to expected output script.`);
234
+ const update = {
235
+ txid: vargs.txid,
236
+ spendable: true, // spendability is gated by transaction status. Remains true until the output is spent.
237
+ scriptLength: offset.length,
238
+ scriptOffset: offset.offset
239
+ };
240
+ if (offset.length > (await storage.getSettings()).maxOutputScript)
241
+ // Remove long lockingScript data from outputs table, will be read from rawTx in proven_tx or proven_tx_reqs tables.
242
+ update.lockingScript = undefined;
243
+ vargs.outputUpdates.push({ id: o.outputId, update });
244
+ }
245
+ return vargs;
246
+ }
247
+ async function commitNewTxToStorage(storage, userId, vargs) {
248
+ let log = vargs.log;
249
+ log = (0, index_client_1.stampLog)(log, `start storage commitNewTxToStorage`);
250
+ let req;
251
+ await storage.transaction(async (trx) => {
252
+ log = (0, index_client_1.stampLog)(log, `... storage commitNewTxToStorage storage transaction start`);
253
+ // Create initial 'nosend' proven_tx_req record to store signed, valid rawTx and input beef
254
+ req = await vargs.req.insertOrMerge(storage, trx);
255
+ log = (0, index_client_1.stampLog)(log, `... storage commitNewTxToStorage req inserted`);
256
+ for (const ou of vargs.outputUpdates) {
257
+ await storage.updateOutput(ou.id, ou.update, trx);
258
+ }
259
+ log = (0, index_client_1.stampLog)(log, `... storage commitNewTxToStorage outputs updated`);
260
+ await storage.updateTransaction(vargs.transactionId, vargs.transactionUpdate, trx);
261
+ log = (0, index_client_1.stampLog)(log, `... storage commitNewTxToStorage storage transaction end`);
262
+ });
263
+ log = (0, index_client_1.stampLog)(log, `... storage commitNewTxToStorage storage transaction await done`);
264
+ const r = {
265
+ req: (0, index_client_1.verifyTruthy)(req),
266
+ log
267
+ };
268
+ log = (0, index_client_1.stampLog)(log, `end storage commitNewTxToStorage`);
269
+ return r;
270
+ }
271
+ //# sourceMappingURL=processAction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"processAction.js","sourceRoot":"","sources":["../../../../../src/storage/methods/processAction.ts"],"names":[],"mappings":";;AA4BA,sCAiDC;AA7ED,6DAA6D;AAC7D,kCAKiB;AACjB,qDAmB2B;AAEpB,KAAK,UAAU,aAAa,CACjC,OAAwB,EACxB,IAAgB,EAChB,IAAkC;IAElC,IAAA,uBAAQ,EAAC,IAAI,CAAC,GAAG,EAAE,gCAAgC,CAAC,CAAA;IAEpD,MAAM,MAAM,GAAG,IAAA,uBAAQ,EAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IACpC,MAAM,CAAC,GAAoC;QACzC,eAAe,EAAE,SAAS;KAC3B,CAAA;IAED,IAAI,GAAmC,CAAA;IACvC,MAAM,2BAA2B,GAAa,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAA;IAEhE,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;QACjB,MAAM,KAAK,GAAG,MAAM,gCAAgC,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,CAC1E;QAAA,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,MAAM,oBAAoB,CACnD,OAAO,EACP,MAAM,EACN,KAAK,CACN,CAAC,CAAA;QACF,IAAI,CAAC,GAAG;YAAE,MAAM,IAAI,kBAAG,CAAC,aAAa,EAAE,CAAA;QACvC,gGAAgG;QAChG,IAAI,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,UAAU;YACnC,IAAA,uBAAQ,EAA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,OAAO,CAAC,YAAY,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;QACnD,CAAC;QAED,GAAG,GAAG,IAAA,uBAAQ,EAAC,GAAG,EAAE,kDAAkD,CAAC,CAAA;QAEvE,MAAM,OAAO,CAAC,iBAAiB,CAC7B,KAAK,CAAC,aAAa,EACnB,KAAK,CAAC,iBAAiB,EACvB,GAAG,CACJ,CAAA;QAED,GAAG,GAAG,IAAA,uBAAQ,EACZ,GAAG,EACH,0DAA0D,CAC3D,CAAA;IACH,CAAC,CAAC,CAAA;IAEF,GAAG,GAAG,IAAA,uBAAQ,EACZ,GAAG,EACH,iEAAiE,CAClE,CAAA;IAED,MAAM,CAAC,GAAuB;QAC5B,GAAG,EAAE,IAAA,2BAAY,EAAC,GAAG,CAAC;QACtB,GAAG;KACJ,CAAA;IAED,GAAG,GAAG,IAAA,uBAAQ,EAAC,GAAG,EAAE,kCAAkC,CAAC,CAAA;IAEvD,OAAO,CAAC,CAAA;AACV,CAAC"}
@@ -0,0 +1,56 @@
1
+ /**
2
+ * StorageClient.ts
3
+ *
4
+ * A client-side "remoted" WalletStorage that fulfills the WalletStorage interface
5
+ * by sending JSON-RPC calls to a configured remote WalletStorageServer.
6
+ */
7
+ import { AbortActionArgs, AbortActionResult, InternalizeActionArgs, InternalizeActionResult, ListActionsResult, ListCertificatesResult, ListOutputsResult, RelinquishCertificateArgs, RelinquishOutputArgs, WalletInterface } from '@bsv/sdk';
8
+ import { sdk, table } from '../../index.client';
9
+ export declare class StorageClient implements sdk.WalletStorageProvider {
10
+ private endpointUrl;
11
+ private nextId;
12
+ private authClient;
13
+ settings?: table.Settings;
14
+ constructor(wallet: WalletInterface, endpointUrl: string);
15
+ isStorageProvider(): boolean;
16
+ /**
17
+ * Make a JSON-RPC call to the remote server.
18
+ * @param method The WalletStorage method name to call.
19
+ * @param params The array of parameters to pass to the method in order.
20
+ */
21
+ private rpcCall;
22
+ isAvailable(): boolean;
23
+ getSettings(): table.Settings;
24
+ makeAvailable(): Promise<table.Settings>;
25
+ destroy(): Promise<void>;
26
+ migrate(storageName: string, storageIdentityKey: string): Promise<string>;
27
+ getServices(): sdk.WalletServices;
28
+ setServices(v: sdk.WalletServices): void;
29
+ internalizeAction(auth: sdk.AuthId, args: InternalizeActionArgs): Promise<InternalizeActionResult>;
30
+ createAction(auth: sdk.AuthId, args: sdk.ValidCreateActionArgs): Promise<sdk.StorageCreateActionResult>;
31
+ processAction(auth: sdk.AuthId, args: sdk.StorageProcessActionArgs): Promise<sdk.StorageProcessActionResults>;
32
+ abortAction(auth: sdk.AuthId, args: AbortActionArgs): Promise<AbortActionResult>;
33
+ findOrInsertUser(identityKey: any): Promise<{
34
+ user: table.User;
35
+ isNew: boolean;
36
+ }>;
37
+ findOrInsertSyncStateAuth(auth: sdk.AuthId, storageIdentityKey: string, storageName: string): Promise<{
38
+ syncState: table.SyncState;
39
+ isNew: boolean;
40
+ }>;
41
+ insertCertificateAuth(auth: sdk.AuthId, certificate: table.CertificateX): Promise<number>;
42
+ listActions(auth: sdk.AuthId, vargs: sdk.ValidListActionsArgs): Promise<ListActionsResult>;
43
+ listOutputs(auth: sdk.AuthId, vargs: sdk.ValidListOutputsArgs): Promise<ListOutputsResult>;
44
+ listCertificates(auth: sdk.AuthId, vargs: sdk.ValidListCertificatesArgs): Promise<ListCertificatesResult>;
45
+ findCertificatesAuth(auth: sdk.AuthId, args: sdk.FindCertificatesArgs): Promise<table.Certificate[]>;
46
+ findOutputBasketsAuth(auth: sdk.AuthId, args: sdk.FindOutputBasketsArgs): Promise<table.OutputBasket[]>;
47
+ findOutputsAuth(auth: sdk.AuthId, args: sdk.FindOutputsArgs): Promise<table.Output[]>;
48
+ findProvenTxReqs(args: sdk.FindProvenTxReqsArgs): Promise<table.ProvenTxReq[]>;
49
+ relinquishCertificate(auth: sdk.AuthId, args: RelinquishCertificateArgs): Promise<number>;
50
+ relinquishOutput(auth: sdk.AuthId, args: RelinquishOutputArgs): Promise<number>;
51
+ processSyncChunk(args: sdk.RequestSyncChunkArgs, chunk: sdk.SyncChunk): Promise<sdk.ProcessSyncChunkResult>;
52
+ getSyncChunk(args: sdk.RequestSyncChunkArgs): Promise<sdk.SyncChunk>;
53
+ updateProvenTxReqWithNewProvenTx(args: sdk.UpdateProvenTxReqWithNewProvenTxArgs): Promise<sdk.UpdateProvenTxReqWithNewProvenTxResult>;
54
+ setActive(auth: sdk.AuthId, newActiveStorageIdentityKey: string): Promise<number>;
55
+ }
56
+ //# sourceMappingURL=StorageClient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StorageClient.d.ts","sourceRoot":"","sources":["../../../../../src/storage/remoting/StorageClient.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,qBAAqB,EACrB,uBAAuB,EACvB,iBAAiB,EACjB,sBAAsB,EACtB,iBAAiB,EACjB,yBAAyB,EACzB,oBAAoB,EACpB,eAAe,EAChB,MAAM,UAAU,CAAA;AACjB,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAG/C,qBAAa,aAAc,YAAW,GAAG,CAAC,qBAAqB;IAC7D,OAAO,CAAC,WAAW,CAAQ;IAC3B,OAAO,CAAC,MAAM,CAAI;IAClB,OAAO,CAAC,UAAU,CAAW;IAGtB,QAAQ,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAA;gBAEpB,MAAM,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM;IAKxD,iBAAiB,IAAI,OAAO;IAQ5B;;;;OAIG;YACW,OAAO;IAwCrB,WAAW,IAAI,OAAO;IAKtB,WAAW,IAAI,KAAK,CAAC,QAAQ;IASvB,aAAa,IAAI,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC;IAexC,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAIxB,OAAO,CACX,WAAW,EAAE,MAAM,EACnB,kBAAkB,EA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C7C,OAAO,CAAC,GAAG,CAAC,sCAAsC,CAAC;IAOhD,SAAS,CACb,IAAI,EAAE,GAAG,CAAC,MAAM,EAChB,2BAA2B,EAAE,MAAM,GAClC,OAAO,CAAC,MAAM,CAAC;CAMnB"}
@@ -0,0 +1,181 @@
1
+ "use strict";
2
+ /**
3
+ * StorageClient.ts
4
+ *
5
+ * A client-side "remoted" WalletStorage that fulfills the WalletStorage interface
6
+ * by sending JSON-RPC calls to a configured remote WalletStorageServer.
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.StorageClient = void 0;
10
+ const index_client_1 = require("../../index.client");
11
+ const sdk_1 = require("@bsv/sdk");
12
+ class StorageClient {
13
+ constructor(wallet, endpointUrl) {
14
+ this.nextId = 1;
15
+ this.authClient = new sdk_1.AuthFetch(wallet);
16
+ this.endpointUrl = endpointUrl;
17
+ }
18
+ isStorageProvider() {
19
+ return false;
20
+ }
21
+ //////////////////////////////////////////////////////////////////////////////
22
+ // JSON-RPC helper
23
+ //////////////////////////////////////////////////////////////////////////////
24
+ /**
25
+ * Make a JSON-RPC call to the remote server.
26
+ * @param method The WalletStorage method name to call.
27
+ * @param params The array of parameters to pass to the method in order.
28
+ */
29
+ async rpcCall(method, params) {
30
+ const id = this.nextId++;
31
+ const body = {
32
+ jsonrpc: '2.0',
33
+ method,
34
+ params,
35
+ id
36
+ };
37
+ const response = await this.authClient.fetch(this.endpointUrl, {
38
+ method: 'POST',
39
+ headers: { 'Content-Type': 'application/json' },
40
+ body: JSON.stringify(body)
41
+ });
42
+ if (!response.ok) {
43
+ throw new Error(`WalletStorageClient rpcCall: network error ${response.status} ${response.statusText}`);
44
+ }
45
+ const json = await response.json();
46
+ if (json.error) {
47
+ const { code, message, data } = json.error;
48
+ const err = new Error(`RPC Error: ${message}`);
49
+ err.code = code;
50
+ err.data = data;
51
+ throw err;
52
+ }
53
+ return json.result;
54
+ }
55
+ //////////////////////////////////////////////////////////////////////////////
56
+ // In a real environment, you might do lazy or real "makeAvailable" logic
57
+ // For demonstration, we assume that the remote store might return its "settings"
58
+ // and we store them locally in `this.settings`.
59
+ //////////////////////////////////////////////////////////////////////////////
60
+ isAvailable() {
61
+ // We'll just say "yes" if we have settings
62
+ return !!this.settings;
63
+ }
64
+ getSettings() {
65
+ if (!this.settings) {
66
+ throw new index_client_1.sdk.WERR_INVALID_OPERATION('call makeAvailable at least once before getSettings');
67
+ }
68
+ return this.settings;
69
+ }
70
+ async makeAvailable() {
71
+ if (!this.settings) {
72
+ this.settings = await this.rpcCall('makeAvailable', []);
73
+ }
74
+ return this.settings;
75
+ }
76
+ //////////////////////////////////////////////////////////////////////////////
77
+ //
78
+ // Implementation of all WalletStorage interface methods
79
+ // They are simple pass-thrus to rpcCall
80
+ //
81
+ // IMPORTANT: The parameter ordering must match exactly as in your interface.
82
+ //////////////////////////////////////////////////////////////////////////////
83
+ async destroy() {
84
+ return this.rpcCall('destroy', []);
85
+ }
86
+ async migrate(storageName, storageIdentityKey) {
87
+ return this.rpcCall('migrate', [storageName]);
88
+ }
89
+ getServices() {
90
+ // Typically, the client would not store or retrieve "Services" from a remote server.
91
+ // The "services" in local in-memory usage is a no-op or your own approach:
92
+ throw new Error('getServices() not implemented in remote client. This method typically is not used remotely.');
93
+ }
94
+ setServices(v) {
95
+ // Typically no-op for remote client
96
+ // Because "services" are usually local definitions to the Storage.
97
+ }
98
+ async internalizeAction(auth, args) {
99
+ return this.rpcCall('internalizeAction', [
100
+ auth,
101
+ args
102
+ ]);
103
+ }
104
+ async createAction(auth, args) {
105
+ return this.rpcCall('createAction', [
106
+ auth,
107
+ args
108
+ ]);
109
+ }
110
+ async processAction(auth, args) {
111
+ return this.rpcCall('processAction', [
112
+ auth,
113
+ args
114
+ ]);
115
+ }
116
+ async abortAction(auth, args) {
117
+ return this.rpcCall('abortAction', [auth, args]);
118
+ }
119
+ async findOrInsertUser(identityKey) {
120
+ return this.rpcCall('findOrInsertUser', [identityKey]);
121
+ }
122
+ async findOrInsertSyncStateAuth(auth, storageIdentityKey, storageName) {
123
+ return this.rpcCall('findOrInsertSyncStateAuth', [auth, storageIdentityKey, storageName]);
124
+ }
125
+ async insertCertificateAuth(auth, certificate) {
126
+ return this.rpcCall('insertCertificateAuth', [auth, certificate]);
127
+ }
128
+ async listActions(auth, vargs) {
129
+ return this.rpcCall('listActions', [auth, vargs]);
130
+ }
131
+ async listOutputs(auth, vargs) {
132
+ return this.rpcCall('listOutputs', [auth, vargs]);
133
+ }
134
+ async listCertificates(auth, vargs) {
135
+ return this.rpcCall('listCertificates', [
136
+ auth,
137
+ vargs
138
+ ]);
139
+ }
140
+ async findCertificatesAuth(auth, args) {
141
+ return this.rpcCall('findCertificatesAuth', [
142
+ auth,
143
+ args
144
+ ]);
145
+ }
146
+ async findOutputBasketsAuth(auth, args) {
147
+ return this.rpcCall('findOutputBaskets', [auth, args]);
148
+ }
149
+ async findOutputsAuth(auth, args) {
150
+ return this.rpcCall('findOutputsAuth', [auth, args]);
151
+ }
152
+ findProvenTxReqs(args) {
153
+ return this.rpcCall('findProvenTxReqs', [args]);
154
+ }
155
+ async relinquishCertificate(auth, args) {
156
+ return this.rpcCall('relinquishCertificate', [auth, args]);
157
+ }
158
+ async relinquishOutput(auth, args) {
159
+ return this.rpcCall('relinquishOutput', [auth, args]);
160
+ }
161
+ async processSyncChunk(args, chunk) {
162
+ return this.rpcCall('processSyncChunk', [
163
+ args,
164
+ chunk
165
+ ]);
166
+ }
167
+ async getSyncChunk(args) {
168
+ return this.rpcCall('getSyncChunk', [args]);
169
+ }
170
+ async updateProvenTxReqWithNewProvenTx(args) {
171
+ return this.rpcCall('updateProvenTxReqWithNewProvenTx', [args]);
172
+ }
173
+ async setActive(auth, newActiveStorageIdentityKey) {
174
+ return this.rpcCall('setActive', [
175
+ auth,
176
+ newActiveStorageIdentityKey
177
+ ]);
178
+ }
179
+ }
180
+ exports.StorageClient = StorageClient;
181
+ //# sourceMappingURL=StorageClient.js.map
@@ -0,0 +1 @@
1
+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S,kBAAkB,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAA;IAC/D,CAAC;IAED,KAAK,CAAC,gBAAgB,CACpB,IAA8B,EAC9B,KAAoB;QAEpB,OAAO,IAAI,CAAC,OAAO,CAA6B,kBAAkB,EAAE;YAClE,IAAI;YACJ,KAAK;SACN,CAAC,CAAA;IACJ,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,IAA8B;QAC/C,OAAO,IAAI,CAAC,OAAO,CAAgB,cAAc,EAAE,CAAC,IAAI,CAAC,CAAC,CAAA;IAC5D,CAAC;IAED,KAAK,CAAC,gCAAgC,CACpC,IAA8C;QAE9C,OAAO,IAAI,CAAC,OAAO,CACjB,kCAAkC,EAClC,CAAC,IAAI,CAAC,CACP,CAAA;IACH,CAAC;IAED,KAAK,CAAC,SAAS,CACb,IAAgB,EAChB,2BAAmC;QAEnC,OAAO,IAAI,CAAC,OAAO,CAAS,WAAW,EAAE;YACvC,IAAI;YACJ,2BAA2B;SAC5B,CAAC,CAAA;IACJ,CAAC;CACF;AA3RD,sCA2RC"}
@@ -0,0 +1,43 @@
1
+ import { entity, sdk, table } from '../../../index.client';
2
+ import { EntityBase } from '.';
3
+ export declare class Certificate extends EntityBase<table.Certificate> {
4
+ constructor(api?: table.Certificate);
5
+ updateApi(): void;
6
+ get certificateId(): number;
7
+ set certificateId(v: number);
8
+ get created_at(): Date;
9
+ set created_at(v: Date);
10
+ get updated_at(): Date;
11
+ set updated_at(v: Date);
12
+ get userId(): number;
13
+ set userId(v: number);
14
+ get type(): string;
15
+ set type(v: string);
16
+ get subject(): string;
17
+ set subject(v: string);
18
+ get verifier(): string | undefined;
19
+ set verifier(v: string | undefined);
20
+ get serialNumber(): string;
21
+ set serialNumber(v: string);
22
+ get certifier(): string;
23
+ set certifier(v: string);
24
+ get revocationOutpoint(): string;
25
+ set revocationOutpoint(v: string);
26
+ get signature(): string;
27
+ set signature(v: string);
28
+ get isDeleted(): boolean;
29
+ set isDeleted(v: boolean);
30
+ get id(): number;
31
+ set id(v: number);
32
+ get entityName(): string;
33
+ get entityTable(): string;
34
+ equals(ei: table.Certificate, syncMap?: entity.SyncMap): boolean;
35
+ static mergeFind(storage: entity.EntityStorage, userId: number, ei: table.Certificate, syncMap: entity.SyncMap, trx?: sdk.TrxToken): Promise<{
36
+ found: boolean;
37
+ eo: entity.Certificate;
38
+ eiId: number;
39
+ }>;
40
+ mergeNew(storage: entity.EntityStorage, userId: number, syncMap: entity.SyncMap, trx?: sdk.TrxToken): Promise<void>;
41
+ mergeExisting(storage: entity.EntityStorage, since: Date | undefined, ei: table.Certificate, syncMap: entity.SyncMap, trx?: sdk.TrxToken): Promise<boolean>;
42
+ }
43
+ //# sourceMappingURL=Certificate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Certificate.d.ts","sourceRoot":"","sources":["../../../../../../src/storage/schema/entities/Certificate.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,MAAM,EACN,GAAG,EACH,KAAK,EAGN,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,UAAU,EAAE,MAAM,GAAG,CAAA;AAE9B,qBAAa,WAAY,SAAQ,UAAU,CAAC,KAAK,CAAC,WAAW,CAAC;gBAChD,GAAG,CAAC,EAAE,KAAK,CAAC,WAAW;IAoB1B,SAAS,IAAI,IAAI;IAI1B,IAAI,aAAa,IAGI,MAAM,CAD1B;IACD,IAAI,aAAa,CAAC,CAAC,EAAE,MAAM,EAE1B;IACD,IAAI,UAAU,IAGI,IAAI,CADrB;IACD,IAAI,UAAU,CAAC,CAAC,EAAE,IAAI,EAErB;IACD,IAAI,UAAU,IAGI,IAAI,CADrB;IACD,IAAI,UAAU,CAAC,CAAC,EAAE,IAAI,EAErB;IACD,IAAI,MAAM,IAGI,MAAM,CADnB;IACD,IAAI,MAAM,CAAC,CAAC,EAAE,MAAM,EAEnB;IACD,IAAI,IAAI,IAGI,MAAM,CADjB;IACD,IAAI,IAAI,CAAC,CAAC,EAAE,M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