@bsv/wallet-toolbox 2.12.0 → 2.13.2

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 (693) hide show
  1. package/CHANGELOG.md +350 -1
  2. package/README.md +556 -6
  3. package/docs/README.md +8 -1
  4. package/docs/client.md +13057 -4632
  5. package/docs/identity-verification.md +196 -0
  6. package/docs/monitor.md +505 -190
  7. package/docs/services.md +4013 -1153
  8. package/docs/setup.md +98 -58
  9. package/docs/storage.md +5780 -1609
  10. package/docs/sync-transfer.md +144 -0
  11. package/docs/wallet.md +10155 -10871
  12. package/out/src/CWIStyleWalletManager.d.ts +6 -8
  13. package/out/src/CWIStyleWalletManager.d.ts.map +1 -1
  14. package/out/src/CWIStyleWalletManager.js +170 -125
  15. package/out/src/CWIStyleWalletManager.js.map +1 -1
  16. package/out/src/Setup.d.ts +2 -0
  17. package/out/src/Setup.d.ts.map +1 -1
  18. package/out/src/Setup.js +3 -2
  19. package/out/src/Setup.js.map +1 -1
  20. package/out/src/ShamirWalletManager.d.ts.map +1 -1
  21. package/out/src/ShamirWalletManager.js +34 -19
  22. package/out/src/ShamirWalletManager.js.map +1 -1
  23. package/out/src/SimpleWalletManager.d.ts.map +1 -1
  24. package/out/src/SimpleWalletManager.js +7 -6
  25. package/out/src/SimpleWalletManager.js.map +1 -1
  26. package/out/src/Wallet.d.ts +50 -11
  27. package/out/src/Wallet.d.ts.map +1 -1
  28. package/out/src/Wallet.js +183 -107
  29. package/out/src/Wallet.js.map +1 -1
  30. package/out/src/WalletAuthenticationManager.d.ts.map +1 -1
  31. package/out/src/WalletAuthenticationManager.js +282 -26
  32. package/out/src/WalletAuthenticationManager.js.map +1 -1
  33. package/out/src/WalletLogger.js +1 -1
  34. package/out/src/WalletLogger.js.map +1 -1
  35. package/out/src/WalletPermissionsManager.d.ts +30 -17
  36. package/out/src/WalletPermissionsManager.d.ts.map +1 -1
  37. package/out/src/WalletPermissionsManager.js +540 -312
  38. package/out/src/WalletPermissionsManager.js.map +1 -1
  39. package/out/src/WalletSettingsManager.d.ts +3 -2
  40. package/out/src/WalletSettingsManager.d.ts.map +1 -1
  41. package/out/src/WalletSettingsManager.js +141 -6
  42. package/out/src/WalletSettingsManager.js.map +1 -1
  43. package/out/src/entropy/EntropyCollector.d.ts.map +1 -1
  44. package/out/src/entropy/EntropyCollector.js +3 -2
  45. package/out/src/entropy/EntropyCollector.js.map +1 -1
  46. package/out/src/fundWalletP2PKH.d.ts.map +1 -1
  47. package/out/src/fundWalletP2PKH.js +143 -44
  48. package/out/src/fundWalletP2PKH.js.map +1 -1
  49. package/out/src/mockchain/MockChainTracker.d.ts.map +1 -1
  50. package/out/src/mockchain/MockChainTracker.js +5 -5
  51. package/out/src/mockchain/MockChainTracker.js.map +1 -1
  52. package/out/src/mockchain/MockServices.d.ts.map +1 -1
  53. package/out/src/mockchain/MockServices.js +32 -8
  54. package/out/src/mockchain/MockServices.js.map +1 -1
  55. package/out/src/monitor/Monitor.d.ts +17 -0
  56. package/out/src/monitor/Monitor.d.ts.map +1 -1
  57. package/out/src/monitor/Monitor.js +206 -42
  58. package/out/src/monitor/Monitor.js.map +1 -1
  59. package/out/src/monitor/MonitorDaemon.d.ts.map +1 -1
  60. package/out/src/monitor/MonitorDaemon.js +64 -16
  61. package/out/src/monitor/MonitorDaemon.js.map +1 -1
  62. package/out/src/monitor/monitorValidation.d.ts +12 -0
  63. package/out/src/monitor/monitorValidation.d.ts.map +1 -0
  64. package/out/src/monitor/monitorValidation.js +133 -0
  65. package/out/src/monitor/monitorValidation.js.map +1 -0
  66. package/out/src/monitor/tasks/TaskArcSSE.d.ts +2 -0
  67. package/out/src/monitor/tasks/TaskArcSSE.d.ts.map +1 -1
  68. package/out/src/monitor/tasks/TaskArcSSE.js +28 -12
  69. package/out/src/monitor/tasks/TaskArcSSE.js.map +1 -1
  70. package/out/src/monitor/tasks/TaskCheckForProofs.d.ts +5 -0
  71. package/out/src/monitor/tasks/TaskCheckForProofs.d.ts.map +1 -1
  72. package/out/src/monitor/tasks/TaskCheckForProofs.js +29 -24
  73. package/out/src/monitor/tasks/TaskCheckForProofs.js.map +1 -1
  74. package/out/src/monitor/tasks/TaskCheckNoSends.d.ts.map +1 -1
  75. package/out/src/monitor/tasks/TaskCheckNoSends.js +11 -3
  76. package/out/src/monitor/tasks/TaskCheckNoSends.js.map +1 -1
  77. package/out/src/monitor/tasks/TaskFailAbandoned.d.ts.map +1 -1
  78. package/out/src/monitor/tasks/TaskFailAbandoned.js +9 -4
  79. package/out/src/monitor/tasks/TaskFailAbandoned.js.map +1 -1
  80. package/out/src/monitor/tasks/TaskNewHeader.d.ts.map +1 -1
  81. package/out/src/monitor/tasks/TaskNewHeader.js +3 -1
  82. package/out/src/monitor/tasks/TaskNewHeader.js.map +1 -1
  83. package/out/src/monitor/tasks/TaskReconcilePendingTransactions.d.ts.map +1 -1
  84. package/out/src/monitor/tasks/TaskReconcilePendingTransactions.js +9 -3
  85. package/out/src/monitor/tasks/TaskReconcilePendingTransactions.js.map +1 -1
  86. package/out/src/monitor/tasks/TaskReorg.d.ts.map +1 -1
  87. package/out/src/monitor/tasks/TaskReorg.js +4 -4
  88. package/out/src/monitor/tasks/TaskReorg.js.map +1 -1
  89. package/out/src/monitor/tasks/TaskReviewDoubleSpends.d.ts.map +1 -1
  90. package/out/src/monitor/tasks/TaskReviewDoubleSpends.js +17 -7
  91. package/out/src/monitor/tasks/TaskReviewDoubleSpends.js.map +1 -1
  92. package/out/src/monitor/tasks/TaskReviewProvenTxs.d.ts +18 -1
  93. package/out/src/monitor/tasks/TaskReviewProvenTxs.d.ts.map +1 -1
  94. package/out/src/monitor/tasks/TaskReviewProvenTxs.js +99 -21
  95. package/out/src/monitor/tasks/TaskReviewProvenTxs.js.map +1 -1
  96. package/out/src/monitor/tasks/TaskReviewUtxos.d.ts +4 -4
  97. package/out/src/monitor/tasks/TaskReviewUtxos.d.ts.map +1 -1
  98. package/out/src/monitor/tasks/TaskReviewUtxos.js +41 -13
  99. package/out/src/monitor/tasks/TaskReviewUtxos.js.map +1 -1
  100. package/out/src/monitor/tasks/TaskSendWaiting.d.ts.map +1 -1
  101. package/out/src/monitor/tasks/TaskSendWaiting.js +52 -11
  102. package/out/src/monitor/tasks/TaskSendWaiting.js.map +1 -1
  103. package/out/src/monitor/tasks/TaskUnFail.d.ts +1 -0
  104. package/out/src/monitor/tasks/TaskUnFail.d.ts.map +1 -1
  105. package/out/src/monitor/tasks/TaskUnFail.js +26 -8
  106. package/out/src/monitor/tasks/TaskUnFail.js.map +1 -1
  107. package/out/src/sdk/PrivilegedKeyManager.d.ts.map +1 -1
  108. package/out/src/sdk/PrivilegedKeyManager.js +3 -2
  109. package/out/src/sdk/PrivilegedKeyManager.js.map +1 -1
  110. package/out/src/sdk/WalletErrorFromJson.d.ts.map +1 -1
  111. package/out/src/sdk/WalletErrorFromJson.js +112 -2
  112. package/out/src/sdk/WalletErrorFromJson.js.map +1 -1
  113. package/out/src/sdk/WalletServices.interfaces.d.ts +23 -1
  114. package/out/src/sdk/WalletServices.interfaces.d.ts.map +1 -1
  115. package/out/src/sdk/WalletStorage.interfaces.d.ts +49 -3
  116. package/out/src/sdk/WalletStorage.interfaces.d.ts.map +1 -1
  117. package/out/src/services/ServiceCollection.js +2 -2
  118. package/out/src/services/ServiceCollection.js.map +1 -1
  119. package/out/src/services/Services.d.ts +5 -0
  120. package/out/src/services/Services.d.ts.map +1 -1
  121. package/out/src/services/Services.js +276 -110
  122. package/out/src/services/Services.js.map +1 -1
  123. package/out/src/services/chaintracker/BHServiceClient.d.ts +21 -4
  124. package/out/src/services/chaintracker/BHServiceClient.d.ts.map +1 -1
  125. package/out/src/services/chaintracker/BHServiceClient.js +267 -66
  126. package/out/src/services/chaintracker/BHServiceClient.js.map +1 -1
  127. package/out/src/services/chaintracker/ChaintracksChainTracker.d.ts +25 -3
  128. package/out/src/services/chaintracker/ChaintracksChainTracker.d.ts.map +1 -1
  129. package/out/src/services/chaintracker/ChaintracksChainTracker.js +188 -53
  130. package/out/src/services/chaintracker/ChaintracksChainTracker.js.map +1 -1
  131. package/out/src/services/chaintracker/LocalChainTracker.d.ts +26 -0
  132. package/out/src/services/chaintracker/LocalChainTracker.d.ts.map +1 -1
  133. package/out/src/services/chaintracker/LocalChainTracker.js +180 -10
  134. package/out/src/services/chaintracker/LocalChainTracker.js.map +1 -1
  135. package/out/src/services/chaintracker/chaintracks/Api/BlockHeaderApi.d.ts.map +1 -1
  136. package/out/src/services/chaintracker/chaintracks/Api/BlockHeaderApi.js +59 -7
  137. package/out/src/services/chaintracker/chaintracks/Api/BlockHeaderApi.js.map +1 -1
  138. package/out/src/services/chaintracker/chaintracks/Api/ChaintracksApi.d.ts +6 -0
  139. package/out/src/services/chaintracker/chaintracks/Api/ChaintracksApi.d.ts.map +1 -1
  140. package/out/src/services/chaintracker/chaintracks/Api/ChaintracksClientApi.d.ts +7 -0
  141. package/out/src/services/chaintracker/chaintracks/Api/ChaintracksClientApi.d.ts.map +1 -1
  142. package/out/src/services/chaintracker/chaintracks/Api/ChaintracksFetchApi.d.ts +2 -0
  143. package/out/src/services/chaintracker/chaintracks/Api/ChaintracksFetchApi.d.ts.map +1 -1
  144. package/out/src/services/chaintracker/chaintracks/Api/ChaintracksStorageApi.d.ts +9 -0
  145. package/out/src/services/chaintracker/chaintracks/Api/ChaintracksStorageApi.d.ts.map +1 -1
  146. package/out/src/services/chaintracker/chaintracks/Chaintracks.d.ts +19 -0
  147. package/out/src/services/chaintracker/chaintracks/Chaintracks.d.ts.map +1 -1
  148. package/out/src/services/chaintracker/chaintracks/Chaintracks.js +237 -61
  149. package/out/src/services/chaintracker/chaintracks/Chaintracks.js.map +1 -1
  150. package/out/src/services/chaintracker/chaintracks/ChaintracksService.d.ts +16 -0
  151. package/out/src/services/chaintracker/chaintracks/ChaintracksService.d.ts.map +1 -1
  152. package/out/src/services/chaintracker/chaintracks/ChaintracksService.js +150 -26
  153. package/out/src/services/chaintracker/chaintracks/ChaintracksService.js.map +1 -1
  154. package/out/src/services/chaintracker/chaintracks/ChaintracksServiceClient.d.ts +30 -1
  155. package/out/src/services/chaintracker/chaintracks/ChaintracksServiceClient.d.ts.map +1 -1
  156. package/out/src/services/chaintracker/chaintracks/ChaintracksServiceClient.js +346 -30
  157. package/out/src/services/chaintracker/chaintracks/ChaintracksServiceClient.js.map +1 -1
  158. package/out/src/services/chaintracker/chaintracks/GoChaintracksServiceClient.d.ts +32 -1
  159. package/out/src/services/chaintracker/chaintracks/GoChaintracksServiceClient.d.ts.map +1 -1
  160. package/out/src/services/chaintracker/chaintracks/GoChaintracksServiceClient.js +375 -43
  161. package/out/src/services/chaintracker/chaintracks/GoChaintracksServiceClient.js.map +1 -1
  162. package/out/src/services/chaintracker/chaintracks/Ingest/BulkIngestorBase.d.ts.map +1 -1
  163. package/out/src/services/chaintracker/chaintracks/Ingest/BulkIngestorBase.js +28 -3
  164. package/out/src/services/chaintracker/chaintracks/Ingest/BulkIngestorBase.js.map +1 -1
  165. package/out/src/services/chaintracker/chaintracks/Ingest/BulkIngestorCDN.d.ts.map +1 -1
  166. package/out/src/services/chaintracker/chaintracks/Ingest/BulkIngestorCDN.js +33 -9
  167. package/out/src/services/chaintracker/chaintracks/Ingest/BulkIngestorCDN.js.map +1 -1
  168. package/out/src/services/chaintracker/chaintracks/Ingest/BulkIngestorCDNBabbage.d.ts.map +1 -1
  169. package/out/src/services/chaintracker/chaintracks/Ingest/BulkIngestorCDNBabbage.js.map +1 -1
  170. package/out/src/services/chaintracker/chaintracks/Ingest/BulkIngestorChaintracks.d.ts.map +1 -1
  171. package/out/src/services/chaintracker/chaintracks/Ingest/BulkIngestorChaintracks.js +4 -2
  172. package/out/src/services/chaintracker/chaintracks/Ingest/BulkIngestorChaintracks.js.map +1 -1
  173. package/out/src/services/chaintracker/chaintracks/Ingest/BulkIngestorWhatsOnChainCdn.d.ts +2 -0
  174. package/out/src/services/chaintracker/chaintracks/Ingest/BulkIngestorWhatsOnChainCdn.d.ts.map +1 -1
  175. package/out/src/services/chaintracker/chaintracks/Ingest/BulkIngestorWhatsOnChainCdn.js +17 -4
  176. package/out/src/services/chaintracker/chaintracks/Ingest/BulkIngestorWhatsOnChainCdn.js.map +1 -1
  177. package/out/src/services/chaintracker/chaintracks/Ingest/BulkIngestorWhatsOnChainWs.d.ts +2 -0
  178. package/out/src/services/chaintracker/chaintracks/Ingest/BulkIngestorWhatsOnChainWs.d.ts.map +1 -1
  179. package/out/src/services/chaintracker/chaintracks/Ingest/BulkIngestorWhatsOnChainWs.js +40 -20
  180. package/out/src/services/chaintracker/chaintracks/Ingest/BulkIngestorWhatsOnChainWs.js.map +1 -1
  181. package/out/src/services/chaintracker/chaintracks/Ingest/LiveIngestorBase.d.ts.map +1 -1
  182. package/out/src/services/chaintracker/chaintracks/Ingest/LiveIngestorBase.js +14 -0
  183. package/out/src/services/chaintracker/chaintracks/Ingest/LiveIngestorBase.js.map +1 -1
  184. package/out/src/services/chaintracker/chaintracks/Ingest/LiveIngestorChaintracksSSE.d.ts +6 -0
  185. package/out/src/services/chaintracker/chaintracks/Ingest/LiveIngestorChaintracksSSE.d.ts.map +1 -1
  186. package/out/src/services/chaintracker/chaintracks/Ingest/LiveIngestorChaintracksSSE.js +56 -9
  187. package/out/src/services/chaintracker/chaintracks/Ingest/LiveIngestorChaintracksSSE.js.map +1 -1
  188. package/out/src/services/chaintracker/chaintracks/Ingest/LiveIngestorTeranodeP2P.d.ts.map +1 -1
  189. package/out/src/services/chaintracker/chaintracks/Ingest/LiveIngestorTeranodeP2P.js +6 -3
  190. package/out/src/services/chaintracker/chaintracks/Ingest/LiveIngestorTeranodeP2P.js.map +1 -1
  191. package/out/src/services/chaintracker/chaintracks/Ingest/LiveIngestorWhatsOnChainPoll.d.ts +4 -0
  192. package/out/src/services/chaintracker/chaintracks/Ingest/LiveIngestorWhatsOnChainPoll.d.ts.map +1 -1
  193. package/out/src/services/chaintracker/chaintracks/Ingest/LiveIngestorWhatsOnChainPoll.js +27 -9
  194. package/out/src/services/chaintracker/chaintracks/Ingest/LiveIngestorWhatsOnChainPoll.js.map +1 -1
  195. package/out/src/services/chaintracker/chaintracks/Ingest/LiveIngestorWhatsOnChainWs.d.ts +8 -0
  196. package/out/src/services/chaintracker/chaintracks/Ingest/LiveIngestorWhatsOnChainWs.d.ts.map +1 -1
  197. package/out/src/services/chaintracker/chaintracks/Ingest/LiveIngestorWhatsOnChainWs.js +49 -5
  198. package/out/src/services/chaintracker/chaintracks/Ingest/LiveIngestorWhatsOnChainWs.js.map +1 -1
  199. package/out/src/services/chaintracker/chaintracks/Ingest/WhatsOnChainIngestorWs.d.ts +1 -1
  200. package/out/src/services/chaintracker/chaintracks/Ingest/WhatsOnChainIngestorWs.d.ts.map +1 -1
  201. package/out/src/services/chaintracker/chaintracks/Ingest/WhatsOnChainIngestorWs.js +90 -21
  202. package/out/src/services/chaintracker/chaintracks/Ingest/WhatsOnChainIngestorWs.js.map +1 -1
  203. package/out/src/services/chaintracker/chaintracks/Ingest/WhatsOnChainServices.d.ts +3 -1
  204. package/out/src/services/chaintracker/chaintracks/Ingest/WhatsOnChainServices.d.ts.map +1 -1
  205. package/out/src/services/chaintracker/chaintracks/Ingest/WhatsOnChainServices.js +185 -38
  206. package/out/src/services/chaintracker/chaintracks/Ingest/WhatsOnChainServices.js.map +1 -1
  207. package/out/src/services/chaintracker/chaintracks/Storage/BulkStorageBase.d.ts.map +1 -1
  208. package/out/src/services/chaintracker/chaintracks/Storage/BulkStorageBase.js +59 -6
  209. package/out/src/services/chaintracker/chaintracks/Storage/BulkStorageBase.js.map +1 -1
  210. package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksKnexMigrations.d.ts +2 -0
  211. package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksKnexMigrations.d.ts.map +1 -1
  212. package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksKnexMigrations.js +89 -39
  213. package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksKnexMigrations.js.map +1 -1
  214. package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageBase.d.ts +10 -0
  215. package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageBase.d.ts.map +1 -1
  216. package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageBase.js +225 -24
  217. package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageBase.js.map +1 -1
  218. package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageIdb.d.ts +2 -1
  219. package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageIdb.d.ts.map +1 -1
  220. package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageIdb.js +265 -96
  221. package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageIdb.js.map +1 -1
  222. package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageKnex.d.ts +3 -0
  223. package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageKnex.d.ts.map +1 -1
  224. package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageKnex.js +225 -86
  225. package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageKnex.js.map +1 -1
  226. package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageNoDb.d.ts +3 -0
  227. package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageNoDb.d.ts.map +1 -1
  228. package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageNoDb.js +121 -35
  229. package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageNoDb.js.map +1 -1
  230. package/out/src/services/chaintracker/chaintracks/configureChaintracksIngestors.js +2 -2
  231. package/out/src/services/chaintracker/chaintracks/configureChaintracksIngestors.js.map +1 -1
  232. package/out/src/services/chaintracker/chaintracks/createDefaultIdbChaintracksOptions.d.ts.map +1 -1
  233. package/out/src/services/chaintracker/chaintracks/createDefaultIdbChaintracksOptions.js.map +1 -1
  234. package/out/src/services/chaintracker/chaintracks/createDefaultKnexChaintracksOptions.d.ts.map +1 -1
  235. package/out/src/services/chaintracker/chaintracks/createDefaultKnexChaintracksOptions.js.map +1 -1
  236. package/out/src/services/chaintracker/chaintracks/createDefaultNoDbChaintracksOptions.d.ts.map +1 -1
  237. package/out/src/services/chaintracker/chaintracks/createDefaultNoDbChaintracksOptions.js.map +1 -1
  238. package/out/src/services/chaintracker/chaintracks/createIdbChaintracks.d.ts.map +1 -1
  239. package/out/src/services/chaintracker/chaintracks/createIdbChaintracks.js +1 -7
  240. package/out/src/services/chaintracker/chaintracks/createIdbChaintracks.js.map +1 -1
  241. package/out/src/services/chaintracker/chaintracks/createKnexChaintracks.d.ts.map +1 -1
  242. package/out/src/services/chaintracker/chaintracks/createKnexChaintracks.js +1 -7
  243. package/out/src/services/chaintracker/chaintracks/createKnexChaintracks.js.map +1 -1
  244. package/out/src/services/chaintracker/chaintracks/createNoDbChaintracks.d.ts.map +1 -1
  245. package/out/src/services/chaintracker/chaintracks/createNoDbChaintracks.js +1 -7
  246. package/out/src/services/chaintracker/chaintracks/createNoDbChaintracks.js.map +1 -1
  247. package/out/src/services/chaintracker/chaintracks/util/BulkFileDataCacheFs.d.ts +18 -0
  248. package/out/src/services/chaintracker/chaintracks/util/BulkFileDataCacheFs.d.ts.map +1 -1
  249. package/out/src/services/chaintracker/chaintracks/util/BulkFileDataCacheFs.js +204 -14
  250. package/out/src/services/chaintracker/chaintracks/util/BulkFileDataCacheFs.js.map +1 -1
  251. package/out/src/services/chaintracker/chaintracks/util/BulkFileDataManager.d.ts +6 -1
  252. package/out/src/services/chaintracker/chaintracks/util/BulkFileDataManager.d.ts.map +1 -1
  253. package/out/src/services/chaintracker/chaintracks/util/BulkFileDataManager.js +486 -82
  254. package/out/src/services/chaintracker/chaintracks/util/BulkFileDataManager.js.map +1 -1
  255. package/out/src/services/chaintracker/chaintracks/util/BulkFileDataReader.d.ts.map +1 -1
  256. package/out/src/services/chaintracker/chaintracks/util/BulkFileDataReader.js +17 -1
  257. package/out/src/services/chaintracker/chaintracks/util/BulkFileDataReader.js.map +1 -1
  258. package/out/src/services/chaintracker/chaintracks/util/BulkFileDataValidator.worker.d.ts.map +1 -1
  259. package/out/src/services/chaintracker/chaintracks/util/BulkFileDataValidator.worker.js +12 -2
  260. package/out/src/services/chaintracker/chaintracks/util/BulkFileDataValidator.worker.js.map +1 -1
  261. package/out/src/services/chaintracker/chaintracks/util/BulkFilesReader.d.ts.map +1 -1
  262. package/out/src/services/chaintracker/chaintracks/util/BulkFilesReader.js +99 -30
  263. package/out/src/services/chaintracker/chaintracks/util/BulkFilesReader.js.map +1 -1
  264. package/out/src/services/chaintracker/chaintracks/util/BulkHeaderFile.d.ts +1 -0
  265. package/out/src/services/chaintracker/chaintracks/util/BulkHeaderFile.d.ts.map +1 -1
  266. package/out/src/services/chaintracker/chaintracks/util/BulkHeaderFile.js +23 -15
  267. package/out/src/services/chaintracker/chaintracks/util/BulkHeaderFile.js.map +1 -1
  268. package/out/src/services/chaintracker/chaintracks/util/ChaintracksFetch.d.ts +7 -0
  269. package/out/src/services/chaintracker/chaintracks/util/ChaintracksFetch.d.ts.map +1 -1
  270. package/out/src/services/chaintracker/chaintracks/util/ChaintracksFetch.js +90 -24
  271. package/out/src/services/chaintracker/chaintracks/util/ChaintracksFetch.js.map +1 -1
  272. package/out/src/services/chaintracker/chaintracks/util/ChaintracksFs.d.ts +2 -1
  273. package/out/src/services/chaintracker/chaintracks/util/ChaintracksFs.d.ts.map +1 -1
  274. package/out/src/services/chaintracker/chaintracks/util/ChaintracksFs.js +57 -11
  275. package/out/src/services/chaintracker/chaintracks/util/ChaintracksFs.js.map +1 -1
  276. package/out/src/services/chaintracker/chaintracks/util/DurableFileBulkFileDownloadBudget.d.ts +9 -0
  277. package/out/src/services/chaintracker/chaintracks/util/DurableFileBulkFileDownloadBudget.d.ts.map +1 -1
  278. package/out/src/services/chaintracker/chaintracks/util/DurableFileBulkFileDownloadBudget.js +100 -14
  279. package/out/src/services/chaintracker/chaintracks/util/DurableFileBulkFileDownloadBudget.js.map +1 -1
  280. package/out/src/services/chaintracker/chaintracks/util/HeightRange.d.ts.map +1 -1
  281. package/out/src/services/chaintracker/chaintracks/util/HeightRange.js.map +1 -1
  282. package/out/src/services/chaintracker/chaintracks/util/InlineBulkFileDataValidator.d.ts +2 -0
  283. package/out/src/services/chaintracker/chaintracks/util/InlineBulkFileDataValidator.d.ts.map +1 -1
  284. package/out/src/services/chaintracker/chaintracks/util/InlineBulkFileDataValidator.js +104 -8
  285. package/out/src/services/chaintracker/chaintracks/util/InlineBulkFileDataValidator.js.map +1 -1
  286. package/out/src/services/chaintracker/chaintracks/util/NodeBulkFileDataValidator.d.ts +1 -0
  287. package/out/src/services/chaintracker/chaintracks/util/NodeBulkFileDataValidator.d.ts.map +1 -1
  288. package/out/src/services/chaintracker/chaintracks/util/NodeBulkFileDataValidator.js +79 -15
  289. package/out/src/services/chaintracker/chaintracks/util/NodeBulkFileDataValidator.js.map +1 -1
  290. package/out/src/services/chaintracker/chaintracks/util/SingleWriterMultiReaderLock.d.ts +3 -0
  291. package/out/src/services/chaintracker/chaintracks/util/SingleWriterMultiReaderLock.d.ts.map +1 -1
  292. package/out/src/services/chaintracker/chaintracks/util/SingleWriterMultiReaderLock.js +15 -0
  293. package/out/src/services/chaintracker/chaintracks/util/SingleWriterMultiReaderLock.js.map +1 -1
  294. package/out/src/services/chaintracker/chaintracks/util/blockHeaderUtilities.d.ts +6 -1
  295. package/out/src/services/chaintracker/chaintracks/util/blockHeaderUtilities.d.ts.map +1 -1
  296. package/out/src/services/chaintracker/chaintracks/util/blockHeaderUtilities.js +311 -93
  297. package/out/src/services/chaintracker/chaintracks/util/blockHeaderUtilities.js.map +1 -1
  298. package/out/src/services/chaintracker/chaintracks/util/safeDiagnostic.d.ts +4 -0
  299. package/out/src/services/chaintracker/chaintracks/util/safeDiagnostic.d.ts.map +1 -0
  300. package/out/src/services/chaintracker/chaintracks/util/safeDiagnostic.js +33 -0
  301. package/out/src/services/chaintracker/chaintracks/util/safeDiagnostic.js.map +1 -0
  302. package/out/src/services/chaintracker/chaintracks/util/validBulkHeaderFilesByFileHash.d.ts.map +1 -1
  303. package/out/src/services/chaintracker/chaintracks/util/validBulkHeaderFilesByFileHash.js.map +1 -1
  304. package/out/src/services/classifyOutputUtxo.d.ts.map +1 -1
  305. package/out/src/services/classifyOutputUtxo.js +19 -10
  306. package/out/src/services/classifyOutputUtxo.js.map +1 -1
  307. package/out/src/services/fiatRateValidation.d.ts +12 -0
  308. package/out/src/services/fiatRateValidation.d.ts.map +1 -0
  309. package/out/src/services/fiatRateValidation.js +138 -0
  310. package/out/src/services/fiatRateValidation.js.map +1 -0
  311. package/out/src/services/getCanonicalMerklePath.d.ts +15 -0
  312. package/out/src/services/getCanonicalMerklePath.d.ts.map +1 -0
  313. package/out/src/services/getCanonicalMerklePath.js +90 -0
  314. package/out/src/services/getCanonicalMerklePath.js.map +1 -0
  315. package/out/src/services/providers/ARC.d.ts +3 -16
  316. package/out/src/services/providers/ARC.d.ts.map +1 -1
  317. package/out/src/services/providers/ARC.js +36 -37
  318. package/out/src/services/providers/ARC.js.map +1 -1
  319. package/out/src/services/providers/ArcSSEClient.d.ts +25 -19
  320. package/out/src/services/providers/ArcSSEClient.d.ts.map +1 -1
  321. package/out/src/services/providers/ArcSSEClient.js +352 -85
  322. package/out/src/services/providers/ArcSSEClient.js.map +1 -1
  323. package/out/src/services/providers/Arcade.d.ts +1 -0
  324. package/out/src/services/providers/Arcade.d.ts.map +1 -1
  325. package/out/src/services/providers/Arcade.js +56 -41
  326. package/out/src/services/providers/Arcade.js.map +1 -1
  327. package/out/src/services/providers/Bitails.d.ts +3 -0
  328. package/out/src/services/providers/Bitails.d.ts.map +1 -1
  329. package/out/src/services/providers/Bitails.js +79 -12
  330. package/out/src/services/providers/Bitails.js.map +1 -1
  331. package/out/src/services/providers/SdkWhatsOnChain.d.ts +8 -2
  332. package/out/src/services/providers/SdkWhatsOnChain.d.ts.map +1 -1
  333. package/out/src/services/providers/SdkWhatsOnChain.js +83 -10
  334. package/out/src/services/providers/SdkWhatsOnChain.js.map +1 -1
  335. package/out/src/services/providers/WhatsOnChain.d.ts +3 -0
  336. package/out/src/services/providers/WhatsOnChain.d.ts.map +1 -1
  337. package/out/src/services/providers/WhatsOnChain.js +221 -69
  338. package/out/src/services/providers/WhatsOnChain.js.map +1 -1
  339. package/out/src/services/providers/arcProviderConfig.d.ts +27 -0
  340. package/out/src/services/providers/arcProviderConfig.d.ts.map +1 -0
  341. package/out/src/services/providers/arcProviderConfig.js +83 -0
  342. package/out/src/services/providers/arcProviderConfig.js.map +1 -0
  343. package/out/src/services/providers/arcTxDataValidation.d.ts +4 -0
  344. package/out/src/services/providers/arcTxDataValidation.d.ts.map +1 -0
  345. package/out/src/services/providers/arcTxDataValidation.js +92 -0
  346. package/out/src/services/providers/arcTxDataValidation.js.map +1 -0
  347. package/out/src/services/providers/exchangeRates.d.ts +3 -3
  348. package/out/src/services/providers/exchangeRates.d.ts.map +1 -1
  349. package/out/src/services/providers/exchangeRates.js +153 -226
  350. package/out/src/services/providers/exchangeRates.js.map +1 -1
  351. package/out/src/services/providers/getBeefForTxid.d.ts.map +1 -1
  352. package/out/src/services/providers/getBeefForTxid.js.map +1 -1
  353. package/out/src/services/providers/whatsOnChainHelpers.d.ts +2 -2
  354. package/out/src/services/providers/whatsOnChainHelpers.d.ts.map +1 -1
  355. package/out/src/services/providers/whatsOnChainHelpers.js +11 -8
  356. package/out/src/services/providers/whatsOnChainHelpers.js.map +1 -1
  357. package/out/src/services/validateMerklePathResult.d.ts +30 -0
  358. package/out/src/services/validateMerklePathResult.d.ts.map +1 -0
  359. package/out/src/services/validateMerklePathResult.js +272 -0
  360. package/out/src/services/validateMerklePathResult.js.map +1 -0
  361. package/out/src/services/validatePostBeefResult.d.ts +17 -0
  362. package/out/src/services/validatePostBeefResult.d.ts.map +1 -0
  363. package/out/src/services/validatePostBeefResult.js +334 -0
  364. package/out/src/services/validatePostBeefResult.js.map +1 -0
  365. package/out/src/services/validateRawTxResult.d.ts +6 -0
  366. package/out/src/services/validateRawTxResult.d.ts.map +1 -0
  367. package/out/src/services/validateRawTxResult.js +77 -0
  368. package/out/src/services/validateRawTxResult.js.map +1 -0
  369. package/out/src/services/validateScriptHashHistoryResult.d.ts +5 -0
  370. package/out/src/services/validateScriptHashHistoryResult.d.ts.map +1 -0
  371. package/out/src/services/validateScriptHashHistoryResult.js +99 -0
  372. package/out/src/services/validateScriptHashHistoryResult.js.map +1 -0
  373. package/out/src/services/validateStatusForTxidsResult.d.ts +8 -0
  374. package/out/src/services/validateStatusForTxidsResult.d.ts.map +1 -0
  375. package/out/src/services/validateStatusForTxidsResult.js +181 -0
  376. package/out/src/services/validateStatusForTxidsResult.js.map +1 -0
  377. package/out/src/services/validateUtxoStatusResult.d.ts +6 -0
  378. package/out/src/services/validateUtxoStatusResult.d.ts.map +1 -0
  379. package/out/src/services/validateUtxoStatusResult.js +126 -0
  380. package/out/src/services/validateUtxoStatusResult.js.map +1 -0
  381. package/out/src/signer/actionBatch/ActionBatchPlanner.d.ts +3 -2
  382. package/out/src/signer/actionBatch/ActionBatchPlanner.d.ts.map +1 -1
  383. package/out/src/signer/actionBatch/ActionBatchPlanner.js +4 -3
  384. package/out/src/signer/actionBatch/ActionBatchPlanner.js.map +1 -1
  385. package/out/src/signer/actionBatch/ActionBatchWorkspace.d.ts +6 -5
  386. package/out/src/signer/actionBatch/ActionBatchWorkspace.d.ts.map +1 -1
  387. package/out/src/signer/actionBatch/ActionBatchWorkspace.js +70 -76
  388. package/out/src/signer/actionBatch/ActionBatchWorkspace.js.map +1 -1
  389. package/out/src/signer/actionBatch/actionBatchBootstrap.d.ts +2 -2
  390. package/out/src/signer/actionBatch/actionBatchBootstrap.d.ts.map +1 -1
  391. package/out/src/signer/actionBatch/actionBatchBootstrap.js +3 -3
  392. package/out/src/signer/actionBatch/actionBatchBootstrap.js.map +1 -1
  393. package/out/src/signer/methods/acquireDirectCertificate.d.ts +3 -2
  394. package/out/src/signer/methods/acquireDirectCertificate.d.ts.map +1 -1
  395. package/out/src/signer/methods/acquireDirectCertificate.js.map +1 -1
  396. package/out/src/signer/methods/buildSignableTransaction.d.ts +6 -5
  397. package/out/src/signer/methods/buildSignableTransaction.d.ts.map +1 -1
  398. package/out/src/signer/methods/buildSignableTransaction.js +6 -11
  399. package/out/src/signer/methods/buildSignableTransaction.js.map +1 -1
  400. package/out/src/signer/methods/createAction.d.ts +4 -3
  401. package/out/src/signer/methods/createAction.d.ts.map +1 -1
  402. package/out/src/signer/methods/createAction.js +4 -2
  403. package/out/src/signer/methods/createAction.js.map +1 -1
  404. package/out/src/signer/methods/createNoSendExpiryAction.d.ts +3 -3
  405. package/out/src/signer/methods/createNoSendExpiryAction.d.ts.map +1 -1
  406. package/out/src/signer/methods/createNoSendExpiryAction.js +9 -4
  407. package/out/src/signer/methods/createNoSendExpiryAction.js.map +1 -1
  408. package/out/src/signer/methods/internalizeAction.d.ts.map +1 -1
  409. package/out/src/signer/methods/internalizeAction.js +2 -2
  410. package/out/src/signer/methods/internalizeAction.js.map +1 -1
  411. package/out/src/signer/methods/proveCertificate.d.ts +3 -2
  412. package/out/src/signer/methods/proveCertificate.d.ts.map +1 -1
  413. package/out/src/signer/methods/proveCertificate.js.map +1 -1
  414. package/out/src/signer/methods/signAction.d.ts.map +1 -1
  415. package/out/src/signer/methods/signAction.js +3 -2
  416. package/out/src/signer/methods/signAction.js.map +1 -1
  417. package/out/src/signer/methods/verifyUnlockScripts.d.ts.map +1 -1
  418. package/out/src/signer/methods/verifyUnlockScripts.js +12 -17
  419. package/out/src/signer/methods/verifyUnlockScripts.js.map +1 -1
  420. package/out/src/storage/StorageIdb.d.ts +6 -3
  421. package/out/src/storage/StorageIdb.d.ts.map +1 -1
  422. package/out/src/storage/StorageIdb.js +70 -42
  423. package/out/src/storage/StorageIdb.js.map +1 -1
  424. package/out/src/storage/StorageKnex.d.ts +8 -4
  425. package/out/src/storage/StorageKnex.d.ts.map +1 -1
  426. package/out/src/storage/StorageKnex.js +185 -92
  427. package/out/src/storage/StorageKnex.js.map +1 -1
  428. package/out/src/storage/StorageProvider.d.ts +19 -9
  429. package/out/src/storage/StorageProvider.d.ts.map +1 -1
  430. package/out/src/storage/StorageProvider.js +237 -138
  431. package/out/src/storage/StorageProvider.js.map +1 -1
  432. package/out/src/storage/StorageReader.d.ts +7 -1
  433. package/out/src/storage/StorageReader.d.ts.map +1 -1
  434. package/out/src/storage/StorageReader.js +17 -42
  435. package/out/src/storage/StorageReader.js.map +1 -1
  436. package/out/src/storage/StorageReaderWriter.d.ts +2 -0
  437. package/out/src/storage/StorageReaderWriter.d.ts.map +1 -1
  438. package/out/src/storage/StorageReaderWriter.js +63 -38
  439. package/out/src/storage/StorageReaderWriter.js.map +1 -1
  440. package/out/src/storage/StorageSyncReader.d.ts +1 -1
  441. package/out/src/storage/StorageSyncReader.d.ts.map +1 -1
  442. package/out/src/storage/StorageSyncReader.js +3 -36
  443. package/out/src/storage/StorageSyncReader.js.map +1 -1
  444. package/out/src/storage/WalletStorageManager.d.ts +9 -7
  445. package/out/src/storage/WalletStorageManager.d.ts.map +1 -1
  446. package/out/src/storage/WalletStorageManager.js +71 -65
  447. package/out/src/storage/WalletStorageManager.js.map +1 -1
  448. package/out/src/storage/adminServer/adminServer.d.ts +1 -1
  449. package/out/src/storage/adminServer/adminServer.d.ts.map +1 -1
  450. package/out/src/storage/adminServer/adminServer.js +16 -44
  451. package/out/src/storage/adminServer/adminServer.js.map +1 -1
  452. package/out/src/storage/methods/ListActionsSpecOp.d.ts +2 -2
  453. package/out/src/storage/methods/ListActionsSpecOp.d.ts.map +1 -1
  454. package/out/src/storage/methods/ListActionsSpecOp.js.map +1 -1
  455. package/out/src/storage/methods/ListOutputsSpecOp.d.ts +7 -4
  456. package/out/src/storage/methods/ListOutputsSpecOp.d.ts.map +1 -1
  457. package/out/src/storage/methods/ListOutputsSpecOp.js +1 -0
  458. package/out/src/storage/methods/ListOutputsSpecOp.js.map +1 -1
  459. package/out/src/storage/methods/actionBatch.d.ts.map +1 -1
  460. package/out/src/storage/methods/actionBatch.js +3 -2
  461. package/out/src/storage/methods/actionBatch.js.map +1 -1
  462. package/out/src/storage/methods/actionBatchBlobs.d.ts +2 -0
  463. package/out/src/storage/methods/actionBatchBlobs.d.ts.map +1 -1
  464. package/out/src/storage/methods/actionBatchBlobs.js +40 -22
  465. package/out/src/storage/methods/actionBatchBlobs.js.map +1 -1
  466. package/out/src/storage/methods/actionBatchValidation.d.ts.map +1 -1
  467. package/out/src/storage/methods/actionBatchValidation.js +22 -30
  468. package/out/src/storage/methods/actionBatchValidation.js.map +1 -1
  469. package/out/src/storage/methods/attemptToPostReqsToNetwork.d.ts +7 -2
  470. package/out/src/storage/methods/attemptToPostReqsToNetwork.d.ts.map +1 -1
  471. package/out/src/storage/methods/attemptToPostReqsToNetwork.js +57 -44
  472. package/out/src/storage/methods/attemptToPostReqsToNetwork.js.map +1 -1
  473. package/out/src/storage/methods/createAction.d.ts +7 -6
  474. package/out/src/storage/methods/createAction.d.ts.map +1 -1
  475. package/out/src/storage/methods/createAction.js +7 -5
  476. package/out/src/storage/methods/createAction.js.map +1 -1
  477. package/out/src/storage/methods/generateChange.d.ts.map +1 -1
  478. package/out/src/storage/methods/generateChange.js +12 -11
  479. package/out/src/storage/methods/generateChange.js.map +1 -1
  480. package/out/src/storage/methods/getBeefForTransaction.js +5 -7
  481. package/out/src/storage/methods/getBeefForTransaction.js.map +1 -1
  482. package/out/src/storage/methods/getSyncChunk.d.ts.map +1 -1
  483. package/out/src/storage/methods/getSyncChunk.js +42 -11
  484. package/out/src/storage/methods/getSyncChunk.js.map +1 -1
  485. package/out/src/storage/methods/internalizeAction.d.ts +3 -3
  486. package/out/src/storage/methods/internalizeAction.d.ts.map +1 -1
  487. package/out/src/storage/methods/internalizeAction.js +134 -129
  488. package/out/src/storage/methods/internalizeAction.js.map +1 -1
  489. package/out/src/storage/methods/listActionsIdb.d.ts +3 -2
  490. package/out/src/storage/methods/listActionsIdb.d.ts.map +1 -1
  491. package/out/src/storage/methods/listActionsIdb.js +2 -2
  492. package/out/src/storage/methods/listActionsIdb.js.map +1 -1
  493. package/out/src/storage/methods/listActionsKnex.d.ts +3 -2
  494. package/out/src/storage/methods/listActionsKnex.d.ts.map +1 -1
  495. package/out/src/storage/methods/listActionsKnex.js +10 -9
  496. package/out/src/storage/methods/listActionsKnex.js.map +1 -1
  497. package/out/src/storage/methods/listCertificates.d.ts +3 -2
  498. package/out/src/storage/methods/listCertificates.d.ts.map +1 -1
  499. package/out/src/storage/methods/listCertificates.js.map +1 -1
  500. package/out/src/storage/methods/listOutputsIdb.d.ts +3 -2
  501. package/out/src/storage/methods/listOutputsIdb.d.ts.map +1 -1
  502. package/out/src/storage/methods/listOutputsIdb.js +11 -11
  503. package/out/src/storage/methods/listOutputsIdb.js.map +1 -1
  504. package/out/src/storage/methods/listOutputsKnex.d.ts +3 -2
  505. package/out/src/storage/methods/listOutputsKnex.d.ts.map +1 -1
  506. package/out/src/storage/methods/listOutputsKnex.js +15 -23
  507. package/out/src/storage/methods/listOutputsKnex.js.map +1 -1
  508. package/out/src/storage/methods/noSendExpiry.d.ts +3 -3
  509. package/out/src/storage/methods/noSendExpiry.d.ts.map +1 -1
  510. package/out/src/storage/methods/noSendExpiry.js +10 -8
  511. package/out/src/storage/methods/noSendExpiry.js.map +1 -1
  512. package/out/src/storage/methods/preparedBeef.d.ts.map +1 -1
  513. package/out/src/storage/methods/preparedBeef.js +13 -14
  514. package/out/src/storage/methods/preparedBeef.js.map +1 -1
  515. package/out/src/storage/methods/processAction.d.ts.map +1 -1
  516. package/out/src/storage/methods/processAction.js +37 -6
  517. package/out/src/storage/methods/processAction.js.map +1 -1
  518. package/out/src/storage/methods/reconcileFailedTransactionInputs.d.ts +1 -1
  519. package/out/src/storage/methods/reconcileFailedTransactionInputs.d.ts.map +1 -1
  520. package/out/src/storage/methods/reconcileFailedTransactionInputs.js.map +1 -1
  521. package/out/src/storage/methods/reviewStatusIdb.d.ts +1 -1
  522. package/out/src/storage/methods/reviewStatusIdb.d.ts.map +1 -1
  523. package/out/src/storage/methods/reviewStatusIdb.js.map +1 -1
  524. package/out/src/storage/methods/reviewUtxoOutputs.d.ts +1 -0
  525. package/out/src/storage/methods/reviewUtxoOutputs.d.ts.map +1 -1
  526. package/out/src/storage/methods/reviewUtxoOutputs.js +51 -4
  527. package/out/src/storage/methods/reviewUtxoOutputs.js.map +1 -1
  528. package/out/src/storage/methods/validateSyncProof.d.ts +10 -2
  529. package/out/src/storage/methods/validateSyncProof.d.ts.map +1 -1
  530. package/out/src/storage/methods/validateSyncProof.js +27 -4
  531. package/out/src/storage/methods/validateSyncProof.js.map +1 -1
  532. package/out/src/storage/portable/index.d.ts.map +1 -1
  533. package/out/src/storage/portable/index.js +21 -13
  534. package/out/src/storage/portable/index.js.map +1 -1
  535. package/out/src/storage/remoting/BinaryJson.d.ts +11 -0
  536. package/out/src/storage/remoting/BinaryJson.d.ts.map +1 -1
  537. package/out/src/storage/remoting/BinaryJson.js +94 -8
  538. package/out/src/storage/remoting/BinaryJson.js.map +1 -1
  539. package/out/src/storage/remoting/KnexSessionManager.d.ts +26 -2
  540. package/out/src/storage/remoting/KnexSessionManager.d.ts.map +1 -1
  541. package/out/src/storage/remoting/KnexSessionManager.js +222 -30
  542. package/out/src/storage/remoting/KnexSessionManager.js.map +1 -1
  543. package/out/src/storage/remoting/KnexSyncTransferStore.d.ts +26 -0
  544. package/out/src/storage/remoting/KnexSyncTransferStore.d.ts.map +1 -0
  545. package/out/src/storage/remoting/KnexSyncTransferStore.js +222 -0
  546. package/out/src/storage/remoting/KnexSyncTransferStore.js.map +1 -0
  547. package/out/src/storage/remoting/StorageClient.d.ts +6 -1
  548. package/out/src/storage/remoting/StorageClient.d.ts.map +1 -1
  549. package/out/src/storage/remoting/StorageClient.js +65 -8
  550. package/out/src/storage/remoting/StorageClient.js.map +1 -1
  551. package/out/src/storage/remoting/StorageClientBase.d.ts +53 -10
  552. package/out/src/storage/remoting/StorageClientBase.d.ts.map +1 -1
  553. package/out/src/storage/remoting/StorageClientBase.js +304 -9
  554. package/out/src/storage/remoting/StorageClientBase.js.map +1 -1
  555. package/out/src/storage/remoting/StorageMobile.d.ts +5 -0
  556. package/out/src/storage/remoting/StorageMobile.d.ts.map +1 -1
  557. package/out/src/storage/remoting/StorageMobile.js +13 -11
  558. package/out/src/storage/remoting/StorageMobile.js.map +1 -1
  559. package/out/src/storage/remoting/StorageServer.d.ts +10 -1
  560. package/out/src/storage/remoting/StorageServer.d.ts.map +1 -1
  561. package/out/src/storage/remoting/StorageServer.js +206 -21
  562. package/out/src/storage/remoting/StorageServer.js.map +1 -1
  563. package/out/src/storage/remoting/SyncTransfer.d.ts +29 -0
  564. package/out/src/storage/remoting/SyncTransfer.d.ts.map +1 -0
  565. package/out/src/storage/remoting/SyncTransfer.js +153 -0
  566. package/out/src/storage/remoting/SyncTransfer.js.map +1 -0
  567. package/out/src/storage/remoting/entityValidationHelpers.d.ts.map +1 -1
  568. package/out/src/storage/remoting/entityValidationHelpers.js +35 -0
  569. package/out/src/storage/remoting/entityValidationHelpers.js.map +1 -1
  570. package/out/src/storage/remoting/syncChunkBinary.d.ts +4 -0
  571. package/out/src/storage/remoting/syncChunkBinary.d.ts.map +1 -0
  572. package/out/src/storage/remoting/syncChunkBinary.js +38 -0
  573. package/out/src/storage/remoting/syncChunkBinary.js.map +1 -0
  574. package/out/src/storage/remoting/validateRpcSyncProofs.d.ts +5 -0
  575. package/out/src/storage/remoting/validateRpcSyncProofs.d.ts.map +1 -0
  576. package/out/src/storage/remoting/validateRpcSyncProofs.js +82 -0
  577. package/out/src/storage/remoting/validateRpcSyncProofs.js.map +1 -0
  578. package/out/src/storage/schema/KnexMigrations.d.ts +3 -0
  579. package/out/src/storage/schema/KnexMigrations.d.ts.map +1 -1
  580. package/out/src/storage/schema/KnexMigrations.js +89 -2
  581. package/out/src/storage/schema/KnexMigrations.js.map +1 -1
  582. package/out/src/storage/schema/StorageIdbSchema.d.ts +1 -0
  583. package/out/src/storage/schema/StorageIdbSchema.d.ts.map +1 -1
  584. package/out/src/storage/schema/entities/EntityOutput.d.ts.map +1 -1
  585. package/out/src/storage/schema/entities/EntityOutput.js +11 -4
  586. package/out/src/storage/schema/entities/EntityOutput.js.map +1 -1
  587. package/out/src/storage/schema/entities/EntityProvenTx.d.ts +2 -1
  588. package/out/src/storage/schema/entities/EntityProvenTx.d.ts.map +1 -1
  589. package/out/src/storage/schema/entities/EntityProvenTx.js +95 -41
  590. package/out/src/storage/schema/entities/EntityProvenTx.js.map +1 -1
  591. package/out/src/storage/schema/entities/EntityProvenTxReq.js +1 -1
  592. package/out/src/storage/schema/entities/EntityProvenTxReq.js.map +1 -1
  593. package/out/src/storage/schema/entities/EntitySyncState.d.ts +3 -1
  594. package/out/src/storage/schema/entities/EntitySyncState.d.ts.map +1 -1
  595. package/out/src/storage/schema/entities/EntitySyncState.js +7 -1
  596. package/out/src/storage/schema/entities/EntitySyncState.js.map +1 -1
  597. package/out/src/storage/schema/tables/TableCertificate.d.ts +1 -1
  598. package/out/src/storage/schema/tables/TableCertificate.d.ts.map +1 -1
  599. package/out/src/storage/schema/tables/TableCertificateField.d.ts +1 -1
  600. package/out/src/storage/schema/tables/TableCertificateField.d.ts.map +1 -1
  601. package/out/src/storage/schema/tables/TableCommission.d.ts +1 -1
  602. package/out/src/storage/schema/tables/TableCommission.d.ts.map +1 -1
  603. package/out/src/storage/schema/tables/TableMonitorEvent.d.ts +1 -1
  604. package/out/src/storage/schema/tables/TableMonitorEvent.d.ts.map +1 -1
  605. package/out/src/storage/schema/tables/TableOutput.d.ts +1 -1
  606. package/out/src/storage/schema/tables/TableOutput.d.ts.map +1 -1
  607. package/out/src/storage/schema/tables/TableOutputBasket.d.ts +1 -1
  608. package/out/src/storage/schema/tables/TableOutputBasket.d.ts.map +1 -1
  609. package/out/src/storage/schema/tables/TableOutputTag.d.ts +1 -1
  610. package/out/src/storage/schema/tables/TableOutputTag.d.ts.map +1 -1
  611. package/out/src/storage/schema/tables/TableOutputTagMap.d.ts +1 -1
  612. package/out/src/storage/schema/tables/TableOutputTagMap.d.ts.map +1 -1
  613. package/out/src/storage/schema/tables/TableProvenTx.d.ts +1 -1
  614. package/out/src/storage/schema/tables/TableProvenTx.d.ts.map +1 -1
  615. package/out/src/storage/schema/tables/TableProvenTxReq.d.ts +1 -1
  616. package/out/src/storage/schema/tables/TableProvenTxReq.d.ts.map +1 -1
  617. package/out/src/storage/schema/tables/TableSettings.d.ts +1 -1
  618. package/out/src/storage/schema/tables/TableSettings.d.ts.map +1 -1
  619. package/out/src/storage/schema/tables/TableSyncState.d.ts +1 -1
  620. package/out/src/storage/schema/tables/TableSyncState.d.ts.map +1 -1
  621. package/out/src/storage/schema/tables/TableTransaction.d.ts +1 -1
  622. package/out/src/storage/schema/tables/TableTransaction.d.ts.map +1 -1
  623. package/out/src/storage/schema/tables/TableTransaction.js.map +1 -1
  624. package/out/src/storage/schema/tables/TableTxLabel.d.ts +1 -1
  625. package/out/src/storage/schema/tables/TableTxLabel.d.ts.map +1 -1
  626. package/out/src/storage/schema/tables/TableTxLabelMap.d.ts +1 -1
  627. package/out/src/storage/schema/tables/TableTxLabelMap.d.ts.map +1 -1
  628. package/out/src/storage/schema/tables/TableUser.d.ts +1 -1
  629. package/out/src/storage/schema/tables/TableUser.d.ts.map +1 -1
  630. package/out/src/storage/sync/StorageMySQLDojoReader.d.ts.map +1 -1
  631. package/out/src/storage/sync/StorageMySQLDojoReader.js +8 -7
  632. package/out/src/storage/sync/StorageMySQLDojoReader.js.map +1 -1
  633. package/out/src/storage/sync/SyncPageBudget.d.ts +8 -0
  634. package/out/src/storage/sync/SyncPageBudget.d.ts.map +1 -0
  635. package/out/src/storage/sync/SyncPageBudget.js +24 -0
  636. package/out/src/storage/sync/SyncPageBudget.js.map +1 -0
  637. package/out/src/storage/sync/syncCheckpoint.d.ts +4 -0
  638. package/out/src/storage/sync/syncCheckpoint.d.ts.map +1 -0
  639. package/out/src/storage/sync/syncCheckpoint.js +49 -0
  640. package/out/src/storage/sync/syncCheckpoint.js.map +1 -0
  641. package/out/src/utility/actionBatchDigest.d.ts.map +1 -1
  642. package/out/src/utility/actionBatchDigest.js +9 -7
  643. package/out/src/utility/actionBatchDigest.js.map +1 -1
  644. package/out/src/utility/actionBatchPack.d.ts.map +1 -1
  645. package/out/src/utility/actionBatchPack.js +7 -12
  646. package/out/src/utility/actionBatchPack.js.map +1 -1
  647. package/out/src/utility/brc153ReferenceLabels.d.ts.map +1 -1
  648. package/out/src/utility/brc153ReferenceLabels.js +4 -4
  649. package/out/src/utility/brc153ReferenceLabels.js.map +1 -1
  650. package/out/src/utility/brc177NoSendExpiry.d.ts +2 -2
  651. package/out/src/utility/brc177NoSendExpiry.d.ts.map +1 -1
  652. package/out/src/utility/canonicalizeAtomicBeef.js +2 -2
  653. package/out/src/utility/canonicalizeAtomicBeef.js.map +1 -1
  654. package/out/src/utility/exactActionSpend.d.ts +11 -0
  655. package/out/src/utility/exactActionSpend.d.ts.map +1 -0
  656. package/out/src/utility/exactActionSpend.js +11 -0
  657. package/out/src/utility/exactActionSpend.js.map +1 -0
  658. package/out/src/utility/identityUtils.d.ts +44 -4
  659. package/out/src/utility/identityUtils.d.ts.map +1 -1
  660. package/out/src/utility/identityUtils.js +376 -61
  661. package/out/src/utility/identityUtils.js.map +1 -1
  662. package/out/src/utility/parseTxScriptOffsets.d.ts.map +1 -1
  663. package/out/src/utility/parseTxScriptOffsets.js +1 -19
  664. package/out/src/utility/parseTxScriptOffsets.js.map +1 -1
  665. package/out/src/utility/tscProofToMerklePath.d.ts.map +1 -1
  666. package/out/src/utility/tscProofToMerklePath.js +35 -4
  667. package/out/src/utility/tscProofToMerklePath.js.map +1 -1
  668. package/out/src/utility/utilityHelpers.d.ts.map +1 -1
  669. package/out/src/utility/utilityHelpers.js +8 -6
  670. package/out/src/utility/utilityHelpers.js.map +1 -1
  671. package/out/src/utility/utilityHelpers.noBuffer.d.ts.map +1 -1
  672. package/out/src/utility/utilityHelpers.noBuffer.js +6 -6
  673. package/out/src/utility/utilityHelpers.noBuffer.js.map +1 -1
  674. package/out/src/utility/verifyOverlayOutput.d.ts +12 -0
  675. package/out/src/utility/verifyOverlayOutput.d.ts.map +1 -0
  676. package/out/src/utility/verifyOverlayOutput.js +22 -0
  677. package/out/src/utility/verifyOverlayOutput.js.map +1 -0
  678. package/out/src/utility/walletResultGuards.d.ts +14 -0
  679. package/out/src/utility/walletResultGuards.d.ts.map +1 -0
  680. package/out/src/utility/walletResultGuards.js +28 -0
  681. package/out/src/utility/walletResultGuards.js.map +1 -0
  682. package/out/src/wab-client/WABClient.d.ts +3 -17
  683. package/out/src/wab-client/WABClient.d.ts.map +1 -1
  684. package/out/src/wab-client/WABClient.js +30 -14
  685. package/out/src/wab-client/WABClient.js.map +1 -1
  686. package/out/src/wab-client/WABResponseValidation.d.ts +48 -0
  687. package/out/src/wab-client/WABResponseValidation.d.ts.map +1 -0
  688. package/out/src/wab-client/WABResponseValidation.js +321 -0
  689. package/out/src/wab-client/WABResponseValidation.js.map +1 -0
  690. package/out/src/wab-client/auth-method-interactors/AuthMethodInteractor.d.ts.map +1 -1
  691. package/out/src/wab-client/auth-method-interactors/AuthMethodInteractor.js +3 -2
  692. package/out/src/wab-client/auth-method-interactors/AuthMethodInteractor.js.map +1 -1
  693. package/package.json +6 -5
