@bsv/wallet-toolbox 1.3.21 → 1.3.23

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 (558) hide show
  1. package/mobile/out/src/CWIStyleWalletManager.d.ts +437 -0
  2. package/mobile/out/src/CWIStyleWalletManager.d.ts.map +1 -0
  3. package/mobile/out/src/CWIStyleWalletManager.js +1255 -0
  4. package/mobile/out/src/CWIStyleWalletManager.js.map +1 -0
  5. package/mobile/out/src/SetupClient.d.ts +126 -0
  6. package/mobile/out/src/SetupClient.d.ts.map +1 -0
  7. package/mobile/out/src/SetupClient.js +220 -0
  8. package/mobile/out/src/SetupClient.js.map +1 -0
  9. package/mobile/out/src/SetupWallet.d.ts +100 -0
  10. package/mobile/out/src/SetupWallet.d.ts.map +1 -0
  11. package/mobile/out/src/SetupWallet.js +3 -0
  12. package/mobile/out/src/SetupWallet.js.map +1 -0
  13. package/mobile/out/src/SimpleWalletManager.d.ts +169 -0
  14. package/mobile/out/src/SimpleWalletManager.d.ts.map +1 -0
  15. package/mobile/out/src/SimpleWalletManager.js +315 -0
  16. package/mobile/out/src/SimpleWalletManager.js.map +1 -0
  17. package/mobile/out/src/Wallet.d.ts +177 -0
  18. package/mobile/out/src/Wallet.d.ts.map +1 -0
  19. package/mobile/out/src/Wallet.js +742 -0
  20. package/mobile/out/src/Wallet.js.map +1 -0
  21. package/mobile/out/src/WalletAuthenticationManager.d.ts +33 -0
  22. package/mobile/out/src/WalletAuthenticationManager.d.ts.map +1 -0
  23. package/mobile/out/src/WalletAuthenticationManager.js +113 -0
  24. package/mobile/out/src/WalletAuthenticationManager.js.map +1 -0
  25. package/mobile/out/src/WalletPermissionsManager.d.ts +598 -0
  26. package/mobile/out/src/WalletPermissionsManager.d.ts.map +1 -0
  27. package/mobile/out/src/WalletPermissionsManager.js +1868 -0
  28. package/mobile/out/src/WalletPermissionsManager.js.map +1 -0
  29. package/mobile/out/src/WalletSettingsManager.d.ts +52 -0
  30. package/mobile/out/src/WalletSettingsManager.d.ts.map +1 -0
  31. package/mobile/out/src/WalletSettingsManager.js +82 -0
  32. package/mobile/out/src/WalletSettingsManager.js.map +1 -0
  33. package/mobile/out/src/index.client.d.ts +19 -0
  34. package/mobile/out/src/index.client.d.ts.map +1 -0
  35. package/mobile/out/src/index.client.js +58 -0
  36. package/mobile/out/src/index.client.js.map +1 -0
  37. package/mobile/out/src/index.mobile.d.ts +17 -0
  38. package/mobile/out/src/index.mobile.d.ts.map +1 -0
  39. package/mobile/out/src/index.mobile.js +56 -0
  40. package/mobile/out/src/index.mobile.js.map +1 -0
  41. package/mobile/out/src/monitor/Monitor.d.ts +91 -0
  42. package/mobile/out/src/monitor/Monitor.d.ts.map +1 -0
  43. package/mobile/out/src/monitor/Monitor.js +298 -0
  44. package/mobile/out/src/monitor/Monitor.js.map +1 -0
  45. package/mobile/out/src/monitor/tasks/TaskCheckForProofs.d.ts +53 -0
  46. package/mobile/out/src/monitor/tasks/TaskCheckForProofs.d.ts.map +1 -0
  47. package/mobile/out/src/monitor/tasks/TaskCheckForProofs.js +194 -0
  48. package/mobile/out/src/monitor/tasks/TaskCheckForProofs.js.map +1 -0
  49. package/mobile/out/src/monitor/tasks/TaskCheckNoSends.d.ts +33 -0
  50. package/mobile/out/src/monitor/tasks/TaskCheckNoSends.d.ts.map +1 -0
  51. package/mobile/out/src/monitor/tasks/TaskCheckNoSends.js +65 -0
  52. package/mobile/out/src/monitor/tasks/TaskCheckNoSends.js.map +1 -0
  53. package/mobile/out/src/monitor/tasks/TaskClock.d.ts +14 -0
  54. package/mobile/out/src/monitor/tasks/TaskClock.d.ts.map +1 -0
  55. package/mobile/out/src/monitor/tasks/TaskClock.js +27 -0
  56. package/mobile/out/src/monitor/tasks/TaskClock.js.map +1 -0
  57. package/mobile/out/src/monitor/tasks/TaskFailAbandoned.d.ts +20 -0
  58. package/mobile/out/src/monitor/tasks/TaskFailAbandoned.d.ts.map +1 -0
  59. package/mobile/out/src/monitor/tasks/TaskFailAbandoned.js +52 -0
  60. package/mobile/out/src/monitor/tasks/TaskFailAbandoned.js.map +1 -0
  61. package/mobile/out/src/monitor/tasks/TaskNewHeader.d.ts +15 -0
  62. package/mobile/out/src/monitor/tasks/TaskNewHeader.d.ts.map +1 -0
  63. package/mobile/out/src/monitor/tasks/TaskNewHeader.js +43 -0
  64. package/mobile/out/src/monitor/tasks/TaskNewHeader.js.map +1 -0
  65. package/mobile/out/src/monitor/tasks/TaskPurge.d.ts +45 -0
  66. package/mobile/out/src/monitor/tasks/TaskPurge.d.ts.map +1 -0
  67. package/mobile/out/src/monitor/tasks/TaskPurge.js +34 -0
  68. package/mobile/out/src/monitor/tasks/TaskPurge.js.map +1 -0
  69. package/mobile/out/src/monitor/tasks/TaskReviewStatus.d.ts +26 -0
  70. package/mobile/out/src/monitor/tasks/TaskReviewStatus.d.ts.map +1 -0
  71. package/mobile/out/src/monitor/tasks/TaskReviewStatus.js +43 -0
  72. package/mobile/out/src/monitor/tasks/TaskReviewStatus.js.map +1 -0
  73. package/mobile/out/src/monitor/tasks/TaskSendWaiting.d.ts +35 -0
  74. package/mobile/out/src/monitor/tasks/TaskSendWaiting.d.ts.map +1 -0
  75. package/mobile/out/src/monitor/tasks/TaskSendWaiting.js +107 -0
  76. package/mobile/out/src/monitor/tasks/TaskSendWaiting.js.map +1 -0
  77. package/mobile/out/src/monitor/tasks/TaskSyncWhenIdle.d.ts +12 -0
  78. package/mobile/out/src/monitor/tasks/TaskSyncWhenIdle.d.ts.map +1 -0
  79. package/mobile/out/src/monitor/tasks/TaskSyncWhenIdle.js +22 -0
  80. package/mobile/out/src/monitor/tasks/TaskSyncWhenIdle.js.map +1 -0
  81. package/mobile/out/src/monitor/tasks/TaskUnFail.d.ts +41 -0
  82. package/mobile/out/src/monitor/tasks/TaskUnFail.d.ts.map +1 -0
  83. package/mobile/out/src/monitor/tasks/TaskUnFail.js +144 -0
  84. package/mobile/out/src/monitor/tasks/TaskUnFail.js.map +1 -0
  85. package/mobile/out/src/monitor/tasks/WalletMonitorTask.d.ts +40 -0
  86. package/mobile/out/src/monitor/tasks/WalletMonitorTask.d.ts.map +1 -0
  87. package/mobile/out/src/monitor/tasks/WalletMonitorTask.js +37 -0
  88. package/mobile/out/src/monitor/tasks/WalletMonitorTask.js.map +1 -0
  89. package/mobile/out/src/sdk/CertOpsWallet.d.ts +7 -0
  90. package/mobile/out/src/sdk/CertOpsWallet.d.ts.map +1 -0
  91. package/mobile/out/src/sdk/CertOpsWallet.js +3 -0
  92. package/mobile/out/src/sdk/CertOpsWallet.js.map +1 -0
  93. package/mobile/out/src/sdk/PrivilegedKeyManager.d.ts +125 -0
  94. package/mobile/out/src/sdk/PrivilegedKeyManager.d.ts.map +1 -0
  95. package/mobile/out/src/sdk/PrivilegedKeyManager.js +293 -0
  96. package/mobile/out/src/sdk/PrivilegedKeyManager.js.map +1 -0
  97. package/mobile/out/src/sdk/WERR_errors.d.ts +115 -0
  98. package/mobile/out/src/sdk/WERR_errors.d.ts.map +1 -0
  99. package/mobile/out/src/sdk/WERR_errors.js +158 -0
  100. package/mobile/out/src/sdk/WERR_errors.js.map +1 -0
  101. package/mobile/out/src/sdk/WalletError.d.ts +44 -0
  102. package/mobile/out/src/sdk/WalletError.d.ts.map +1 -0
  103. package/mobile/out/src/sdk/WalletError.js +118 -0
  104. package/mobile/out/src/sdk/WalletError.js.map +1 -0
  105. package/mobile/out/src/sdk/WalletServices.interfaces.d.ts +430 -0
  106. package/mobile/out/src/sdk/WalletServices.interfaces.d.ts.map +1 -0
  107. package/mobile/out/src/sdk/WalletServices.interfaces.js +3 -0
  108. package/mobile/out/src/sdk/WalletServices.interfaces.js.map +1 -0
  109. package/mobile/out/src/sdk/WalletSigner.interfaces.d.ts +10 -0
  110. package/mobile/out/src/sdk/WalletSigner.interfaces.d.ts.map +1 -0
  111. package/mobile/out/src/sdk/WalletSigner.interfaces.js +3 -0
  112. package/mobile/out/src/sdk/WalletSigner.interfaces.js.map +1 -0
  113. package/mobile/out/src/sdk/WalletStorage.interfaces.d.ts +452 -0
  114. package/mobile/out/src/sdk/WalletStorage.interfaces.d.ts.map +1 -0
  115. package/mobile/out/src/sdk/WalletStorage.interfaces.js +3 -0
  116. package/mobile/out/src/sdk/WalletStorage.interfaces.js.map +1 -0
  117. package/mobile/out/src/sdk/index.d.ts +10 -0
  118. package/mobile/out/src/sdk/index.d.ts.map +1 -0
  119. package/mobile/out/src/sdk/index.js +26 -0
  120. package/mobile/out/src/sdk/index.js.map +1 -0
  121. package/mobile/out/src/sdk/types.d.ts +158 -0
  122. package/mobile/out/src/sdk/types.d.ts.map +1 -0
  123. package/mobile/out/src/sdk/types.js +90 -0
  124. package/mobile/out/src/sdk/types.js.map +1 -0
  125. package/mobile/out/src/sdk/validationHelpers.d.ts +301 -0
  126. package/mobile/out/src/sdk/validationHelpers.d.ts.map +1 -0
  127. package/mobile/out/src/sdk/validationHelpers.js +629 -0
  128. package/mobile/out/src/sdk/validationHelpers.js.map +1 -0
  129. package/mobile/out/src/services/ServiceCollection.d.ts +25 -0
  130. package/mobile/out/src/services/ServiceCollection.d.ts.map +1 -0
  131. package/mobile/out/src/services/ServiceCollection.js +43 -0
  132. package/mobile/out/src/services/ServiceCollection.js.map +1 -0
  133. package/mobile/out/src/services/Services.d.ts +67 -0
  134. package/mobile/out/src/services/Services.d.ts.map +1 -0
  135. package/mobile/out/src/services/Services.js +391 -0
  136. package/mobile/out/src/services/Services.js.map +1 -0
  137. package/mobile/out/src/services/chaintracker/ChaintracksChainTracker.d.ts +15 -0
  138. package/mobile/out/src/services/chaintracker/ChaintracksChainTracker.d.ts.map +1 -0
  139. package/mobile/out/src/services/chaintracker/ChaintracksChainTracker.js +51 -0
  140. package/mobile/out/src/services/chaintracker/ChaintracksChainTracker.js.map +1 -0
  141. package/mobile/out/src/services/chaintracker/chaintracks/BlockHeaderApi.d.ts +98 -0
  142. package/mobile/out/src/services/chaintracker/chaintracks/BlockHeaderApi.d.ts.map +1 -0
  143. package/mobile/out/src/services/chaintracker/chaintracks/BlockHeaderApi.js +38 -0
  144. package/mobile/out/src/services/chaintracker/chaintracks/BlockHeaderApi.js.map +1 -0
  145. package/mobile/out/src/services/chaintracker/chaintracks/ChaintracksServiceClient.d.ts +36 -0
  146. package/mobile/out/src/services/chaintracker/chaintracks/ChaintracksServiceClient.d.ts.map +1 -0
  147. package/mobile/out/src/services/chaintracker/chaintracks/ChaintracksServiceClient.js +128 -0
  148. package/mobile/out/src/services/chaintracker/chaintracks/ChaintracksServiceClient.js.map +1 -0
  149. package/mobile/out/src/services/chaintracker/chaintracks/index.d.ts +3 -0
  150. package/mobile/out/src/services/chaintracker/chaintracks/index.d.ts.map +1 -0
  151. package/mobile/out/src/services/chaintracker/chaintracks/index.js +19 -0
  152. package/mobile/out/src/services/chaintracker/chaintracks/index.js.map +1 -0
  153. package/mobile/out/src/services/chaintracker/index.d.ts +3 -0
  154. package/mobile/out/src/services/chaintracker/index.d.ts.map +1 -0
  155. package/mobile/out/src/services/chaintracker/index.js +19 -0
  156. package/mobile/out/src/services/chaintracker/index.js.map +1 -0
  157. package/mobile/out/src/services/createDefaultWalletServicesOptions.d.ts +4 -0
  158. package/mobile/out/src/services/createDefaultWalletServicesOptions.d.ts.map +1 -0
  159. package/mobile/out/src/services/createDefaultWalletServicesOptions.js +46 -0
  160. package/mobile/out/src/services/createDefaultWalletServicesOptions.js.map +1 -0
  161. package/mobile/out/src/services/index.d.ts +2 -0
  162. package/mobile/out/src/services/index.d.ts.map +1 -0
  163. package/mobile/out/src/services/index.js +18 -0
  164. package/mobile/out/src/services/index.js.map +1 -0
  165. package/mobile/out/src/services/providers/ARC.d.ts +91 -0
  166. package/mobile/out/src/services/providers/ARC.d.ts.map +1 -0
  167. package/mobile/out/src/services/providers/ARC.js +267 -0
  168. package/mobile/out/src/services/providers/ARC.js.map +1 -0
  169. package/mobile/out/src/services/providers/Bitails.d.ts +49 -0
  170. package/mobile/out/src/services/providers/Bitails.d.ts.map +1 -0
  171. package/mobile/out/src/services/providers/Bitails.js +222 -0
  172. package/mobile/out/src/services/providers/Bitails.js.map +1 -0
  173. package/mobile/out/src/services/providers/SdkWhatsOnChain.d.ts +21 -0
  174. package/mobile/out/src/services/providers/SdkWhatsOnChain.d.ts.map +1 -0
  175. package/mobile/out/src/services/providers/SdkWhatsOnChain.js +67 -0
  176. package/mobile/out/src/services/providers/SdkWhatsOnChain.js.map +1 -0
  177. package/mobile/out/src/services/providers/WhatsOnChain.d.ts +71 -0
  178. package/mobile/out/src/services/providers/WhatsOnChain.d.ts.map +1 -0
  179. package/mobile/out/src/services/providers/WhatsOnChain.js +582 -0
  180. package/mobile/out/src/services/providers/WhatsOnChain.js.map +1 -0
  181. package/mobile/out/src/services/providers/echangeRates.d.ts +12 -0
  182. package/mobile/out/src/services/providers/echangeRates.d.ts.map +1 -0
  183. package/mobile/out/src/services/providers/echangeRates.js +237 -0
  184. package/mobile/out/src/services/providers/echangeRates.js.map +1 -0
  185. package/mobile/out/src/services/providers/getBeefForTxid.d.ts +4 -0
  186. package/mobile/out/src/services/providers/getBeefForTxid.d.ts.map +1 -0
  187. package/mobile/out/src/services/providers/getBeefForTxid.js +286 -0
  188. package/mobile/out/src/services/providers/getBeefForTxid.js.map +1 -0
  189. package/mobile/out/src/signer/WalletSigner.d.ts +11 -0
  190. package/mobile/out/src/signer/WalletSigner.d.ts.map +1 -0
  191. package/mobile/out/src/signer/WalletSigner.js +13 -0
  192. package/mobile/out/src/signer/WalletSigner.js.map +1 -0
  193. package/mobile/out/src/signer/methods/acquireDirectCertificate.d.ts +4 -0
  194. package/mobile/out/src/signer/methods/acquireDirectCertificate.d.ts.map +1 -0
  195. package/mobile/out/src/signer/methods/acquireDirectCertificate.js +45 -0
  196. package/mobile/out/src/signer/methods/acquireDirectCertificate.js.map +1 -0
  197. package/mobile/out/src/signer/methods/buildSignableTransaction.d.ts +10 -0
  198. package/mobile/out/src/signer/methods/buildSignableTransaction.d.ts.map +1 -0
  199. package/mobile/out/src/signer/methods/buildSignableTransaction.js +126 -0
  200. package/mobile/out/src/signer/methods/buildSignableTransaction.js.map +1 -0
  201. package/mobile/out/src/signer/methods/createAction.d.ts +20 -0
  202. package/mobile/out/src/signer/methods/createAction.d.ts.map +1 -0
  203. package/mobile/out/src/signer/methods/createAction.js +160 -0
  204. package/mobile/out/src/signer/methods/createAction.js.map +1 -0
  205. package/mobile/out/src/signer/methods/internalizeAction.d.ts +31 -0
  206. package/mobile/out/src/signer/methods/internalizeAction.d.ts.map +1 -0
  207. package/mobile/out/src/signer/methods/internalizeAction.js +95 -0
  208. package/mobile/out/src/signer/methods/internalizeAction.js.map +1 -0
  209. package/mobile/out/src/signer/methods/proveCertificate.d.ts +4 -0
  210. package/mobile/out/src/signer/methods/proveCertificate.d.ts.map +1 -0
  211. package/mobile/out/src/signer/methods/proveCertificate.js +29 -0
  212. package/mobile/out/src/signer/methods/proveCertificate.js.map +1 -0
  213. package/mobile/out/src/signer/methods/signAction.d.ts +13 -0
  214. package/mobile/out/src/signer/methods/signAction.d.ts.map +1 -0
  215. package/mobile/out/src/signer/methods/signAction.js +89 -0
  216. package/mobile/out/src/signer/methods/signAction.js.map +1 -0
  217. package/mobile/out/src/storage/StorageIdb.d.ts +209 -0
  218. package/mobile/out/src/storage/StorageIdb.d.ts.map +1 -0
  219. package/mobile/out/src/storage/StorageIdb.js +2330 -0
  220. package/mobile/out/src/storage/StorageIdb.js.map +1 -0
  221. package/mobile/out/src/storage/StorageProvider.d.ts +210 -0
  222. package/mobile/out/src/storage/StorageProvider.d.ts.map +1 -0
  223. package/mobile/out/src/storage/StorageProvider.js +585 -0
  224. package/mobile/out/src/storage/StorageProvider.js.map +1 -0
  225. package/mobile/out/src/storage/StorageReader.d.ts +77 -0
  226. package/mobile/out/src/storage/StorageReader.d.ts.map +1 -0
  227. package/mobile/out/src/storage/StorageReader.js +163 -0
  228. package/mobile/out/src/storage/StorageReader.js.map +1 -0
  229. package/mobile/out/src/storage/StorageReaderWriter.d.ts +88 -0
  230. package/mobile/out/src/storage/StorageReaderWriter.d.ts.map +1 -0
  231. package/mobile/out/src/storage/StorageReaderWriter.js +338 -0
  232. package/mobile/out/src/storage/StorageReaderWriter.js.map +1 -0
  233. package/mobile/out/src/storage/StorageSyncReader.d.ts +18 -0
  234. package/mobile/out/src/storage/StorageSyncReader.d.ts.map +1 -0
  235. package/mobile/out/src/storage/StorageSyncReader.js +71 -0
  236. package/mobile/out/src/storage/StorageSyncReader.js.map +1 -0
  237. package/mobile/out/src/storage/WalletStorageManager.d.ts +184 -0
  238. package/mobile/out/src/storage/WalletStorageManager.d.ts.map +1 -0
  239. package/mobile/out/src/storage/WalletStorageManager.js +665 -0
  240. package/mobile/out/src/storage/WalletStorageManager.js.map +1 -0
  241. package/mobile/out/src/storage/index.client.d.ts +8 -0
  242. package/mobile/out/src/storage/index.client.d.ts.map +1 -0
  243. package/mobile/out/src/storage/index.client.js +24 -0
  244. package/mobile/out/src/storage/index.client.js.map +1 -0
  245. package/mobile/out/src/storage/index.mobile.d.ts +7 -0
  246. package/mobile/out/src/storage/index.mobile.d.ts.map +1 -0
  247. package/mobile/out/src/storage/index.mobile.js +23 -0
  248. package/mobile/out/src/storage/index.mobile.js.map +1 -0
  249. package/mobile/out/src/storage/methods/ListActionsSpecOp.d.ts +16 -0
  250. package/mobile/out/src/storage/methods/ListActionsSpecOp.d.ts.map +1 -0
  251. package/mobile/out/src/storage/methods/ListActionsSpecOp.js +40 -0
  252. package/mobile/out/src/storage/methods/ListActionsSpecOp.js.map +1 -0
  253. package/mobile/out/src/storage/methods/ListOutputsSpecOp.d.ts +26 -0
  254. package/mobile/out/src/storage/methods/ListOutputsSpecOp.d.ts.map +1 -0
  255. package/mobile/out/src/storage/methods/ListOutputsSpecOp.js +71 -0
  256. package/mobile/out/src/storage/methods/ListOutputsSpecOp.js.map +1 -0
  257. package/mobile/out/src/storage/methods/attemptToPostReqsToNetwork.d.ts +41 -0
  258. package/mobile/out/src/storage/methods/attemptToPostReqsToNetwork.d.ts.map +1 -0
  259. package/mobile/out/src/storage/methods/attemptToPostReqsToNetwork.js +320 -0
  260. package/mobile/out/src/storage/methods/attemptToPostReqsToNetwork.js.map +1 -0
  261. package/mobile/out/src/storage/methods/createAction.d.ts +24 -0
  262. package/mobile/out/src/storage/methods/createAction.d.ts.map +1 -0
  263. package/mobile/out/src/storage/methods/createAction.js +705 -0
  264. package/mobile/out/src/storage/methods/createAction.js.map +1 -0
  265. package/mobile/out/src/storage/methods/generateChange.d.ts +119 -0
  266. package/mobile/out/src/storage/methods/generateChange.d.ts.map +1 -0
  267. package/mobile/out/src/storage/methods/generateChange.js +448 -0
  268. package/mobile/out/src/storage/methods/generateChange.js.map +1 -0
  269. package/mobile/out/src/storage/methods/getBeefForTransaction.d.ts +22 -0
  270. package/mobile/out/src/storage/methods/getBeefForTransaction.d.ts.map +1 -0
  271. package/mobile/out/src/storage/methods/getBeefForTransaction.js +92 -0
  272. package/mobile/out/src/storage/methods/getBeefForTransaction.js.map +1 -0
  273. package/mobile/out/src/storage/methods/getSyncChunk.d.ts +10 -0
  274. package/mobile/out/src/storage/methods/getSyncChunk.d.ts.map +1 -0
  275. package/mobile/out/src/storage/methods/getSyncChunk.js +271 -0
  276. package/mobile/out/src/storage/methods/getSyncChunk.js.map +1 -0
  277. package/mobile/out/src/storage/methods/internalizeAction.d.ts +38 -0
  278. package/mobile/out/src/storage/methods/internalizeAction.d.ts.map +1 -0
  279. package/mobile/out/src/storage/methods/internalizeAction.js +371 -0
  280. package/mobile/out/src/storage/methods/internalizeAction.js.map +1 -0
  281. package/mobile/out/src/storage/methods/listActionsIdb.d.ts +5 -0
  282. package/mobile/out/src/storage/methods/listActionsIdb.d.ts.map +1 -0
  283. package/mobile/out/src/storage/methods/listActionsIdb.js +155 -0
  284. package/mobile/out/src/storage/methods/listActionsIdb.js.map +1 -0
  285. package/mobile/out/src/storage/methods/listCertificates.d.ts +5 -0
  286. package/mobile/out/src/storage/methods/listCertificates.d.ts.map +1 -0
  287. package/mobile/out/src/storage/methods/listCertificates.js +68 -0
  288. package/mobile/out/src/storage/methods/listCertificates.js.map +1 -0
  289. package/mobile/out/src/storage/methods/listOutputsIdb.d.ts +5 -0
  290. package/mobile/out/src/storage/methods/listOutputsIdb.d.ts.map +1 -0
  291. package/mobile/out/src/storage/methods/listOutputsIdb.js +181 -0
  292. package/mobile/out/src/storage/methods/listOutputsIdb.js.map +1 -0
  293. package/mobile/out/src/storage/methods/processAction.d.ts +35 -0
  294. package/mobile/out/src/storage/methods/processAction.d.ts.map +1 -0
  295. package/mobile/out/src/storage/methods/processAction.js +311 -0
  296. package/mobile/out/src/storage/methods/processAction.js.map +1 -0
  297. package/mobile/out/src/storage/methods/purgeDataIdb.d.ts +4 -0
  298. package/mobile/out/src/storage/methods/purgeDataIdb.d.ts.map +1 -0
  299. package/mobile/out/src/storage/methods/purgeDataIdb.js +9 -0
  300. package/mobile/out/src/storage/methods/purgeDataIdb.js.map +1 -0
  301. package/mobile/out/src/storage/methods/reviewStatusIdb.d.ts +20 -0
  302. package/mobile/out/src/storage/methods/reviewStatusIdb.d.ts.map +1 -0
  303. package/mobile/out/src/storage/methods/reviewStatusIdb.js +35 -0
  304. package/mobile/out/src/storage/methods/reviewStatusIdb.js.map +1 -0
  305. package/mobile/out/src/storage/remoting/StorageClient.d.ts +283 -0
  306. package/mobile/out/src/storage/remoting/StorageClient.d.ts.map +1 -0
  307. package/mobile/out/src/storage/remoting/StorageClient.js +477 -0
  308. package/mobile/out/src/storage/remoting/StorageClient.js.map +1 -0
  309. package/mobile/out/src/storage/remoting/StorageMobile.d.ts +283 -0
  310. package/mobile/out/src/storage/remoting/StorageMobile.d.ts.map +1 -0
  311. package/mobile/out/src/storage/remoting/StorageMobile.js +477 -0
  312. package/mobile/out/src/storage/remoting/StorageMobile.js.map +1 -0
  313. package/mobile/out/src/storage/schema/StorageIdbSchema.d.ts +133 -0
  314. package/mobile/out/src/storage/schema/StorageIdbSchema.d.ts.map +1 -0
  315. package/mobile/out/src/storage/schema/StorageIdbSchema.js +3 -0
  316. package/mobile/out/src/storage/schema/StorageIdbSchema.js.map +1 -0
  317. package/mobile/out/src/storage/schema/entities/EntityBase.d.ts +105 -0
  318. package/mobile/out/src/storage/schema/entities/EntityBase.d.ts.map +1 -0
  319. package/mobile/out/src/storage/schema/entities/EntityBase.js +100 -0
  320. package/mobile/out/src/storage/schema/entities/EntityBase.js.map +1 -0
  321. package/mobile/out/src/storage/schema/entities/EntityCertificate.d.ts +43 -0
  322. package/mobile/out/src/storage/schema/entities/EntityCertificate.d.ts.map +1 -0
  323. package/mobile/out/src/storage/schema/entities/EntityCertificate.js +162 -0
  324. package/mobile/out/src/storage/schema/entities/EntityCertificate.js.map +1 -0
  325. package/mobile/out/src/storage/schema/entities/EntityCertificateField.d.ts +32 -0
  326. package/mobile/out/src/storage/schema/entities/EntityCertificateField.d.ts.map +1 -0
  327. package/mobile/out/src/storage/schema/entities/EntityCertificateField.js +111 -0
  328. package/mobile/out/src/storage/schema/entities/EntityCertificateField.js.map +1 -0
  329. package/mobile/out/src/storage/schema/entities/EntityCommission.d.ts +37 -0
  330. package/mobile/out/src/storage/schema/entities/EntityCommission.d.ts.map +1 -0
  331. package/mobile/out/src/storage/schema/entities/EntityCommission.js +127 -0
  332. package/mobile/out/src/storage/schema/entities/EntityCommission.js.map +1 -0
  333. package/mobile/out/src/storage/schema/entities/EntityOutput.d.ts +67 -0
  334. package/mobile/out/src/storage/schema/entities/EntityOutput.d.ts.map +1 -0
  335. package/mobile/out/src/storage/schema/entities/EntityOutput.js +264 -0
  336. package/mobile/out/src/storage/schema/entities/EntityOutput.js.map +1 -0
  337. package/mobile/out/src/storage/schema/entities/EntityOutputBasket.d.ts +35 -0
  338. package/mobile/out/src/storage/schema/entities/EntityOutputBasket.d.ts.map +1 -0
  339. package/mobile/out/src/storage/schema/entities/EntityOutputBasket.js +133 -0
  340. package/mobile/out/src/storage/schema/entities/EntityOutputBasket.js.map +1 -0
  341. package/mobile/out/src/storage/schema/entities/EntityOutputTag.d.ts +31 -0
  342. package/mobile/out/src/storage/schema/entities/EntityOutputTag.d.ts.map +1 -0
  343. package/mobile/out/src/storage/schema/entities/EntityOutputTag.js +104 -0
  344. package/mobile/out/src/storage/schema/entities/EntityOutputTag.js.map +1 -0
  345. package/mobile/out/src/storage/schema/entities/EntityOutputTagMap.d.ts +28 -0
  346. package/mobile/out/src/storage/schema/entities/EntityOutputTagMap.d.ts.map +1 -0
  347. package/mobile/out/src/storage/schema/entities/EntityOutputTagMap.js +97 -0
  348. package/mobile/out/src/storage/schema/entities/EntityOutputTagMap.js.map +1 -0
  349. package/mobile/out/src/storage/schema/entities/EntityProvenTx.d.ts +84 -0
  350. package/mobile/out/src/storage/schema/entities/EntityProvenTx.d.ts.map +1 -0
  351. package/mobile/out/src/storage/schema/entities/EntityProvenTx.js +276 -0
  352. package/mobile/out/src/storage/schema/entities/EntityProvenTx.js.map +1 -0
  353. package/mobile/out/src/storage/schema/entities/EntityProvenTxReq.d.ts +135 -0
  354. package/mobile/out/src/storage/schema/entities/EntityProvenTxReq.d.ts.map +1 -0
  355. package/mobile/out/src/storage/schema/entities/EntityProvenTxReq.js +522 -0
  356. package/mobile/out/src/storage/schema/entities/EntityProvenTxReq.js.map +1 -0
  357. package/mobile/out/src/storage/schema/entities/EntitySyncState.d.ts +67 -0
  358. package/mobile/out/src/storage/schema/entities/EntitySyncState.d.ts.map +1 -0
  359. package/mobile/out/src/storage/schema/entities/EntitySyncState.js +319 -0
  360. package/mobile/out/src/storage/schema/entities/EntitySyncState.js.map +1 -0
  361. package/mobile/out/src/storage/schema/entities/EntityTransaction.d.ts +67 -0
  362. package/mobile/out/src/storage/schema/entities/EntityTransaction.d.ts.map +1 -0
  363. package/mobile/out/src/storage/schema/entities/EntityTransaction.js +255 -0
  364. package/mobile/out/src/storage/schema/entities/EntityTransaction.js.map +1 -0
  365. package/mobile/out/src/storage/schema/entities/EntityTxLabel.d.ts +31 -0
  366. package/mobile/out/src/storage/schema/entities/EntityTxLabel.d.ts.map +1 -0
  367. package/mobile/out/src/storage/schema/entities/EntityTxLabel.js +104 -0
  368. package/mobile/out/src/storage/schema/entities/EntityTxLabel.js.map +1 -0
  369. package/mobile/out/src/storage/schema/entities/EntityTxLabelMap.d.ts +28 -0
  370. package/mobile/out/src/storage/schema/entities/EntityTxLabelMap.d.ts.map +1 -0
  371. package/mobile/out/src/storage/schema/entities/EntityTxLabelMap.js +97 -0
  372. package/mobile/out/src/storage/schema/entities/EntityTxLabelMap.js.map +1 -0
  373. package/mobile/out/src/storage/schema/entities/EntityUser.d.ts +29 -0
  374. package/mobile/out/src/storage/schema/entities/EntityUser.d.ts.map +1 -0
  375. package/mobile/out/src/storage/schema/entities/EntityUser.js +98 -0
  376. package/mobile/out/src/storage/schema/entities/EntityUser.js.map +1 -0
  377. package/mobile/out/src/storage/schema/entities/MergeEntity.d.ts +33 -0
  378. package/mobile/out/src/storage/schema/entities/MergeEntity.d.ts.map +1 -0
  379. package/mobile/out/src/storage/schema/entities/MergeEntity.js +62 -0
  380. package/mobile/out/src/storage/schema/entities/MergeEntity.js.map +1 -0
  381. package/mobile/out/src/storage/schema/entities/index.d.ts +17 -0
  382. package/mobile/out/src/storage/schema/entities/index.d.ts.map +1 -0
  383. package/mobile/out/src/storage/schema/entities/index.js +33 -0
  384. package/mobile/out/src/storage/schema/entities/index.js.map +1 -0
  385. package/mobile/out/src/storage/schema/tables/TableCertificate.d.ts +20 -0
  386. package/mobile/out/src/storage/schema/tables/TableCertificate.d.ts.map +1 -0
  387. package/mobile/out/src/storage/schema/tables/TableCertificate.js +3 -0
  388. package/mobile/out/src/storage/schema/tables/TableCertificate.js.map +1 -0
  389. package/mobile/out/src/storage/schema/tables/TableCertificateField.d.ts +12 -0
  390. package/mobile/out/src/storage/schema/tables/TableCertificateField.d.ts.map +1 -0
  391. package/mobile/out/src/storage/schema/tables/TableCertificateField.js +3 -0
  392. package/mobile/out/src/storage/schema/tables/TableCertificateField.js.map +1 -0
  393. package/mobile/out/src/storage/schema/tables/TableCommission.d.ts +13 -0
  394. package/mobile/out/src/storage/schema/tables/TableCommission.d.ts.map +1 -0
  395. package/mobile/out/src/storage/schema/tables/TableCommission.js +3 -0
  396. package/mobile/out/src/storage/schema/tables/TableCommission.js.map +1 -0
  397. package/mobile/out/src/storage/schema/tables/TableMonitorEvent.d.ts +9 -0
  398. package/mobile/out/src/storage/schema/tables/TableMonitorEvent.d.ts.map +1 -0
  399. package/mobile/out/src/storage/schema/tables/TableMonitorEvent.js +3 -0
  400. package/mobile/out/src/storage/schema/tables/TableMonitorEvent.js.map +1 -0
  401. package/mobile/out/src/storage/schema/tables/TableOutput.d.ts +36 -0
  402. package/mobile/out/src/storage/schema/tables/TableOutput.d.ts.map +1 -0
  403. package/mobile/out/src/storage/schema/tables/TableOutput.js +31 -0
  404. package/mobile/out/src/storage/schema/tables/TableOutput.js.map +1 -0
  405. package/mobile/out/src/storage/schema/tables/TableOutputBasket.d.ts +12 -0
  406. package/mobile/out/src/storage/schema/tables/TableOutputBasket.d.ts.map +1 -0
  407. package/mobile/out/src/storage/schema/tables/TableOutputBasket.js +3 -0
  408. package/mobile/out/src/storage/schema/tables/TableOutputBasket.js.map +1 -0
  409. package/mobile/out/src/storage/schema/tables/TableOutputTag.d.ts +10 -0
  410. package/mobile/out/src/storage/schema/tables/TableOutputTag.d.ts.map +1 -0
  411. package/mobile/out/src/storage/schema/tables/TableOutputTag.js +3 -0
  412. package/mobile/out/src/storage/schema/tables/TableOutputTag.js.map +1 -0
  413. package/mobile/out/src/storage/schema/tables/TableOutputTagMap.d.ts +9 -0
  414. package/mobile/out/src/storage/schema/tables/TableOutputTagMap.d.ts.map +1 -0
  415. package/mobile/out/src/storage/schema/tables/TableOutputTagMap.js +3 -0
  416. package/mobile/out/src/storage/schema/tables/TableOutputTagMap.js.map +1 -0
  417. package/mobile/out/src/storage/schema/tables/TableProvenTx.d.ts +14 -0
  418. package/mobile/out/src/storage/schema/tables/TableProvenTx.d.ts.map +1 -0
  419. package/mobile/out/src/storage/schema/tables/TableProvenTx.js +3 -0
  420. package/mobile/out/src/storage/schema/tables/TableProvenTx.js.map +1 -0
  421. package/mobile/out/src/storage/schema/tables/TableProvenTxReq.d.ts +64 -0
  422. package/mobile/out/src/storage/schema/tables/TableProvenTxReq.d.ts.map +1 -0
  423. package/mobile/out/src/storage/schema/tables/TableProvenTxReq.js +3 -0
  424. package/mobile/out/src/storage/schema/tables/TableProvenTxReq.js.map +1 -0
  425. package/mobile/out/src/storage/schema/tables/TableSettings.d.ts +17 -0
  426. package/mobile/out/src/storage/schema/tables/TableSettings.d.ts.map +1 -0
  427. package/mobile/out/src/storage/schema/tables/TableSettings.js +3 -0
  428. package/mobile/out/src/storage/schema/tables/TableSettings.js.map +1 -0
  429. package/mobile/out/src/storage/schema/tables/TableSyncState.d.ts +18 -0
  430. package/mobile/out/src/storage/schema/tables/TableSyncState.d.ts.map +1 -0
  431. package/mobile/out/src/storage/schema/tables/TableSyncState.js +3 -0
  432. package/mobile/out/src/storage/schema/tables/TableSyncState.js.map +1 -0
  433. package/mobile/out/src/storage/schema/tables/TableTransaction.d.ts +37 -0
  434. package/mobile/out/src/storage/schema/tables/TableTransaction.d.ts.map +1 -0
  435. package/mobile/out/src/storage/schema/tables/TableTransaction.js +21 -0
  436. package/mobile/out/src/storage/schema/tables/TableTransaction.js.map +1 -0
  437. package/mobile/out/src/storage/schema/tables/TableTxLabel.d.ts +10 -0
  438. package/mobile/out/src/storage/schema/tables/TableTxLabel.d.ts.map +1 -0
  439. package/mobile/out/src/storage/schema/tables/TableTxLabel.js +3 -0
  440. package/mobile/out/src/storage/schema/tables/TableTxLabel.js.map +1 -0
  441. package/mobile/out/src/storage/schema/tables/TableTxLabelMap.d.ts +9 -0
  442. package/mobile/out/src/storage/schema/tables/TableTxLabelMap.d.ts.map +1 -0
  443. package/mobile/out/src/storage/schema/tables/TableTxLabelMap.js +3 -0
  444. package/mobile/out/src/storage/schema/tables/TableTxLabelMap.js.map +1 -0
  445. package/mobile/out/src/storage/schema/tables/TableUser.d.ts +16 -0
  446. package/mobile/out/src/storage/schema/tables/TableUser.d.ts.map +1 -0
  447. package/mobile/out/src/storage/schema/tables/TableUser.js +3 -0
  448. package/mobile/out/src/storage/schema/tables/TableUser.js.map +1 -0
  449. package/mobile/out/src/storage/schema/tables/index.d.ts +17 -0
  450. package/mobile/out/src/storage/schema/tables/index.d.ts.map +1 -0
  451. package/mobile/out/src/storage/schema/tables/index.js +33 -0
  452. package/mobile/out/src/storage/schema/tables/index.js.map +1 -0
  453. package/mobile/out/src/utility/ScriptTemplateBRC29.d.ts +25 -0
  454. package/mobile/out/src/utility/ScriptTemplateBRC29.d.ts.map +1 -0
  455. package/mobile/out/src/utility/ScriptTemplateBRC29.js +48 -0
  456. package/mobile/out/src/utility/ScriptTemplateBRC29.js.map +1 -0
  457. package/mobile/out/src/utility/identityUtils.d.ts +31 -0
  458. package/mobile/out/src/utility/identityUtils.d.ts.map +1 -0
  459. package/mobile/out/src/utility/identityUtils.js +116 -0
  460. package/mobile/out/src/utility/identityUtils.js.map +1 -0
  461. package/mobile/out/src/utility/index.client.d.ts +7 -0
  462. package/mobile/out/src/utility/index.client.d.ts.map +1 -0
  463. package/mobile/out/src/utility/index.client.js +23 -0
  464. package/mobile/out/src/utility/index.client.js.map +1 -0
  465. package/mobile/out/src/utility/parseTxScriptOffsets.d.ts +14 -0
  466. package/mobile/out/src/utility/parseTxScriptOffsets.d.ts.map +1 -0
  467. package/mobile/out/src/utility/parseTxScriptOffsets.js +26 -0
  468. package/mobile/out/src/utility/parseTxScriptOffsets.js.map +1 -0
  469. package/mobile/out/src/utility/stampLog.d.ts +18 -0
  470. package/mobile/out/src/utility/stampLog.d.ts.map +1 -0
  471. package/mobile/out/src/utility/stampLog.js +72 -0
  472. package/mobile/out/src/utility/stampLog.js.map +1 -0
  473. package/mobile/out/src/utility/tscProofToMerklePath.d.ts +8 -0
  474. package/mobile/out/src/utility/tscProofToMerklePath.d.ts.map +1 -0
  475. package/mobile/out/src/utility/tscProofToMerklePath.js +41 -0
  476. package/mobile/out/src/utility/tscProofToMerklePath.js.map +1 -0
  477. package/mobile/out/src/utility/utilityHelpers.d.ts +129 -0
  478. package/mobile/out/src/utility/utilityHelpers.d.ts.map +1 -0
  479. package/mobile/out/src/utility/utilityHelpers.js +266 -0
  480. package/mobile/out/src/utility/utilityHelpers.js.map +1 -0
  481. package/mobile/out/src/utility/utilityHelpers.noBuffer.d.ts +9 -0
  482. package/mobile/out/src/utility/utilityHelpers.noBuffer.d.ts.map +1 -0
  483. package/mobile/out/src/utility/utilityHelpers.noBuffer.js +23 -0
  484. package/mobile/out/src/utility/utilityHelpers.noBuffer.js.map +1 -0
  485. package/mobile/out/src/wab-client/WABClient.d.ts +49 -0
  486. package/mobile/out/src/wab-client/WABClient.d.ts.map +1 -0
  487. package/mobile/out/src/wab-client/WABClient.js +80 -0
  488. package/mobile/out/src/wab-client/WABClient.js.map +1 -0
  489. package/mobile/out/src/wab-client/auth-method-interactors/AuthMethodInteractor.d.ts +34 -0
  490. package/mobile/out/src/wab-client/auth-method-interactors/AuthMethodInteractor.d.ts.map +1 -0
  491. package/mobile/out/src/wab-client/auth-method-interactors/AuthMethodInteractor.js +16 -0
  492. package/mobile/out/src/wab-client/auth-method-interactors/AuthMethodInteractor.js.map +1 -0
  493. package/mobile/out/src/wab-client/auth-method-interactors/PersonaIDInteractor.d.ts +7 -0
  494. package/mobile/out/src/wab-client/auth-method-interactors/PersonaIDInteractor.d.ts.map +1 -0
  495. package/mobile/out/src/wab-client/auth-method-interactors/PersonaIDInteractor.js +36 -0
  496. package/mobile/out/src/wab-client/auth-method-interactors/PersonaIDInteractor.js.map +1 -0
  497. package/mobile/out/src/wab-client/auth-method-interactors/TwilioPhoneInteractor.d.ts +28 -0
  498. package/mobile/out/src/wab-client/auth-method-interactors/TwilioPhoneInteractor.d.ts.map +1 -0
  499. package/mobile/out/src/wab-client/auth-method-interactors/TwilioPhoneInteractor.js +69 -0
  500. package/mobile/out/src/wab-client/auth-method-interactors/TwilioPhoneInteractor.js.map +1 -0
  501. package/mobile/out/tsconfig.mobile.tsbuildinfo +1 -0
  502. package/mobile/package-lock.json +8 -16
  503. package/mobile/package.json +1 -1
  504. package/out/src/WalletPermissionsManager.d.ts.map +1 -1
  505. package/out/src/WalletPermissionsManager.js.map +1 -1
  506. package/out/src/index.mobile.d.ts +0 -2
  507. package/out/src/index.mobile.d.ts.map +1 -1
  508. package/out/src/index.mobile.js +0 -2
  509. package/out/src/index.mobile.js.map +1 -1
  510. package/out/src/storage/StorageIdb.d.ts +2 -1
  511. package/out/src/storage/StorageIdb.d.ts.map +1 -1
  512. package/out/src/storage/StorageIdb.js +63 -29
  513. package/out/src/storage/StorageIdb.js.map +1 -1
  514. package/out/src/storage/StorageKnex.d.ts +1 -1
  515. package/out/src/storage/StorageKnex.d.ts.map +1 -1
  516. package/out/src/storage/StorageKnex.js +10 -6
  517. package/out/src/storage/StorageKnex.js.map +1 -1
  518. package/out/src/storage/StorageProvider.d.ts +2 -1
  519. package/out/src/storage/StorageProvider.d.ts.map +1 -1
  520. package/out/src/storage/StorageProvider.js +75 -40
  521. package/out/src/storage/StorageProvider.js.map +1 -1
  522. package/out/src/storage/StorageReader.d.ts +2 -1
  523. package/out/src/storage/StorageReader.d.ts.map +1 -1
  524. package/out/src/storage/StorageReader.js +45 -11
  525. package/out/src/storage/StorageReader.js.map +1 -1
  526. package/out/src/storage/StorageReaderWriter.d.ts +2 -1
  527. package/out/src/storage/StorageReaderWriter.d.ts.map +1 -1
  528. package/out/src/storage/StorageReaderWriter.js +29 -29
  529. package/out/src/storage/StorageReaderWriter.js.map +1 -1
  530. package/out/src/storage/StorageSyncReader.d.ts +2 -1
  531. package/out/src/storage/StorageSyncReader.d.ts.map +1 -1
  532. package/out/src/storage/StorageSyncReader.js +36 -3
  533. package/out/src/storage/StorageSyncReader.js.map +1 -1
  534. package/out/src/storage/index.mobile.d.ts +1 -1
  535. package/out/src/storage/index.mobile.js +1 -1
  536. package/out/src/storage/remoting/StorageClient.d.ts.map +1 -1
  537. package/out/src/storage/remoting/StorageClient.js.map +1 -1
  538. package/out/src/storage/remoting/StorageMobile.d.ts +283 -0
  539. package/out/src/storage/remoting/StorageMobile.d.ts.map +1 -0
  540. package/out/src/storage/remoting/StorageMobile.js +477 -0
  541. package/out/src/storage/remoting/StorageMobile.js.map +1 -0
  542. package/out/tsconfig.all.tsbuildinfo +1 -1
  543. package/package.json +1 -1
  544. package/src/WalletPermissionsManager.ts +19 -8
  545. package/src/index.mobile.ts +0 -2
  546. package/src/storage/StorageIdb.ts +4 -5
  547. package/src/storage/StorageKnex.ts +7 -6
  548. package/src/storage/StorageProvider.ts +5 -9
  549. package/src/storage/StorageReader.ts +4 -7
  550. package/src/storage/StorageReaderWriter.ts +4 -8
  551. package/src/storage/StorageSyncReader.ts +2 -19
  552. package/src/storage/index.mobile.ts +1 -1
  553. package/src/storage/remoting/StorageClient.ts +0 -1
  554. package/src/storage/remoting/StorageMobile.ts +527 -0
  555. package/tsconfig.all.json +2 -1
  556. package/tsconfig.client.json +6 -0
  557. package/tsconfig.json +3 -0
  558. package/tsconfig.mobile.json +28 -0
@@ -0,0 +1,298 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.Monitor = void 0;
37
+ const sdk = __importStar(require("../sdk"));
38
+ const services_1 = require("../services");
39
+ const utilityHelpers_1 = require("../utility/utilityHelpers");
40
+ const TaskPurge_1 = require("./tasks/TaskPurge");
41
+ const TaskReviewStatus_1 = require("./tasks/TaskReviewStatus");
42
+ const TaskSyncWhenIdle_1 = require("./tasks/TaskSyncWhenIdle");
43
+ const TaskFailAbandoned_1 = require("./tasks/TaskFailAbandoned");
44
+ const TaskCheckForProofs_1 = require("./tasks/TaskCheckForProofs");
45
+ const TaskClock_1 = require("./tasks/TaskClock");
46
+ const TaskNewHeader_1 = require("./tasks/TaskNewHeader");
47
+ const TaskSendWaiting_1 = require("./tasks/TaskSendWaiting");
48
+ const TaskCheckNoSends_1 = require("./tasks/TaskCheckNoSends");
49
+ const TaskUnFail_1 = require("./tasks/TaskUnFail");
50
+ /**
51
+ * Background task to make sure transactions are processed, transaction proofs are received and propagated,
52
+ * and potentially that reorgs update proofs that were already received.
53
+ */
54
+ class Monitor {
55
+ static createDefaultWalletMonitorOptions(chain, storage, services) {
56
+ services || (services = new services_1.Services(chain));
57
+ if (!services.options.chaintracks)
58
+ throw new sdk.WERR_INVALID_PARAMETER('services.options.chaintracks', 'valid');
59
+ const o = {
60
+ chain,
61
+ services,
62
+ storage,
63
+ msecsWaitPerMerkleProofServiceReq: 500,
64
+ taskRunWaitMsecs: 5000,
65
+ abandonedMsecs: 1000 * 60 * 5,
66
+ unprovenAttemptsLimitTest: 10,
67
+ unprovenAttemptsLimitMain: 144,
68
+ chaintracks: services.options.chaintracks
69
+ };
70
+ return o;
71
+ }
72
+ constructor(options) {
73
+ this.oneSecond = 1000;
74
+ this.oneMinute = 60 * this.oneSecond;
75
+ this.oneHour = 60 * this.oneMinute;
76
+ this.oneDay = 24 * this.oneHour;
77
+ this.oneWeek = 7 * this.oneDay;
78
+ /**
79
+ * _tasks are typically run by the scheduler but may also be run by runTask.
80
+ */
81
+ this._tasks = [];
82
+ /**
83
+ * _otherTasks can be run by runTask but not by scheduler.
84
+ */
85
+ this._otherTasks = [];
86
+ this._tasksRunning = false;
87
+ this.defaultPurgeParams = {
88
+ purgeSpent: false,
89
+ purgeCompleted: false,
90
+ purgeFailed: true,
91
+ purgeSpentAge: 2 * this.oneWeek,
92
+ purgeCompletedAge: 2 * this.oneWeek,
93
+ purgeFailedAge: 5 * this.oneDay
94
+ };
95
+ this._runAsyncSetup = true;
96
+ this.options = { ...options };
97
+ this.services = options.services;
98
+ this.chain = this.services.chain;
99
+ this.storage = options.storage;
100
+ this.chaintracks = options.chaintracks;
101
+ }
102
+ addAllTasksToOther() {
103
+ this._otherTasks.push(new TaskClock_1.TaskClock(this));
104
+ this._otherTasks.push(new TaskNewHeader_1.TaskNewHeader(this));
105
+ this._otherTasks.push(new TaskPurge_1.TaskPurge(this, this.defaultPurgeParams));
106
+ this._otherTasks.push(new TaskReviewStatus_1.TaskReviewStatus(this));
107
+ this._otherTasks.push(new TaskSendWaiting_1.TaskSendWaiting(this));
108
+ this._otherTasks.push(new TaskCheckForProofs_1.TaskCheckForProofs(this));
109
+ this._otherTasks.push(new TaskCheckNoSends_1.TaskCheckNoSends(this));
110
+ this._otherTasks.push(new TaskUnFail_1.TaskUnFail(this));
111
+ this._otherTasks.push(new TaskFailAbandoned_1.TaskFailAbandoned(this));
112
+ this._otherTasks.push(new TaskSyncWhenIdle_1.TaskSyncWhenIdle(this));
113
+ }
114
+ /**
115
+ * Default tasks with settings appropriate for a single user storage
116
+ * possibly with sync'ing enabled
117
+ */
118
+ addDefaultTasks() {
119
+ this._tasks.push(new TaskClock_1.TaskClock(this));
120
+ this._tasks.push(new TaskNewHeader_1.TaskNewHeader(this));
121
+ this._tasks.push(new TaskSendWaiting_1.TaskSendWaiting(this, 8 * this.oneSecond, 7 * this.oneSecond)); // Check every 8 seconds but must be 7 seconds old
122
+ this._tasks.push(new TaskCheckForProofs_1.TaskCheckForProofs(this, 2 * this.oneHour)); // Every two hours if no block found
123
+ this._tasks.push(new TaskCheckNoSends_1.TaskCheckNoSends(this));
124
+ this._tasks.push(new TaskFailAbandoned_1.TaskFailAbandoned(this, 8 * this.oneMinute));
125
+ this._tasks.push(new TaskUnFail_1.TaskUnFail(this));
126
+ // No purging until invalid transactions are really invalid...
127
+ //this._tasks.push(new TaskPurge(this, this.defaultPurgeParams, 6 * this.oneHour))
128
+ this._tasks.push(new TaskReviewStatus_1.TaskReviewStatus(this));
129
+ }
130
+ /**
131
+ * Tasks appropriate for multi-user storage
132
+ * without sync'ing enabled.
133
+ */
134
+ addMultiUserTasks() {
135
+ this._tasks.push(new TaskClock_1.TaskClock(this));
136
+ this._tasks.push(new TaskNewHeader_1.TaskNewHeader(this));
137
+ this._tasks.push(new TaskSendWaiting_1.TaskSendWaiting(this, 8 * this.oneSecond, 7 * this.oneSecond)); // Check every 8 seconds but must be 7 seconds old
138
+ this._tasks.push(new TaskCheckForProofs_1.TaskCheckForProofs(this, 2 * this.oneHour)); // Every two hours if no block found
139
+ this._tasks.push(new TaskCheckNoSends_1.TaskCheckNoSends(this));
140
+ this._tasks.push(new TaskFailAbandoned_1.TaskFailAbandoned(this, 8 * this.oneMinute));
141
+ this._tasks.push(new TaskUnFail_1.TaskUnFail(this));
142
+ // No purging until invalid transactions are really invalid...
143
+ //this._tasks.push(new TaskPurge(this, this.defaultPurgeParams, 6 * this.oneHour))
144
+ this._tasks.push(new TaskReviewStatus_1.TaskReviewStatus(this));
145
+ }
146
+ addTask(task) {
147
+ if (this._tasks.some(t => t.name === task.name))
148
+ throw new sdk.WERR_BAD_REQUEST(`task ${task.name} has already been added.`);
149
+ this._tasks.push(task);
150
+ }
151
+ removeTask(name) {
152
+ this._tasks = this._tasks.filter(t => t.name !== name);
153
+ }
154
+ async setupChaintracksListeners() {
155
+ try {
156
+ // TODO: Use a task monitoring the newest block headere to trigger processNewHeader and reorg handling.
157
+ }
158
+ catch (err) {
159
+ /* this chaintracks doesn't support event subscriptions */
160
+ }
161
+ }
162
+ async runTask(name) {
163
+ let task = this._tasks.find(t => t.name === name);
164
+ let log = '';
165
+ if (!task)
166
+ task = this._otherTasks.find(t => t.name === name);
167
+ if (task) {
168
+ await task.asyncSetup();
169
+ log = await task.runTask();
170
+ }
171
+ return log;
172
+ }
173
+ async runOnce() {
174
+ if (this._runAsyncSetup) {
175
+ for (const t of this._tasks) {
176
+ try {
177
+ await t.asyncSetup();
178
+ }
179
+ catch (eu) {
180
+ const e = sdk.WalletError.fromUnknown(eu);
181
+ const details = `monitor task ${t.name} asyncSetup error ${e.code} ${e.description}`;
182
+ console.log(details);
183
+ await this.logEvent('error0', details);
184
+ }
185
+ if (!this._tasksRunning)
186
+ break;
187
+ }
188
+ this._runAsyncSetup = false;
189
+ }
190
+ if (this.storage.getActive().isStorageProvider()) {
191
+ const tasksToRun = [];
192
+ const now = new Date().getTime();
193
+ for (const t of this._tasks) {
194
+ try {
195
+ if (t.trigger(now).run)
196
+ tasksToRun.push(t);
197
+ }
198
+ catch (eu) {
199
+ const e = sdk.WalletError.fromUnknown(eu);
200
+ const details = `monitor task ${t.name} trigger error ${e.code} ${e.description}`;
201
+ console.log(details);
202
+ await this.logEvent('error0', details);
203
+ }
204
+ }
205
+ for (const ttr of tasksToRun) {
206
+ try {
207
+ if (this.storage.getActive().isStorageProvider()) {
208
+ const log = await ttr.runTask();
209
+ if (log && log.length > 0) {
210
+ console.log(`Task${ttr.name} ${log}`);
211
+ await this.logEvent(ttr.name, log);
212
+ }
213
+ }
214
+ }
215
+ catch (eu) {
216
+ const e = sdk.WalletError.fromUnknown(eu);
217
+ const details = `monitor task ${ttr.name} runTask error ${e.code} ${e.description}\n${e.stack}`;
218
+ console.log(details);
219
+ await this.logEvent('error1', details);
220
+ }
221
+ finally {
222
+ ttr.lastRunMsecsSinceEpoch = new Date().getTime();
223
+ }
224
+ }
225
+ }
226
+ }
227
+ async startTasks() {
228
+ if (this._tasksRunning)
229
+ throw new sdk.WERR_BAD_REQUEST('monitor tasks are already runnining.');
230
+ this._tasksRunning = true;
231
+ for (; this._tasksRunning;) {
232
+ await this.runOnce();
233
+ // console.log(`${new Date().toISOString()} tasks run, waiting...`)
234
+ await (0, utilityHelpers_1.wait)(this.options.taskRunWaitMsecs);
235
+ }
236
+ }
237
+ async logEvent(event, details) {
238
+ await this.storage.runAsStorageProvider(async (sp) => {
239
+ await sp.insertMonitorEvent({
240
+ created_at: new Date(),
241
+ updated_at: new Date(),
242
+ id: 0,
243
+ event,
244
+ details
245
+ });
246
+ });
247
+ }
248
+ stopTasks() {
249
+ this._tasksRunning = false;
250
+ }
251
+ /**
252
+ * Process new chain header event received from Chaintracks
253
+ *
254
+ * Kicks processing 'unconfirmed' and 'unmined' request processing.
255
+ *
256
+ * @param reqs
257
+ */
258
+ processNewBlockHeader(header) {
259
+ const h = header;
260
+ this.lastNewHeader = h;
261
+ this.lastNewHeaderWhen = new Date();
262
+ console.log(`WalletMonitor notified of new block header ${h.height}`);
263
+ // Nudge the proof checker to try again.
264
+ TaskCheckForProofs_1.TaskCheckForProofs.checkNow = true;
265
+ }
266
+ /**
267
+ * Process reorg event received from Chaintracks
268
+ *
269
+ * Reorgs can move recent transactions to new blocks at new index positions.
270
+ * Affected transaction proofs become invalid and must be updated.
271
+ *
272
+ * It is possible for a transaction to become invalid.
273
+ *
274
+ * Coinbase transactions always become invalid.
275
+ */
276
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
277
+ processReorg(depth, oldTip, newTip) {
278
+ /* */
279
+ }
280
+ }
281
+ exports.Monitor = Monitor;
282
+ function sum(a, getNum) {
283
+ let s = 0;
284
+ for (const v of a)
285
+ s += getNum(v);
286
+ return s;
287
+ }
288
+ function filter(a, pred) {
289
+ const ts = [];
290
+ const fs = [];
291
+ for (const v of a)
292
+ if (pred(v))
293
+ ts.push(v);
294
+ else
295
+ fs.push(v);
296
+ return { ts, fs };
297
+ }
298
+ //# sourceMappingURL=Monitor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Monitor.js","sourceRoot":"","sources":["../../../../src/monitor/Monitor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4CAA6B;AAC7B,0CAAsC;AACtC,8DAAgD;AAMhD,iDAA8D;AAC9D,+DAA2D;AAC3D,+DAA2D;AAC3D,iEAA6D;AAC7D,mEAA+D;AAC/D,iDAA6C;AAC7C,yDAAqD;AAErD,6DAAyD;AACzD,+DAA2D;AAC3D,mDAA+C;AA2B/C;;;GAGG;AACH,MAAa,OAAO;IAClB,MAAM,CAAC,iCAAiC,CACtC,KAAgB,EAChB,OAAuB,EACvB,QAAmB;QAEnB,QAAQ,KAAR,QAAQ,GAAK,IAAI,mBAAQ,CAAC,KAAK,CAAC,EAAA;QAChC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW;YAAE,MAAM,IAAI,GAAG,CAAC,sBAAsB,CAAC,8BAA8B,EAAE,OAAO,CAAC,CAAA;QAChH,MAAM,CAAC,GAAmB;YACxB,KAAK;YACL,QAAQ;YACR,OAAO;YACP,iCAAiC,EAAE,GAAG;YACtC,gBAAgB,EAAE,IAAI;YACtB,cAAc,EAAE,IAAI,GAAG,EAAE,GAAG,CAAC;YAC7B,yBAAyB,EAAE,EAAE;YAC7B,yBAAyB,EAAE,GAAG;YAC9B,WAAW,EAAE,QAAQ,CAAC,OAAO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,CAAI,CAAM,EAAE,MAAwB;IAC9C,IAAI,CAAC,GAAG,CAAC,CAAA;IACT,KAAK,MAAM,CAAC,IAAI,CAAC;QAAE,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAA;IACjC,OAAO,CAAC,CAAA;AACV,CAAC;AAED,SAAS,MAAM,CAAI,CAAM,EAAE,IAAuB;IAChD,MAAM,EAAE,GAAQ,EAAE,CAAA;IAClB,MAAM,EAAE,GAAQ,EAAE,CAAA;IAClB,KAAK,MAAM,CAAC,IAAI,CAAC;QACf,IAAI,IAAI,CAAC,CAAC,CAAC;YAAE,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;;YAClB,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACjB,OAAO,EAAE,EAAE,EAAE,EAAE,EAAE,CAAA;AACnB,CAAC"}
@@ -0,0 +1,53 @@
1
+ import { TableProvenTxReq } from '../../storage/schema/tables';
2
+ import { Monitor } from '../Monitor';
3
+ import { WalletMonitorTask } from './WalletMonitorTask';
4
+ /**
5
+ * `TaskCheckForProofs` is a WalletMonitor task that retreives merkle proofs for
6
+ * transactions.
7
+ *
8
+ * It is normally triggered by the Chaintracks new block header event.
9
+ *
10
+ * When a new block is found, cwi-external-services are used to obtain proofs for
11
+ * any transactions that are currently in the 'unmined' or 'unknown' state.
12
+ *
13
+ * If a proof is obtained and validated, a new ProvenTx record is created and
14
+ * the original ProvenTxReq status is advanced to 'notifying'.
15
+ */
16
+ export declare class TaskCheckForProofs extends WalletMonitorTask {
17
+ triggerMsecs: number;
18
+ static taskName: string;
19
+ /**
20
+ * An external service such as the chaintracks new block header
21
+ * listener can set this true to cause
22
+ */
23
+ static checkNow: boolean;
24
+ constructor(monitor: Monitor, triggerMsecs?: number);
25
+ /**
26
+ * Normally triggered by checkNow getting set by new block header found event from chaintracks
27
+ */
28
+ trigger(nowMsecsSinceEpoch: number): {
29
+ run: boolean;
30
+ };
31
+ runTask(): Promise<string>;
32
+ }
33
+ /**
34
+ * Process an array of table.ProvenTxReq (typically with status 'unmined' or 'unknown')
35
+ *
36
+ * If req is invalid, set status 'invalid'
37
+ *
38
+ * Verify the requests are valid, lookup proofs or updated transaction status using the array of getProofServices,
39
+ *
40
+ * When proofs are found, create new ProvenTxApi records and transition the requests' status to 'unconfirmed' or 'notifying',
41
+ * depending on chaintracks succeeding on proof verification.
42
+ *
43
+ * Increments attempts if proofs where requested.
44
+ *
45
+ * @param reqs
46
+ * @returns reqs partitioned by status
47
+ */
48
+ export declare function getProofs(task: WalletMonitorTask, reqs: TableProvenTxReq[], indent?: number, countsAsAttempt?: boolean, ignoreStatus?: boolean): Promise<{
49
+ proven: TableProvenTxReq[];
50
+ invalid: TableProvenTxReq[];
51
+ log: string;
52
+ }>;
53
+ //# sourceMappingURL=TaskCheckForProofs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TaskCheckForProofs.d.ts","sourceRoot":"","sources":["../../../../../src/monitor/tasks/TaskCheckForProofs.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAG9D,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAEvD;;;;;;;;;;;GAWG;AACH,qBAAa,kBAAmB,SAAQ,iBAAiB;IAW9C,YAAY;IAVrB,MAAM,CAAC,QAAQ,SAAmB;IAElC;;;OAGG;IACH,MAAM,CAAC,QAAQ,UAAQ;gBAGrB,OAAO,EAAE,OAAO,EACT,YAAY,SAAI;IAKzB;;OAEG;IACH,OAAO,CAAC,kBAAkB,EAAE,MAAM,GAAG;QAAE,GAAG,EAAE,OAAO,CAAA;KAAE;IAQ/C,OAAO,IAAI,OAAO,CAAC,MAAM,CAAC;CAuBjC;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,SAAS,CAC7B,IAAI,EAAE,iBAAiB,EACvB,IAAI,EAAE,gBAAgB,EAAE,EACxB,MAAM,SAAI,EACV,eAAe,UAAQ,EACvB,YAAY,UAAQ,GACnB,OAAO,CAAC;IACT,MAAM,EAAE,gBAAgB,EAAE,CAAA;IAC1B,OAAO,EAAE,gBAAgB,EAAE,CAAA;IAC3B,GAAG,EAAE,MAAM,CAAA;CACZ,CAAC,CA6HD"}
@@ -0,0 +1,194 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TaskCheckForProofs = void 0;
4
+ exports.getProofs = getProofs;
5
+ const entities_1 = require("../../storage/schema/entities");
6
+ const utilityHelpers_1 = require("../../utility/utilityHelpers");
7
+ const utilityHelpers_noBuffer_1 = require("../../utility/utilityHelpers.noBuffer");
8
+ const WalletMonitorTask_1 = require("./WalletMonitorTask");
9
+ /**
10
+ * `TaskCheckForProofs` is a WalletMonitor task that retreives merkle proofs for
11
+ * transactions.
12
+ *
13
+ * It is normally triggered by the Chaintracks new block header event.
14
+ *
15
+ * When a new block is found, cwi-external-services are used to obtain proofs for
16
+ * any transactions that are currently in the 'unmined' or 'unknown' state.
17
+ *
18
+ * If a proof is obtained and validated, a new ProvenTx record is created and
19
+ * the original ProvenTxReq status is advanced to 'notifying'.
20
+ */
21
+ class TaskCheckForProofs extends WalletMonitorTask_1.WalletMonitorTask {
22
+ constructor(monitor, triggerMsecs = 0) {
23
+ super(monitor, TaskCheckForProofs.taskName);
24
+ this.triggerMsecs = triggerMsecs;
25
+ }
26
+ /**
27
+ * Normally triggered by checkNow getting set by new block header found event from chaintracks
28
+ */
29
+ trigger(nowMsecsSinceEpoch) {
30
+ return {
31
+ run: TaskCheckForProofs.checkNow ||
32
+ (this.triggerMsecs > 0 && nowMsecsSinceEpoch - this.lastRunMsecsSinceEpoch > this.triggerMsecs)
33
+ };
34
+ }
35
+ async runTask() {
36
+ let log = '';
37
+ const countsAsAttempt = TaskCheckForProofs.checkNow;
38
+ TaskCheckForProofs.checkNow = false;
39
+ const limit = 100;
40
+ let offset = 0;
41
+ for (;;) {
42
+ const reqs = await this.storage.findProvenTxReqs({
43
+ partial: {},
44
+ status: ['callback', 'unmined', 'sending', 'unknown', 'unconfirmed'],
45
+ paged: { limit, offset }
46
+ });
47
+ if (reqs.length === 0)
48
+ break;
49
+ log += `${reqs.length} reqs with status 'callback', 'unmined', 'sending', 'unknown', or 'unconfirmed'\n`;
50
+ const r = await getProofs(this, reqs, 2, countsAsAttempt);
51
+ log += `${r.log}\n`;
52
+ //console.log(log);
53
+ if (reqs.length < limit)
54
+ break;
55
+ offset += limit;
56
+ }
57
+ return log;
58
+ }
59
+ }
60
+ exports.TaskCheckForProofs = TaskCheckForProofs;
61
+ TaskCheckForProofs.taskName = 'CheckForProofs';
62
+ /**
63
+ * An external service such as the chaintracks new block header
64
+ * listener can set this true to cause
65
+ */
66
+ TaskCheckForProofs.checkNow = false;
67
+ /**
68
+ * Process an array of table.ProvenTxReq (typically with status 'unmined' or 'unknown')
69
+ *
70
+ * If req is invalid, set status 'invalid'
71
+ *
72
+ * Verify the requests are valid, lookup proofs or updated transaction status using the array of getProofServices,
73
+ *
74
+ * When proofs are found, create new ProvenTxApi records and transition the requests' status to 'unconfirmed' or 'notifying',
75
+ * depending on chaintracks succeeding on proof verification.
76
+ *
77
+ * Increments attempts if proofs where requested.
78
+ *
79
+ * @param reqs
80
+ * @returns reqs partitioned by status
81
+ */
82
+ async function getProofs(task, reqs, indent = 0, countsAsAttempt = false, ignoreStatus = false) {
83
+ const proven = [];
84
+ const invalid = [];
85
+ let log = '';
86
+ for (const reqApi of reqs) {
87
+ log += ' '.repeat(indent);
88
+ log += `reqId ${reqApi.provenTxReqId} txid ${reqApi.txid}: `;
89
+ if (!ignoreStatus &&
90
+ reqApi.status !== 'callback' &&
91
+ reqApi.status !== 'unmined' &&
92
+ reqApi.status !== 'unknown' &&
93
+ reqApi.status !== 'unconfirmed' &&
94
+ reqApi.status !== 'nosend' &&
95
+ reqApi.status !== 'sending') {
96
+ log += `status of '${reqApi.status}' is not ready to be proven.\n`;
97
+ continue;
98
+ }
99
+ const req = new entities_1.EntityProvenTxReq(reqApi);
100
+ if (Number.isInteger(req.provenTxId)) {
101
+ log += `Already linked to provenTxId ${req.provenTxId}.\n`;
102
+ req.notified = false;
103
+ req.status = 'completed';
104
+ await req.updateStorageDynamicProperties(task.storage);
105
+ proven.push(reqApi);
106
+ continue;
107
+ }
108
+ log += '\n';
109
+ let reqIsValid = false;
110
+ if (req.rawTx) {
111
+ const txid = (0, utilityHelpers_noBuffer_1.asString)((0, utilityHelpers_1.doubleSha256BE)(req.rawTx));
112
+ if (txid === req.txid)
113
+ reqIsValid = true;
114
+ }
115
+ if (!reqIsValid) {
116
+ log += ` rawTx doesn't hash to txid. status => invalid.\n`;
117
+ req.notified = false;
118
+ req.status = 'invalid';
119
+ await req.updateStorageDynamicProperties(task.storage);
120
+ invalid.push(reqApi);
121
+ continue;
122
+ }
123
+ const limit = task.monitor.chain === 'main'
124
+ ? task.monitor.options.unprovenAttemptsLimitMain
125
+ : task.monitor.options.unprovenAttemptsLimitTest;
126
+ if (!ignoreStatus && req.attempts > limit) {
127
+ log += ` too many failed attempts ${req.attempts}\n`;
128
+ req.notified = false;
129
+ req.status = 'invalid';
130
+ await req.updateStorageDynamicProperties(task.storage);
131
+ invalid.push(reqApi);
132
+ continue;
133
+ }
134
+ const since = new Date();
135
+ let r;
136
+ let ptx;
137
+ // External services will try multiple providers until one returns a proof,
138
+ // or they all fail.
139
+ // There may also be an array of proofs to consider when a transaction
140
+ // is recently mined and appears in orphan blocks in addition to active chain blocks.
141
+ // Since orphan blocks can end up on chain again, multiple proofs has value.
142
+ //
143
+ // On failure, there may be a mapi response, or an error.
144
+ //
145
+ // The proofs returned are considered sequentially, validating and chaintracks confirming.
146
+ //
147
+ // If a good proof is found, proceed to using it.
148
+ //
149
+ // When all received proofs fail, force a bump to the next service provider and try
150
+ // one more time.
151
+ //
152
+ r = await task.monitor.services.getMerklePath(req.txid);
153
+ ptx = await entities_1.EntityProvenTx.fromReq(req, r, countsAsAttempt && req.status !== 'nosend');
154
+ if (ptx) {
155
+ // We have a merklePath proof for the request (and a block header)
156
+ await req.updateStorageDynamicProperties(task.storage);
157
+ await req.refreshFromStorage(task.storage);
158
+ const { provenTxReqId, status, txid, attempts, history } = req.toApi();
159
+ const { index, height, blockHash, merklePath, merkleRoot } = ptx.toApi();
160
+ const r = await task.storage.runAsStorageProvider(async (sp) => {
161
+ return await sp.updateProvenTxReqWithNewProvenTx({
162
+ provenTxReqId,
163
+ status,
164
+ txid,
165
+ attempts,
166
+ history,
167
+ index,
168
+ height,
169
+ blockHash,
170
+ merklePath,
171
+ merkleRoot
172
+ });
173
+ });
174
+ req.status = r.status;
175
+ req.apiHistory = r.history;
176
+ req.provenTxId = r.provenTxId;
177
+ req.notified = true;
178
+ }
179
+ else {
180
+ if (countsAsAttempt && req.status !== 'nosend') {
181
+ req.attempts++;
182
+ }
183
+ }
184
+ await req.updateStorageDynamicProperties(task.storage);
185
+ await req.refreshFromStorage(task.storage);
186
+ log += req.historyPretty(since, indent + 2) + '\n';
187
+ if (req.status === 'completed')
188
+ proven.push(req.api);
189
+ if (req.status === 'invalid')
190
+ invalid.push(req.api);
191
+ }
192
+ return { proven, invalid, log };
193
+ }
194
+ //# sourceMappingURL=TaskCheckForProofs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TaskCheckForProofs.js","sourceRoot":"","sources":["../../../../../src/monitor/tasks/TaskCheckForProofs.ts"],"names":[],"mappings":";;;AAuFA,8BAuIC;AA7ND,4DAAiF;AAEjF,iEAA6D;AAC7D,mFAAgE;AAEhE,2DAAuD;AAEvD;;;;;;;;;;;GAWG;AACH,MAAa,kBAAmB,SAAQ,qCAAiB;IASvD,YACE,OAAgB,EACT,eAAe,CAAC;QAEvB,KAAK,CAAC,OAAO,EAAE,kBAAkB,CAAC,QAAQ,CAAC,CAAA;QAFpC,iBAAY,GAAZ,YAAY,CAAI;IAGzB,CAAC;IAED;;OAEG;IACH,OAAO,CA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AAG,CAAC,UAAU,GAAG,CAAC,CAAC,UAAU,CAAA;YAC7B,GAAG,CAAC,QAAQ,GAAG,IAAI,CAAA;QACrB,CAAC;aAAM,CAAC;YACN,IAAI,eAAe,IAAI,GAAG,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;gBAC/C,GAAG,CAAC,QAAQ,EAAE,CAAA;YAChB,CAAC;QACH,CAAC;QACD,MAAM,GAAG,CAAC,8BAA8B,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QACtD,MAAM,GAAG,CAAC,kBAAkB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QAE1C,GAAG,IAAI,GAAG,CAAC,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,CAAC,CAAC,GAAG,IAAI,CAAA;QAElD,IAAI,GAAG,CAAC,MAAM,KAAK,WAAW;YAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;QACpD,IAAI,GAAG,CAAC,MAAM,KAAK,SAAS;YAAE,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;IACrD,CAAC;IAED,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,CAAA;AACjC,CAAC"}
@@ -0,0 +1,33 @@
1
+ import { Monitor } from '../Monitor';
2
+ import { WalletMonitorTask } from './WalletMonitorTask';
3
+ /**
4
+ * `TaskCheckNoSends` is a WalletMonitor task that retreives merkle proofs for
5
+ * 'nosend' transactions that MAY have been shared externally.
6
+ *
7
+ * Unlike intentionally processed transactions, 'nosend' transactions are fully valid
8
+ * transactions which have not been processed by the wallet.
9
+ *
10
+ * By default, this task runs once a day to check if any 'nosend' transaction has
11
+ * managed to get mined by some external process.
12
+ *
13
+ * If a proof is obtained and validated, a new ProvenTx record is created and
14
+ * the original ProvenTxReq status is advanced to 'notifying'.
15
+ */
16
+ export declare class TaskCheckNoSends extends WalletMonitorTask {
17
+ triggerMsecs: number;
18
+ static taskName: string;
19
+ /**
20
+ * An external service such as the chaintracks new block header
21
+ * listener can set this true to cause
22
+ */
23
+ static checkNow: boolean;
24
+ constructor(monitor: Monitor, triggerMsecs?: number);
25
+ /**
26
+ * Normally triggered by checkNow getting set by new block header found event from chaintracks
27
+ */
28
+ trigger(nowMsecsSinceEpoch: number): {
29
+ run: boolean;
30
+ };
31
+ runTask(): Promise<string>;
32
+ }
33
+ //# sourceMappingURL=TaskCheckNoSends.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TaskCheckNoSends.d.ts","sourceRoot":"","sources":["../../../../../src/monitor/tasks/TaskCheckNoSends.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAEpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAEvD;;;;;;;;;;;;GAYG;AACH,qBAAa,gBAAiB,SAAQ,iBAAiB;IAW5C,YAAY;IAVrB,MAAM,CAAC,QAAQ,SAAiB;IAEhC;;;OAGG;IACH,MAAM,CAAC,QAAQ,UAAQ;gBAGrB,OAAO,EAAE,OAAO,EACT,YAAY,SAAqB;IAK1C;;OAEG;IACH,OAAO,CAAC,kBAAkB,EAAE,MAAM,GAAG;QAAE,GAAG,EAAE,OAAO,CAAA;KAAE;IAQ/C,OAAO,IAAI,OAAO,CAAC,MAAM,CAAC;CAuBjC"}