package/README.md CHANGED
@@ -6,12 +6,109 @@
6
6
 
7
7
  A [BRC-100](https://github.com/bitcoin-sv/BRCs/blob/master/wallet/0100.md) conforming wallet implementation for the BSV blockchain, built on the [BSV SDK](https://bsv-blockchain.github.io/ts-stack/packages/sdk/). Provides persistent storage, protocol-based key derivation, transaction monitoring, chain tracking, and signing — everything needed to build wallet-powered applications on BSV.
8
8
 
9
+ ## Backup and sync: tested results
10
+
11
+ **Live E2E testing used a large wallet in the native desktop client**, covering
12
+ complete local copies, restart recovery, and repeat sync. Transfer size and oversized-record recovery were
13
+ measured separately with synthetic fixtures. The latest proof-recovery follow-up
14
+ has synthetic HTTP and read-only source-data validation; its live full-backup
15
+ retest is pending.
16
+
17
+ | Test | Verified result |
18
+ | ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
19
+ | Full native desktop restores | **Two complete copies; identical entity counts.** Second run: **12m 50s vs 16m 30s (22.3% less time)**. |
20
+ | Retained local backup | Completed after cancellation, a connectivity pause, and restart recovery; all **12 entity-store counts preserved** on another restart. |
21
+ | Local reads and repeat sync | Transaction/output reads passed; sampled transaction bytes matched; repeat sync made **0 inserts, 0 updates**. |
22
+ | Transfer size | **62.7% smaller** encoded byte payload in a synthetic fixture. |
23
+ | Oversized single record | **7 MiB restored in real browser IndexedDB**, matching SHA-256; interrupted upload resumed, corrupt download rejected, repeat sync unchanged. |
24
+ | Automated integration | Authenticated HTTP backup/restore, interrupted pages, lost acknowledgements, binary byte round-trips, user isolation, and legacy compatibility covered. |
25
+
26
+ Timing compares successive candidates, not a controlled comparison against upstream
27
+ `main`. Byte verification was sampled, not database-wide. See
28
+ [test methods and limits](#sync-performance-and-recovery) for details.
29
+
30
+ ### SQLite migration recovery
31
+
32
+ The unpublished 2.13.2 candidate runs SQLite migration DDL and the migration
33
+ journal update transactionally. Foreign-key enforcement is disabled before the
34
+ migration transaction for table rebuilds and restored after success or failure.
35
+ Failed migrations can be retried after reopening the database without partial
36
+ schema objects from that attempt. MySQL's existing transaction configuration
37
+ is unchanged.
38
+
39
+ This prevents future partial migrations. It does not automatically repair a
40
+ store already left with unjournaled schema objects by an older version. Preserve
41
+ the database and verified backups and reconcile the exact schema and migration
42
+ journal before recovery; do not delete journal rows or wallet data blindly.
43
+
9
44
  ## Overview
10
45
 
11
46
  The Wallet Toolbox is the reference implementation of the BRC-100 wallet interface. It connects the BSV SDK's cryptographic primitives to real storage backends, network services, and signing flows so that application developers don't have to wire these layers together themselves.
12
47
 
13
48
  BSV Desktop and BSV Browser are the BSV Association reference wallet applications built around this interface. Vendor distributions, including Babbage's Metanet Desktop / Metanet Explorer and Hudos Browser, can implement the same BRC-100 interface against their own product packaging and service defaults.
14
49
 
50
+ ### Local contact trust
51
+
52
+ Applications may install a `ContactSource` on `WalletArgs` to resolve identities from the user's
53
+ local contacts before querying the certificate overlay. Installing that source is an explicit
54
+ personal trust-policy decision: a saved contact is locally authoritative in the same sense as a
55
+ self-signed certificate or locally installed trust anchor. Its default infinite trust means “the
56
+ user's independent validation overrides third-party trust thresholds,” not “an external certifier
57
+ proved this identity.”
58
+
59
+ The authority is scoped to the wallet user who saved the identity-key association and to that
60
+ wallet's local labels and metadata. Authentication or encryption of the contact store proves that
61
+ the wallet retained the user's decision; it does not independently prove the real-world identity,
62
+ and the infinite-trust value must not be exported as a universal claim for other users.
63
+
64
+ Contact results retain the discovery result shape for compatibility, but default to type `contact`
65
+ and carry empty serial, signature, and revocation-outpoint fields. Consumers must not present those
66
+ fields as third-party certification. Connect `ContactSource` only to local, authenticated storage
67
+ whose records the user has deliberately saved or validated; never populate it directly from
68
+ unauthenticated network data. Pass `forceRefresh: true` to identity discovery when the application
69
+ specifically needs to bypass local contact authority and query the overlay.
70
+
71
+ ### Fiat exchange-rate trust boundary
72
+
73
+ Wallet Toolbox treats exchange-rate providers and custom service adapters as
74
+ untrusted financial inputs. Rates must use the supported currency codes, be
75
+ finite, positive, and bounded, use USD base with an exact USD rate of 1, and
76
+ carry a valid timestamp no more than five minutes in the future. Malformed or
77
+ missing requested rates are never merged into the wallet cache.
78
+
79
+ The default provider transport accepts only credential-free public HTTPS,
80
+ pins validated DNS answers in Node.js, rejects redirects and private/special
81
+ addresses, and enforces a 15-second deadline plus a 256 KiB response limit.
82
+ `fiatExchangeRatesFetch` is an explicitly trusted escape hatch for tests or
83
+ controlled local development; production applications should retain the
84
+ default transport.
85
+
86
+ ### ARC and Arcade provider configuration
87
+
88
+ ARC-compatible broadcaster configuration is snapshotted when the provider is
89
+ constructed. API keys, callback tokens, deployment IDs, callback URLs, and
90
+ custom headers therefore keep the exact reviewed values even if the caller
91
+ later mutates its configuration object. Custom headers must be a plain
92
+ accessor-free own-data map with valid HTTP token names and bounded string
93
+ values; inherited fields and getters are rejected without being used.
94
+
95
+ The provider URL and an injected `httpClient` remain explicit application or
96
+ operator trust decisions. Do not derive them from transaction, peer, or other
97
+ untrusted input. Reconstruct the provider to rotate credentials or headers;
98
+ mutating the original configuration object does not change a live provider.
99
+
100
+ ### Importing legacy P2PKH outputs
101
+
102
+ `Setup.fundWalletFromP2PKHOutpoints` and its client equivalent validate each
103
+ canonical outpoint, fetched transaction ID, P2PKH ownership script, atomic
104
+ signing target, and final wallet transaction before reporting success. Provider
105
+ downloads are deadline-bound, redirect-free, and size-bounded; recursive BEEF
106
+ construction also limits depth, graph size, aggregate source bytes, and the
107
+ number of requested outpoints. If an application already has authenticated
108
+ BEEF, pass it explicitly to avoid relying on public transaction-data services.
109
+ Do not accept a wallet result that omits the transaction bytes needed for this
110
+ binding.
111
+
15
112
  ### What's Inside
16
113
 
17
114
  | Module | Description |
@@ -31,6 +128,19 @@ broadcast, so permission approval does not inherit network-broadcast latency.
31
128
  The funding planner prefers settled change and uses queued permission ancestry
32
129
  only as a last resort, keeping the application path fast without hiding funds.
33
130
 
131
+ Permission-token basket membership and tags are discovery hints, not authority.
132
+ Before using a stored token, the manager binds it to its exact BEEF outpoint and
133
+ one-satoshi output, verifies the canonical PushDrop field signature and locally
134
+ derived locking key, strictly decodes every signed grant field, and rechecks the
135
+ requested filters against that signed content. Unsigned, foreign-wallet,
136
+ substituted, malformed, or mislabeled rows grant no permission. Token issuance,
137
+ renewal, coalescing, and revocation also bind every requested input and output to
138
+ the final wallet transaction; a partial-action reference never authorizes a
139
+ different transaction. When the underlying Wallet Toolbox signer adds a storage
140
+ service charge, its exact wallet-funded amount is carried locally into the
141
+ spending check so the charge is visible and counted in authorization. This
142
+ metadata is deliberately not a BRC-100 wire extension.
143
+
34
144
  Permission modules may transform calls with `onRequest` and `onResponse`, or
35
145
  own a P-scheme's semantics with the optional `handleRequest(request, next)`
36
146
  hook. A semantic handler can return the normal BRC-100 result directly; if it
@@ -46,6 +156,19 @@ serialized BEEF plus transaction bytes; queued ancestry is used only when it is
46
156
  necessary or smaller. Pending change is never withheld, so queued
47
157
  work cannot strand the balance behind a large reserved input.
48
158
 
159
+ `sendWith` transaction IDs form one atomic broadcast set: the wallet never
160
+ silently slices that set into separately submitted groups. A set is limited to
161
+ 1,000 unique transactions, including a transaction created or signed by the
162
+ current call. Oversized or noncanonical requests are rejected before storage
163
+ commit. The background monitor bounds both discovery and re-expansion of older
164
+ queued batches; an oversized legacy batch is skipped as a whole and reported
165
+ for operator recovery rather than partially broadcast.
166
+
167
+ `Setup.makeEnv()` returns a development `.env` template containing newly
168
+ generated private keys but never prints it. Callers must deliberately write the
169
+ returned text to a protected local file and must not route it through ordinary
170
+ application, CI, or shared terminal logs.
171
+
49
172
  ### Packages
50
173
 
51
174
  The toolbox publishes three npm packages from this repo:
@@ -54,10 +177,155 @@ The toolbox publishes three npm packages from this repo:
54
177
  - **[`@bsv/wallet-toolbox-client`](https://www.npmjs.com/package/@bsv/wallet-toolbox-client)** — Browser build; excludes Node-only backends (Knex/SQLite/MySQL)
55
178
  - **[`@bsv/wallet-toolbox-mobile`](https://www.npmjs.com/package/@bsv/wallet-toolbox-mobile)** — Mobile build; remote wallet storage plus portable local ChainTracks components and adapter contracts
56
179
 
180
+ ### Sync performance and recovery
181
+
182
+ Sync pages start at 64 records and adapt after successful commits toward a
183
+ five-second page budget. Proof-bearing pages cap growth at 128 records; cheap
184
+ metadata pages can grow to 1,000, while provider byte/item ceilings still apply.
185
+ The server checks at most eight proofs concurrently and waits for all started
186
+ checks to settle on failure before rejecting the page. Every proof still passes
187
+ transaction, Merkle path, active-root and active-header validation before a merge.
188
+ An authenticated HTTP regression covers 250 synthetic proofs and confirms that
189
+ an invalid follow-up page cannot change the committed checkpoint. Stale proofs
190
+ can be reconciled through another provider, but only after the replacement passes
191
+ the same transaction, membership and active-chain checks. Transaction bytes,
192
+ wallet references and source cursor timestamps are preserved. Corrected destination
193
+ proofs receive a fresh local timestamp for incremental replication. Unverifiable replacements
194
+ stop the page with a recovery message; no record is silently skipped.
195
+
196
+ A read-only deployment-host sample of 250 proofs took 42.6 seconds with sequential
197
+ validation and 5.58 seconds with bounded concurrency, with the same 250 root and
198
+ 250 header checks. This measures validation only, not full-copy throughput.
199
+ Timeouts remain possible during dependency outages; writes are never blindly
200
+ replayed, and resumed sync rereads durable destination progress.
201
+
202
+ The adaptive page controller and optional validated-proof lookup add a small
203
+ client bundle cost. The [artifact measurements and limits](./docs/sync-transfer.md#artifact-cost-requiring-review)
204
+ include the combined upstream security fixes. These are explicit feature costs;
205
+ the RPC validation coordinator remains excluded from browser/mobile bundles.
206
+
207
+ The transfer extension is an **unpublished 2.13.0 candidate**. Published 2.12.0
208
+ has no record-transfer methods. Check exact build provenance and authenticated
209
+ runtime capabilities, not a version label alone. An oversized record on a legacy
210
+ source cannot be rescued by upgrading only its destination; upgrade the source
211
+ before retrying. Records exceeding the negotiated 64 MiB frame limit fail safely
212
+ without being skipped or advancing their checkpoint.
213
+
214
+ Large individual records can use the negotiated
215
+ [bounded transfer protocol](./docs/sync-transfer.md), with durable staging,
216
+ integrity verification and checkpoint replay protection. Its authenticated
217
+ HTTP/SQLite/IndexedDB regression exercises a 7 MiB binary record, an interrupted
218
+ upload across client/server restart, a lost part acknowledgement, corrupted
219
+ download rejection and a verified restore followed by an unchanged resync.
220
+ The current frame limit is 64 MiB; legacy providers must be upgraded to use it.
221
+ It also passes with a one-second delay on every authenticated transport send;
222
+ that models added latency, not a measured bandwidth limit or a real mobile network.
223
+ These synthetic regressions are separate from the large-wallet timing evidence above.
224
+
57
225
  Wallet storage replication applies each received page and its durable sync
58
226
  checkpoint in one provider transaction. IndexedDB and Knex therefore avoid
59
227
  per-record transaction startup, and a failed page rolls back without advancing
60
- the checkpoint. The sync wire format and persisted schemas are unchanged.
228
+ the checkpoint. Sources fill each bounded page with adaptive, size-aware reads,
229
+ and Knex storage adds user-scoped proof lookup indexes. Clients may set
230
+ `includeTotals` on a sync-chunk request to receive optional source record totals
231
+ for exact progress reporting. Older providers ignore the hint, and totals are
232
+ not counted unless requested. New clients also send the writer-local sync-state
233
+ identifier selected during provider registration. New providers use it to
234
+ disambiguate legacy duplicate checkpoints, while either side remains compatible
235
+ with older protocol peers. When a provider rejects a sync page because its
236
+ serialized RPC response exceeds the service ceiling, remote clients retry the
237
+ read-only request with a smaller chunk budget and remember the working limit
238
+ for the rest of the session.
239
+
240
+ Output synchronization requires a local mapping for every non-null source basket
241
+ ID. A missing mapping rejects the page so its transaction and checkpoint can roll
242
+ back; retry after transferring the missing basket. Newer source updates apply
243
+ basket changes, including explicit removal. Same-time or older updates preserve
244
+ local relinquishment. Previously unbasketed records require a verified newer
245
+ source update to repair; no heuristic rewrites existing wallet state.
246
+
247
+ `StorageKnex.getRawTxOfKnownValidTransaction()` can read a cold store while the
248
+ caller holds a transaction, including SQLite's single-connection pool. Settings
249
+ are read through that transaction without entering the shared cache or starting
250
+ prepared-BEEF background work; ordinary `makeAvailable()` remains the explicit
251
+ store-wide startup operation. An absent optional `inputBEEF` does not prevent
252
+ returning stored raw transaction bytes.
253
+
254
+ IndexedDB schema version 6 adds a non-unique transaction-ID/user index. Sync
255
+ identity lookups, commissions, and relation maps use selective indexes or exact
256
+ keys instead of scanning the growing wallet for each row. Proof batch checks
257
+ resolve requested transaction IDs through the existing index, preserving primary-key
258
+ ordering, pagination, and proof-validation rules. Existing bytes and
259
+ legacy duplicate transaction IDs are preserved. Databases upgrade automatically;
260
+ older clients that open schema version 5 cannot reopen an upgraded database, so
261
+ keep a compatible client when retaining a local backup.
262
+
263
+ Updated servers advertise `syncCheckpointVersion: 1` in runtime settings.
264
+ Compatible clients fetch a compact checkpoint once, then use the checkpoint
265
+ returned by each committed page. The complete ID mapping remains durable on
266
+ the writer and is no longer downloaded before every page. Older providers use
267
+ the existing full-state path; authentication, gateway, and malformed checkpoint
268
+ errors remain failures rather than compatibility fallbacks. A retry starts
269
+ from the writer's durable checkpoint. `includeNextCheckpoint` is optional, and
270
+ legacy requests retain their existing response shape.
271
+
272
+ When a reader negotiates binary JSON, large schema-defined sync byte fields
273
+ are encoded as base64 instead of decimal number arrays. Legacy readers retain
274
+ the existing arrays; unrelated numeric fields are never reinterpreted as bytes.
275
+ Clients with `binaryRequests: true` use the same compact representation for
276
+ sync uploads after the server negotiates binary request support. The default
277
+ request setting is unchanged.
278
+ Binary JSON parsing preserves the existing marker and escaping rules while
279
+ avoiding a JavaScript reviver callback for every scalar byte. The SDK also
280
+ prevents certificate work or session recovery from dispatching another request
281
+ after the caller's authentication deadline has expired. This does not cancel a
282
+ write already received by a server or automatically replay failed writes.
283
+
284
+ Run the authenticated candidate-provider sync benchmark with:
285
+
286
+ ```sh
287
+ pnpm bench:storage-sync
288
+ ```
289
+
290
+ Set `WALLET_TOOLBOX_BENCH_MYSQL=true`, `MYSQL_CONNECTION`, and optionally
291
+ `WALLET_TOOLBOX_BENCH_MYSQL_DATABASE` to exercise the same fixture through a
292
+ MySQL-backed provider. The benchmark reports HTTP p50/p95 latency and the
293
+ source-query limits used to fill a 250-record page; it is observational rather
294
+ than a cross-machine latency SLA. It also compares the old reviver with the
295
+ current parser on identical synthetic data and measures checkpoint size. On
296
+ one local Node 24 run, a 1 MiB numeric-array fixture (3.74 MB of JSON) measured
297
+ 501.2 ms versus 10.1 ms median parsing time across nine alternating samples.
298
+ A synthetic 50,000-entry mapping occupied 678,850 bytes; its compact checkpoint
299
+ occupied 432 bytes. These are CPU and payload measurements, not a claim of the
300
+ same end-to-end network speedup. Encoding the synthetic byte field through
301
+ the negotiated sync codec reduced its JSON payload from 3,743,771 to 1,398,163
302
+ bytes (62.7%).
303
+
304
+ Retained integration tests cover authenticated HTTP backup and complete restore
305
+ into a fresh IndexedDB store, multipage progression, no-change resync,
306
+ interruption/resume, user isolation, malformed checkpoints, and legacy-provider
307
+ fallback. Live deployment results must be reported separately with the tested
308
+ revision and scope; a partial page sample is not a full restore verification.
309
+
310
+ A native desktop integration run against candidate runtime
311
+ `a88d18abf14b75a3227016bfd947d5a08b3ee236` completed a full remote-to-local
312
+ copy in 769.5 seconds, compared with 990.3 seconds for the preceding candidate
313
+ run with identical entity counts. Remote reads took 619.2 seconds, local writes
314
+ 146.0 seconds, and measurement 4.1 seconds. Proof-page writes fell from 75.7 to
315
+ 9.8 seconds after indexed preflight lookup. These are sequential observations,
316
+ not a controlled full-wallet comparison against upstream main. The all-state
317
+ 100 ms timer probe reported p95 delay of 908 ms; foreground focus was not recorded,
318
+ so this does not establish foreground UI latency. Separate 90-second native
319
+ foreground probes during a retained backup measured p95 delays of 5 ms for
320
+ transactions, 8 ms for outputs, 10 ms for heavier output pages, and 5 ms for
321
+ proof requests. Their maxima were 60, 51, 298, and 62 ms respectively; these
322
+ samples are not a whole-copy latency guarantee. The retained-backup test also
323
+ verified cancellation at a page boundary and automatic checkpoint recovery after
324
+ a full native app restart. Development testing required refreshing Vite's cached
325
+ linked dependencies to load the candidate schema consistently. See
326
+ [PR486](https://github.com/bsv-blockchain/ts-stack/pull/486) for final integration
327
+ completion and release evidence. Personal deployment and wallet details are
328
+ retained privately, outside this repository.
61
329
 
62
330
  `listOutputs` reports `totalOutputs` as the full matching result count on every
63
331
  page for both Knex and IndexedDB storage, including short final pages and pages
@@ -92,6 +360,25 @@ checks leave multiple valid UMP tokens, and only when the pinned outpoint is
92
360
  present in the verified candidates. A pin cannot introduce an outpoint that the
93
361
  wallet did not independently retrieve and validate.
94
362
 
363
+ UMP renewal consumes only the exact canonical predecessor returned for its
364
+ outpoint. Its signed fields, presentation/recovery hashes, and locally derived
365
+ admin-token locking key are verified before the old token is signed. The manager
366
+ locates the predecessor at its actual input index and accepts the completed
367
+ action only when it preserves every authorized input and output, contains one
368
+ exact one-satoshi replacement token, and reports the transaction's real ID.
369
+
370
+ WAB faucet funding is subject to the same action-completion binding. The faucet
371
+ response must contain the exact declared Atomic BEEF target and output zero must
372
+ commit to the supplied nonzero R-puzzle scalar. The manager signs that outpoint
373
+ at its actual wallet input index and sends the fee-adjusted balance only to an
374
+ explicit BRC-29 output derived for the authenticated wallet. That output's exact
375
+ script and bounded amount are authorized before signing; an unrequested wallet
376
+ output cannot consume the faucet input. The signed action is staged locally,
377
+ labeled, and recorded in a recovery basket before broadcast. A retry recovers
378
+ and internalizes that exact transaction, or recognizes its already-internalized
379
+ managed output, instead of authorizing a second destination. Missing, reordered,
380
+ substituted, ambiguous, or result-only transactions fail closed.
381
+
95
382
  New WAB registrations are interruption-safe across the off-chain/on-chain
96
383
  boundary. A WAB that advertises `registrationStatus: "pending"` lets a verified
97
384
  retry reuse the stored presentation key when a clean UMP lookup confirms that
@@ -139,11 +426,31 @@ HTTPS. Plain HTTP is accepted only for explicit loopback hosts during local
139
426
  development. Arcade SSE dependency debug logging remains disabled because its
140
427
  request URL and headers carry wallet callback credentials.
141
428
 
429
+ Remote storage responses must also complete BRC-103 mutual authentication;
430
+ ordinary HTTP fallback responses are rejected. Without an explicit
431
+ `serverIdentityKey`, the first authenticated server identity reached through
432
+ the configured HTTPS endpoint is authoritative for that client instance and
433
+ cannot change during its lifetime. Applications that independently provision
434
+ or validate the server key should pass it as `serverIdentityKey` to pin the
435
+ expected peer from the first response. In either mode, the
436
+ `storageIdentityKey` returned by the authenticated `makeAvailable()` response
437
+ is authoritative for that client instance. It may be distinct from the server
438
+ transport identity; applications that independently provision it can pin it
439
+ with the separate `storageIdentityKey` option. JSON-RPC responses are accepted
440
+ only when their version and request ID match and they contain exactly one of
441
+ `result` or `error`.
442
+
142
443
  Certificate signatures fail closed at every wallet trust boundary. Direct and
143
444
  issuer-mediated acquisition require an affirmative certifier-signature result
144
445
  before storage, and identity discovery verifies each untrusted overlay
145
446
  certificate before decryption or trust scoring.
146
447
 
448
+ BRC-100 originators may include a numeric port for compatibility, including
449
+ local-development ports. Permission and administrator authority is deliberately
450
+ scoped to the normalized lowercase hostname: all ports on one hostname are the
451
+ same originator. Existing authenticated permission tokens that recorded a port
452
+ are discovered through a bounded compatibility lookup and compared by hostname.
453
+
147
454
  ### ChainTracks sources and networks
148
455
 
149
456
  Wallet services do not require a WhatsOnChain key for ChainTracks. Node
@@ -167,6 +474,86 @@ go-chaintracks client; existing legacy v1 URLs and explicit clients remain
167
474
  compatible. Browser and mobile distributions expose the same fetch/SSE client
168
475
  without Node `Buffer` or filesystem dependencies.
169
476
 
477
+ The configured ChainTracks endpoint remains the authority for the selected
478
+ chain view. Its transport bytes are not trusted blindly: JSON and binary reads
479
+ remain under one deadline and fixed byte ceilings, redirects are rejected, SSE
480
+ events have byte and idle-time limits, and every returned header is canonical,
481
+ proof-of-work-valid, and bound to the requested network, height, or hash before
482
+ use. Binary batches must be exact 80-byte linked sequences. The additive
483
+ `GoChaintracksServiceClientOptions` limits can be lowered for constrained hosts.
484
+ Live metadata is accepted only as a complete record with positive local
485
+ identities. Reorganization deactivation lists are bounded by their declared
486
+ depth, start at the old tip, contain no duplicates, and form one descending
487
+ linked chain before wallet monitor callbacks receive them. Remote diagnostic
488
+ text is reduced to bounded single-line output. The monitor repeats these checks
489
+ at its own trust boundary for custom event adapters, requires every configured
490
+ chain source to match the wallet network, and retains at most 4,096 unique
491
+ deactivated headers by default. `MonitorOptions.maxQueuedDeactivatedHeaders`
492
+ can lower that ceiling. Prepared-proof invalidations are coalesced and drained
493
+ during teardown; partial event subscriptions and rejected application
494
+ callbacks are contained and reported through bounded monitor events.
495
+ The legacy `BHServiceClient` applies the same endpoint, whole-body deadline,
496
+ byte, range, hash, linkage, and proof-of-work checks. Its historical public
497
+ `cache` property remains for source compatibility but is diagnostic only:
498
+ neither callers nor old or rejected roots can make it authoritative, and every
499
+ Merkle-root verdict resolves the current canonical header again so
500
+ reorganizations remain visible.
501
+ Local ChainTracks instances also validate and copy submitted headers, ignore
502
+ duplicate pending submissions, and retain at most 4,096 by default; the live
503
+ SSE adapter applies the same default queue ceiling. Construction rejects
504
+ unsupported networks, unsafe recursion/queue limits, and malformed ingestor
505
+ collections. Library logging is silent by default; applications that need
506
+ operational output must provide the existing optional `logging` callback.
507
+ Startup methods await initialization and surface failures; a failed attempt can
508
+ be retried, while `destroy()` drains sources and releases storage even if the
509
+ instance never became available. Header and reorganization subscriptions are
510
+ bounded, deleted on unsubscribe, and receive isolated snapshots so one listener
511
+ cannot alter another listener's event.
512
+
513
+ Local persistence treats both stored metadata and adapter calls as integrity
514
+ boundaries. Memory-backed trackers are instance-isolated; IndexedDB and Knex
515
+ require one active tip and one active header per height, reject nonconsecutive
516
+ parent links, bound ancestor walks, and fail closed on malformed state. Knex
517
+ serializes tip mutation with an internal transaction lock row. Run every
518
+ ChainTracks Knex migration before serving traffic. On MySQL, the migration
519
+ changes hex identifiers to `VARCHAR(64)` and cached header bytes to `LONGBLOB`;
520
+ because the former `VARBINARY(32)` representation could irreversibly truncate
521
+ live identifiers, the derived live-header cache is cleared and rebuilt from
522
+ authenticated bulk data during that migration.
523
+
524
+ To downgrade to code that predates the repair migration, first stop every
525
+ ChainTracks writer and take a verified database backup together with the
526
+ authenticated bulk-header data needed to rebuild the live cache. Using the
527
+ current `ChaintracksKnexMigrations` source, run a targeted `knex.migrate.down`
528
+ for only
529
+ `2026-09-17-001 repair MySQL live-header encodings and bulk blob`. Its `down`
530
+ is intentionally a schema no-op: it removes that migration's ledger entry but
531
+ must leave the repaired `VARCHAR(64)` identifier columns, `LONGBLOB` bulk data,
532
+ the `chaintracks_state` lock row, and authenticated bulk files intact. Validate
533
+ that retained schema and data against the older code in a non-production copy
534
+ before starting it. Never roll down the initial migration, recreate the tables,
535
+ or convert the identifiers back to truncating `VARBINARY(32)` columns.
536
+
537
+ Bulk-file additions and extensions reach durable storage before becoming
538
+ visible in memory. Reconciliation and any replacement spanning multiple files
539
+ commit atomically in the built-in Knex and IndexedDB adapters, preserve stored
540
+ bytes omitted from an update, and restore the prior manager state on failure.
541
+ Custom `ChaintracksStorageBulkFileApi` implementations remain source compatible,
542
+ but must implement the additive `replaceBulkFiles` method before the manager
543
+ will perform a multi-file replacement; this fail-closed rule prevents a restart
544
+ from observing gaps or overlapping stale rows.
545
+
546
+ WhatsOnChain is authoritative only when an application deliberately enables it
547
+ as a fallback chain source. URLs returned by its resource manifest are not
548
+ local/operator configuration: they are treated as untrusted locators and must
549
+ remain credential-free public HTTPS. Node downloads resolve, approve, and pin a
550
+ public address into the TLS connection; browser downloads retain HTTPS,
551
+ redirect, CORS, deadline, and byte controls. Resource manifests, recent-header
552
+ JSON, binary files, and legacy WebSocket frames are bounded and strictly
553
+ validated. WebSocket history is admitted in ordered chunks, live queues are
554
+ capped, and every candidate header is canonical and proof-of-work-valid before
555
+ its declared target can affect chain-work selection.
556
+
170
557
  Browser, mobile, and Node applications can instead make a persisted local
171
558
  ChainTracks instance their primary SDK `ChainTracker`. Immutable checkpoint
172
559
  assets are read through `BulkFileDataCacheApi` before any network request;
@@ -178,13 +565,29 @@ verification through a bounded worker pool; browser and mobile builds retain
178
565
  the portable `InlineBulkFileDataValidator`. Filesystem deployments can combine
179
566
  the content-addressed, quarantining `BulkFileDataCacheFs` with
180
567
  `DurableFileBulkFileDownloadBudget`, which flushes a conservative reservation
181
- before every physical attempt and preserves the allowance across restarts.
568
+ before every physical attempt, serializes replicas through the shared state
569
+ file, and preserves the allowance across restarts. A crash-abandoned
570
+ `<stateFile>.lock` is deliberately not reclaimed automatically: after proving
571
+ that no writer is active, an operator must remove that narrow lock directory or
572
+ choose a fresh ledger path. Cache files are read only up to their advertised
573
+ size plus one rejection byte and writes must match the advertised SHA-256.
574
+ Cache replacement, promotion, and quarantine are serialized through a
575
+ per-object `<digest>.headers.lock` directory with the same fail-closed,
576
+ operator-confirmed abandoned-lock procedure. Callers may release or reuse their
577
+ input buffers immediately because the cache snapshots identity metadata and
578
+ bytes before waiting for that lock.
182
579
  `LocalChainTracker` reserves remote clients
183
580
  for explicit remote-only mode, local exceptions, and quorum-backed consistency
184
581
  or recovery checks. See
185
582
  [Local-first ChainTracks](./docs/local-first-chaintracks.md) for packaging,
186
583
  background synchronization, migration, and advanced-settings requirements.
187
584
 
585
+ Legacy filesystem import/export is restricted to path-free manifest and data
586
+ filenames beneath the caller-selected root. A missing manifest is created only
587
+ for a definite not-found error; permission, size, parse, and integrity failures
588
+ remain visible. Local files must form a contiguous genesis-anchored chain and
589
+ all reads, writes, reader buffers, and queued lock operations are bounded.
590
+
188
591
  Arcade is the HTTPS/SSE gateway for Teranode-backed header data. Its v2 edge
189
592
  must allow browser origins and OPTIONS before browser defaults can use it;
190
593
  direct Teranode P2P is not included in browser/mobile artifacts.
@@ -222,6 +625,70 @@ cannot restore the failed transaction; recovery requires a mined status and a
222
625
  Merkle proof validated by the configured chain tracker. Arcade SSE events are
223
626
  acknowledged in order only after their storage update and cursor persistence
224
627
  succeed, so a transient storage failure is retried instead of skipped.
628
+ The SSE client validates and owns every status record, retains at most 64 events
629
+ and 4 MiB by default, and enforces a 256 KiB ceiling per event. The additive
630
+ `maxEventBytes`, `maxPendingEvents`, and `maxPendingBytes` options may lower
631
+ those limits. A malformed, excessive, or failed event closes the stream and
632
+ prevents queued successors from advancing beyond the last durable cursor.
633
+ Client logging is silent unless `log` is supplied, and transport errors never
634
+ forward credential-bearing EventSource objects. Monitor startup awaits its
635
+ ChainTracks subscriptions and retries transient setup failures; removal and
636
+ teardown close Arcade SSE before storage is destroyed. Monitor operational
637
+ logging is likewise opt-in through `MonitorOptions.logging`.
638
+
639
+ ### Transaction-status authentication
640
+
641
+ Transaction-status providers are untrusted observations, not permission to
642
+ change an arbitrary wallet transaction. Every result is copied and accepted
643
+ only when its txid is one of the exact requested ids and its depth agrees with
644
+ `mined`, `known`, or `unknown`. Terminal and input-conflict evidence is allowed
645
+ only on an internally consistent unknown lifecycle result. Competing txids and
646
+ diagnostics are bounded, and the durable provider name comes from local
647
+ configuration rather than the remote response.
648
+
649
+ A malformed provider response is recorded as that provider's failure and the
650
+ service tries the next configured source. Arcade additionally binds the whole
651
+ `GET /tx/{txid}` response to the request before interpreting lifecycle or proof
652
+ fields. Provider errors and omitted results remain unknown; they never become
653
+ mined, known, terminal, or input-conflict evidence by default.
654
+
655
+ ### Raw transaction acquisition
656
+
657
+ Raw-transaction providers must return an accessor-free result whose declared
658
+ txid exactly matches the request. Transaction data is accepted only as a
659
+ nonempty dense byte array no larger than 32 MiB, copied before hashing, and
660
+ returned as wallet-owned bytes. The computed transaction hash must still match
661
+ the request. Provider attribution comes from local configuration, and an
662
+ invalid result is discarded before the next provider is tried.
663
+
664
+ ### Merkle-proof authentication
665
+
666
+ Wallet proof providers are untrusted inputs. An ordinary `getMerklePath`
667
+ success is accepted only when a bounded, copied path contains an explicit leaf
668
+ for the requested transaction, computes the supplied header's Merkle root at
669
+ the same height, and the complete header resolves through the wallet's
670
+ proof-of-work-valid chain service. The monitor independently asks its configured
671
+ ChainTracks source to affirm that root and height before persisting proof state
672
+ or restoring a failed transaction. Raw transaction bytes must also hash to the
673
+ same txid.
674
+
675
+ Custom ordinary proof providers must return both a `MerklePath` and complete
676
+ `BlockHeader`; a path-only result is treated as unavailable. The additive
677
+ `getValidatedMerklePath` compatibility hook still permits a path-only custom
678
+ provider when its caller-supplied validator independently resolves and
679
+ authenticates the header. No proof-provider response, mined status label, or
680
+ non-null path alone is authority to release wallet funds.
681
+
682
+ Every configured proof provider is treated as untrusted. Wallet Toolbox checks
683
+ transaction membership, header/root agreement, and the active ChainTracks root
684
+ before a proof can be persisted; a stale orphan proof is rejected and the next
685
+ provider is tried. The lagged proven-transaction review retains unresolved
686
+ reorg heights and bounds retry work per run while its forward cursor continues,
687
+ so temporary provider lag cannot turn one failed repair attempt into a
688
+ permanent checkpoint skip. Failed retries rotate behind waiting heights, and
689
+ temporarily ineligible heights remain queued when the chain tip retreats.
690
+ Compound proofs may mark multiple transactions; validation checks membership
691
+ of the requested transaction. No consumer or database migration is required.
225
692
 
226
693
  Invalid-change review applies the same positive-evidence rule. Only an
227
694
  explicit successful `isUtxo: false` result is considered spent; a provider
@@ -235,6 +702,36 @@ positively spent subset while retaining and reporting unknowns. Each confirmed
235
702
  spent output is rechecked for ownership and allocation state under the write
236
703
  lock, and every release or blocked release records bounded audit evidence.
237
704
 
705
+ Provider responses are copied as accessor-free data, capped at 4,096 detail
706
+ rows, and bound to the requested outpoint whenever details are supplied. A
707
+ configured UTXO provider remains a locally chosen operational oracle: these
708
+ structural checks prevent response confusion but do not turn non-membership
709
+ claims into cryptographic proofs. Whole-wallet compatibility reviews stop
710
+ before provider work when more than 10,000 candidates would be inspected;
711
+ operators should use the bounded Monitor Admin pages for larger wallets. Manual
712
+ review inputs require canonical compressed identity keys and exact modes,
713
+ booleans, page sizes, and offsets. A release rechecks the exact user, txid,
714
+ vout, value, basket, and allocation state under the write lock.
715
+
716
+ Transaction-history and broadcast providers are locally selected operational
717
+ oracles, but their response objects are never trusted as wallet-owned state.
718
+ Script-history observations are bound to the exact normalized script hash and
719
+ endianness, copied into a dense 4,096-entry maximum, and checked for canonical
720
+ transaction IDs, safe heights, duplicates, and conflicts. WhatsOnChain calls
721
+ have a 30-second whole-request deadline by default; the additive
722
+ `requestTimeoutMsecs` option may be set from 1 through 3,600,000 milliseconds.
723
+
724
+ Broadcast accepts at most 1,000 unique requested transactions in a 64 MiB BEEF.
725
+ Each provider receives its own strict reparse and copied txid list. Results must
726
+ contain exactly one invariant-consistent entry for each request; provider names
727
+ come from local registration, competing transactions and diagnostics are
728
+ bounded, and raw transaction, BEEF, endpoint, and txid-list diagnostics are not
729
+ retained. In `UntilSuccess` mode, malformed, throwing, or soft-timed-out
730
+ providers remain inconclusive and the next provider is tried. A provider's
731
+ double-spend assertion becomes terminal only when the wallet independently
732
+ gets conclusive spent evidence for at least one exact input; an unavailable or
733
+ unknown UTXO oracle cannot quarantine funds by itself.
734
+
238
735
  Core ChainTracks factories accept a final source-options argument when an
239
736
  application must override the defaults. Set `disableChaintracks`, `disableCdn`,
240
737
  or `disableWhatsOnChain` to `true` to opt out of an automatic source, or pass an
@@ -399,7 +896,10 @@ await storage.makeAvailable()
399
896
  const sessionManager = new KnexSessionManager(storage.knex, {
400
897
  ttlMs: 24 * 60 * 60 * 1000,
401
898
  // Optional. Set to 0 when every authenticated use must update the row.
402
- touchIntervalMs: 60 * 1000
899
+ touchIntervalMs: 60 * 1000,
900
+ // Optional global and per-identity rolling bounds for unsigned claims.
901
+ maxInitialRequestNonces: 100_000,
902
+ maxInitialRequestNoncesPerIdentity: 100_000
403
903
  })
404
904
 
405
905
  const server = new StorageServer(storage, {
@@ -413,6 +913,8 @@ const server = new StorageServer(storage, {
413
913
  preAuthRateLimit: { limit: 300, windowMs: 60_000 },
414
914
  // Per-identity before payment/RPC work (default 1,000/minute).
415
915
  rateLimit: { limit: 1_000, windowMs: 60_000 },
916
+ // Bound database/cursor work caused by list and sync offsets.
917
+ maxRpcListOffset: 1_000_000,
416
918
  // Public CORS is the default. Supply exact origins to opt into a whitelist.
417
919
  allowedOrigins: process.env.WALLET_ALLOWED_ORIGINS?.split(','),
418
920
  // Optional CSP/security-header overrides for an embedding deployment.
@@ -424,6 +926,33 @@ const server = new StorageServer(storage, {
424
926
  server.start()
425
927
  ```
426
928
 
929
+ Run `storage.migrate(...)` before enabling this manager on any replica. The
930
+ additive `2026-09-16-001 add auth message replay claims` migration creates the
931
+ `auth_message_nonces` uniqueness table used to atomically consume every signed
932
+ BRC-103 message nonce and identity-scoped initial-request nonce across replicas.
933
+ Missing the migration causes authentication processing to fail closed. All
934
+ replicas must share this table; a per-process or per-replica table does not
935
+ provide replay protection during load-balanced routing.
936
+
937
+ Signed per-session nonce claims fail closed at their configured bound and are
938
+ retained across sliding TTL extensions for the full active session. Unsigned
939
+ initial-request claims instead use global and per-identity rolling windows: when
940
+ either window is full, its oldest claim is evicted. Expired claims are removed
941
+ across identities during admission. This preserves exact replay rejection
942
+ within the configured TTL/cardinality windows without allowing unauthenticated
943
+ nonces to grow storage without bound or disable all future handshakes.
944
+
945
+ Schema migration is an operator-owned server lifecycle step. Authenticated
946
+ remote `StorageClient.migrate(...)` and `destroy()` RPCs are compatibility
947
+ no-ops; wallet tenants cannot run global DDL or close the shared provider.
948
+
949
+ The standard resource profile rejects list, find, and sync offsets above
950
+ 1,000,000 before storage access (`WALLET_STORAGE_RPC_MAX_LIST_OFFSET`). Small
951
+ and high-throughput profiles default to 100,000 and 10,000,000 respectively.
952
+ Operators with legitimately larger wallet histories can raise the bound; use
953
+ `-1` only when all tenants are trusted and the database has an independent
954
+ workload guard.
955
+
427
956
  Shared Knex sessions immediately persist authentication, nonce, identity, and
428
957
  certificate-state transitions. For an already-authenticated row, the default
429
958
  manager coalesces only timestamp-only usage touches for up to one minute. This
@@ -456,6 +985,24 @@ does not apply schema changes.
456
985
 
457
986
  ## Development
458
987
 
988
+ ### Overlay identity verification
989
+
990
+ Final identity discovery copies bounded resolver receipts, verifies their
991
+ transaction graph and canonical anchors with the wallet's existing
992
+ `Services.getChainTracker()`, and then validates the standard subject-signed
993
+ identity envelope and certificate. The wallet finally re-binds each verified
994
+ certificate to the requested subject or to every requested public attribute,
995
+ so a lookup host cannot substitute a different valid identity. Transaction and certificate reuse remain
996
+ bounded and canonical evidence is rechecked before cached results are used;
997
+ fresh provider tokens bracket asynchronous anchor checks where the configured
998
+ tracker supplies them. Invalid candidate evidence is dropped, while typed
999
+ limit/timeout outcomes propagate to the caller.
1000
+ Direct `identityUtils` callers must supply a canonical `ChainTracker`; missing
1001
+ context or invalid evidence produces no overlay identities. Local contacts
1002
+ retain their separate policy. Inclusion does not establish unspentness or
1003
+ freshness. See [identity verification](docs/identity-verification.md) for
1004
+ current C01/C02/C03 contracts, compatibility characterization, and limits.
1005
+
459
1006
  ```bash
460
1007
  git clone https://github.com/bsv-blockchain/ts-stack.git
461
1008
  cd ts-stack
@@ -477,9 +1024,12 @@ network access, or long runtimes. Files named `*.live.test.ts` are public-networ
477
1024
  checks, also excluded from deterministic PR coverage. Run exactly one governed
478
1025
  suite with `test:manual -- <path>` or `test:live -- <path>` after reviewing
479
1026
  `governance/test-quality/policy.json`; never batch-run operator suites. CI
480
- merges four Wallet Toolbox coverage shards
481
- for reporting; the complete local `test:coverage` run currently measures
482
- 69.12% statements, 59.09% branches, 72.83% functions, and 71.06% lines.
1027
+ merges four Wallet Toolbox coverage shards for reporting. The C01 local
1028
+ `test:coverage --runInBand` run passed 225 suites and 2,188 tests, with one
1029
+ pre-existing skipped test. Its all-files totals were 45.75% statements, 38.86%
1030
+ branches, 42.57% functions, and 45.46% lines; that collection includes imported
1031
+ `out/src` code as well as source files. Use the exact run's coverage report,
1032
+ rather than comparing unlike source-only and combined collections.
483
1033
 
484
1034
  Operational repair, migration, export, and long-running service procedures are
485
1035
  not tests. They live under [`operator/`](./operator/README.md), produce an exact