@bopen-io/wallet-toolbox 1.7.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (390) hide show
  1. package/.claude/settings.local.json +10 -0
  2. package/.env.template +22 -0
  3. package/.github/ISSUE_TEMPLATE/bug_report.md +40 -0
  4. package/.github/ISSUE_TEMPLATE/discussion.md +24 -0
  5. package/.github/pull_request_template.md +22 -0
  6. package/.github/workflows/push.yaml +145 -0
  7. package/.prettierrc +10 -0
  8. package/CHANGELOG.md +280 -0
  9. package/CONTRIBUTING.md +89 -0
  10. package/README.md +43 -0
  11. package/docs/README.md +85 -0
  12. package/docs/client.md +19627 -0
  13. package/docs/monitor.md +953 -0
  14. package/docs/open-rpc/index.html +46 -0
  15. package/docs/services.md +6377 -0
  16. package/docs/setup.md +1268 -0
  17. package/docs/storage.md +5367 -0
  18. package/docs/wallet.md +19626 -0
  19. package/jest.config.ts +25 -0
  20. package/license.md +28 -0
  21. package/out/tsconfig.all.tsbuildinfo +1 -0
  22. package/package.json +63 -0
  23. package/src/CWIStyleWalletManager.ts +1999 -0
  24. package/src/Setup.ts +579 -0
  25. package/src/SetupClient.ts +322 -0
  26. package/src/SetupWallet.ts +108 -0
  27. package/src/SimpleWalletManager.ts +526 -0
  28. package/src/Wallet.ts +1169 -0
  29. package/src/WalletAuthenticationManager.ts +153 -0
  30. package/src/WalletLogger.ts +213 -0
  31. package/src/WalletPermissionsManager.ts +3660 -0
  32. package/src/WalletSettingsManager.ts +114 -0
  33. package/src/__tests/CWIStyleWalletManager.test.d.ts.map +1 -0
  34. package/src/__tests/CWIStyleWalletManager.test.js.map +1 -0
  35. package/src/__tests/CWIStyleWalletManager.test.ts +675 -0
  36. package/src/__tests/WalletPermissionsManager.callbacks.test.ts +323 -0
  37. package/src/__tests/WalletPermissionsManager.checks.test.ts +844 -0
  38. package/src/__tests/WalletPermissionsManager.encryption.test.ts +412 -0
  39. package/src/__tests/WalletPermissionsManager.fixtures.ts +307 -0
  40. package/src/__tests/WalletPermissionsManager.flows.test.ts +462 -0
  41. package/src/__tests/WalletPermissionsManager.initialization.test.ts +300 -0
  42. package/src/__tests/WalletPermissionsManager.pmodules.test.ts +798 -0
  43. package/src/__tests/WalletPermissionsManager.proxying.test.ts +724 -0
  44. package/src/__tests/WalletPermissionsManager.tokens.test.ts +503 -0
  45. package/src/index.all.ts +27 -0
  46. package/src/index.client.ts +25 -0
  47. package/src/index.mobile.ts +21 -0
  48. package/src/index.ts +1 -0
  49. package/src/monitor/Monitor.ts +412 -0
  50. package/src/monitor/MonitorDaemon.ts +188 -0
  51. package/src/monitor/README.md +3 -0
  52. package/src/monitor/__test/MonitorDaemon.man.test.ts +45 -0
  53. package/src/monitor/tasks/TaskCheckForProofs.ts +243 -0
  54. package/src/monitor/tasks/TaskCheckNoSends.ts +73 -0
  55. package/src/monitor/tasks/TaskClock.ts +33 -0
  56. package/src/monitor/tasks/TaskFailAbandoned.ts +54 -0
  57. package/src/monitor/tasks/TaskMonitorCallHistory.ts +26 -0
  58. package/src/monitor/tasks/TaskNewHeader.ts +93 -0
  59. package/src/monitor/tasks/TaskPurge.ts +68 -0
  60. package/src/monitor/tasks/TaskReorg.ts +89 -0
  61. package/src/monitor/tasks/TaskReviewStatus.ts +48 -0
  62. package/src/monitor/tasks/TaskSendWaiting.ts +122 -0
  63. package/src/monitor/tasks/TaskSyncWhenIdle.ts +26 -0
  64. package/src/monitor/tasks/TaskUnFail.ts +151 -0
  65. package/src/monitor/tasks/WalletMonitorTask.ts +47 -0
  66. package/src/sdk/CertOpsWallet.ts +18 -0
  67. package/src/sdk/PrivilegedKeyManager.ts +372 -0
  68. package/src/sdk/README.md +13 -0
  69. package/src/sdk/WERR_errors.ts +234 -0
  70. package/src/sdk/WalletError.ts +170 -0
  71. package/src/sdk/WalletErrorFromJson.ts +80 -0
  72. package/src/sdk/WalletServices.interfaces.ts +700 -0
  73. package/src/sdk/WalletSigner.interfaces.ts +11 -0
  74. package/src/sdk/WalletStorage.interfaces.ts +606 -0
  75. package/src/sdk/__test/CertificateLifeCycle.test.ts +131 -0
  76. package/src/sdk/__test/PrivilegedKeyManager.test.ts +738 -0
  77. package/src/sdk/__test/WalletError.test.ts +318 -0
  78. package/src/sdk/__test/validationHelpers.test.ts +21 -0
  79. package/src/sdk/index.ts +10 -0
  80. package/src/sdk/types.ts +226 -0
  81. package/src/services/README.md +11 -0
  82. package/src/services/ServiceCollection.ts +248 -0
  83. package/src/services/Services.ts +603 -0
  84. package/src/services/__tests/ARC.man.test.ts +123 -0
  85. package/src/services/__tests/ARC.timeout.man.test.ts +79 -0
  86. package/src/services/__tests/ArcGorillaPool.man.test.ts +108 -0
  87. package/src/services/__tests/arcServices.test.ts +8 -0
  88. package/src/services/__tests/bitrails.test.ts +56 -0
  89. package/src/services/__tests/getMerklePath.test.ts +15 -0
  90. package/src/services/__tests/getRawTx.test.ts +13 -0
  91. package/src/services/__tests/postBeef.test.ts +104 -0
  92. package/src/services/__tests/verifyBeef.test.ts +50 -0
  93. package/src/services/chaintracker/BHServiceClient.ts +212 -0
  94. package/src/services/chaintracker/ChaintracksChainTracker.ts +71 -0
  95. package/src/services/chaintracker/__tests/ChaintracksChainTracker.test.ts +33 -0
  96. package/src/services/chaintracker/__tests/ChaintracksServiceClient.test.ts +29 -0
  97. package/src/services/chaintracker/chaintracks/Api/BlockHeaderApi.ts +72 -0
  98. package/src/services/chaintracker/chaintracks/Api/BulkIngestorApi.ts +83 -0
  99. package/src/services/chaintracker/chaintracks/Api/BulkStorageApi.ts +92 -0
  100. package/src/services/chaintracker/chaintracks/Api/ChaintracksApi.ts +64 -0
  101. package/src/services/chaintracker/chaintracks/Api/ChaintracksClientApi.ts +189 -0
  102. package/src/services/chaintracker/chaintracks/Api/ChaintracksFetchApi.ts +18 -0
  103. package/src/services/chaintracker/chaintracks/Api/ChaintracksFsApi.ts +58 -0
  104. package/src/services/chaintracker/chaintracks/Api/ChaintracksStorageApi.ts +386 -0
  105. package/src/services/chaintracker/chaintracks/Api/LiveIngestorApi.ts +25 -0
  106. package/src/services/chaintracker/chaintracks/Chaintracks.ts +609 -0
  107. package/src/services/chaintracker/chaintracks/ChaintracksService.ts +199 -0
  108. package/src/services/chaintracker/chaintracks/ChaintracksServiceClient.ts +154 -0
  109. package/src/services/chaintracker/chaintracks/Ingest/BulkIngestorBase.ts +176 -0
  110. package/src/services/chaintracker/chaintracks/Ingest/BulkIngestorCDN.ts +174 -0
  111. package/src/services/chaintracker/chaintracks/Ingest/BulkIngestorCDNBabbage.ts +18 -0
  112. package/src/services/chaintracker/chaintracks/Ingest/BulkIngestorWhatsOnChainCdn.ts +113 -0
  113. package/src/services/chaintracker/chaintracks/Ingest/BulkIngestorWhatsOnChainWs.ts +81 -0
  114. package/src/services/chaintracker/chaintracks/Ingest/LiveIngestorBase.ts +86 -0
  115. package/src/services/chaintracker/chaintracks/Ingest/LiveIngestorTeranodeP2P.ts +59 -0
  116. package/src/services/chaintracker/chaintracks/Ingest/LiveIngestorWhatsOnChainPoll.ts +104 -0
  117. package/src/services/chaintracker/chaintracks/Ingest/LiveIngestorWhatsOnChainWs.ts +66 -0
  118. package/src/services/chaintracker/chaintracks/Ingest/WhatsOnChainIngestorWs.ts +566 -0
  119. package/src/services/chaintracker/chaintracks/Ingest/WhatsOnChainServices.ts +219 -0
  120. package/src/services/chaintracker/chaintracks/Ingest/__tests/BulkIngestorCDNBabbage.test.ts +54 -0
  121. package/src/services/chaintracker/chaintracks/Ingest/__tests/LiveIngestorWhatsOnChainPoll.test.ts +33 -0
  122. package/src/services/chaintracker/chaintracks/Ingest/__tests/WhatsOnChainServices.test.ts +124 -0
  123. package/src/services/chaintracker/chaintracks/Storage/BulkStorageBase.ts +92 -0
  124. package/src/services/chaintracker/chaintracks/Storage/ChaintracksKnexMigrations.ts +104 -0
  125. package/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageBase.ts +382 -0
  126. package/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageIdb.ts +574 -0
  127. package/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageKnex.ts +438 -0
  128. package/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageMemory.ts +29 -0
  129. package/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageNoDb.ts +304 -0
  130. package/src/services/chaintracker/chaintracks/Storage/__tests/ChaintracksStorageIdb.test.ts +102 -0
  131. package/src/services/chaintracker/chaintracks/Storage/__tests/ChaintracksStorageKnex.test.ts +45 -0
  132. package/src/services/chaintracker/chaintracks/__tests/Chaintracks.test.ts +77 -0
  133. package/src/services/chaintracker/chaintracks/__tests/ChaintracksClientApi.test.ts +192 -0
  134. package/src/services/chaintracker/chaintracks/__tests/LocalCdnServer.ts +75 -0
  135. package/src/services/chaintracker/chaintracks/__tests/createIdbChaintracks.test.ts +62 -0
  136. package/src/services/chaintracker/chaintracks/__tests/data/cdnTest349/mainNetBlockHeaders.json +1 -0
  137. package/src/services/chaintracker/chaintracks/__tests/data/cdnTest349/mainNet_0.headers +0 -0
  138. package/src/services/chaintracker/chaintracks/__tests/data/cdnTest349/mainNet_1.headers +0 -0
  139. package/src/services/chaintracker/chaintracks/__tests/data/cdnTest349/mainNet_2.headers +0 -0
  140. package/src/services/chaintracker/chaintracks/__tests/data/cdnTest349/mainNet_3.headers +0 -0
  141. package/src/services/chaintracker/chaintracks/__tests/data/cdnTest379/mainNetBlockHeaders.json +1 -0
  142. package/src/services/chaintracker/chaintracks/__tests/data/cdnTest379/mainNet_0.headers +0 -0
  143. package/src/services/chaintracker/chaintracks/__tests/data/cdnTest379/mainNet_1.headers +0 -0
  144. package/src/services/chaintracker/chaintracks/__tests/data/cdnTest379/mainNet_2.headers +0 -0
  145. package/src/services/chaintracker/chaintracks/__tests/data/cdnTest379/mainNet_3.headers +0 -0
  146. package/src/services/chaintracker/chaintracks/__tests/data/cdnTest399/mainNetBlockHeaders.json +1 -0
  147. package/src/services/chaintracker/chaintracks/__tests/data/cdnTest399/mainNet_0.headers +0 -0
  148. package/src/services/chaintracker/chaintracks/__tests/data/cdnTest399/mainNet_1.headers +0 -0
  149. package/src/services/chaintracker/chaintracks/__tests/data/cdnTest399/mainNet_2.headers +0 -0
  150. package/src/services/chaintracker/chaintracks/__tests/data/cdnTest399/mainNet_3.headers +0 -0
  151. package/src/services/chaintracker/chaintracks/__tests/data/cdnTest402/mainNetBlockHeaders.json +1 -0
  152. package/src/services/chaintracker/chaintracks/__tests/data/cdnTest402/mainNet_0.headers +0 -0
  153. package/src/services/chaintracker/chaintracks/__tests/data/cdnTest402/mainNet_1.headers +0 -0
  154. package/src/services/chaintracker/chaintracks/__tests/data/cdnTest402/mainNet_2.headers +0 -0
  155. package/src/services/chaintracker/chaintracks/__tests/data/cdnTest402/mainNet_3.headers +0 -0
  156. package/src/services/chaintracker/chaintracks/__tests/data/cdnTest402/mainNet_4.headers +0 -0
  157. package/src/services/chaintracker/chaintracks/__tests/data/cdnTest499/mainNetBlockHeaders.json +1 -0
  158. package/src/services/chaintracker/chaintracks/__tests/data/cdnTest499/mainNet_0.headers +0 -0
  159. package/src/services/chaintracker/chaintracks/__tests/data/cdnTest499/mainNet_1.headers +0 -0
  160. package/src/services/chaintracker/chaintracks/__tests/data/cdnTest499/mainNet_2.headers +0 -0
  161. package/src/services/chaintracker/chaintracks/__tests/data/cdnTest499/mainNet_3.headers +0 -0
  162. package/src/services/chaintracker/chaintracks/__tests/data/cdnTest499/mainNet_4.headers +0 -0
  163. package/src/services/chaintracker/chaintracks/createDefaultIdbChaintracksOptions.ts +92 -0
  164. package/src/services/chaintracker/chaintracks/createDefaultKnexChaintracksOptions.ts +111 -0
  165. package/src/services/chaintracker/chaintracks/createDefaultNoDbChaintracksOptions.ts +91 -0
  166. package/src/services/chaintracker/chaintracks/createIdbChaintracks.ts +60 -0
  167. package/src/services/chaintracker/chaintracks/createKnexChaintracks.ts +65 -0
  168. package/src/services/chaintracker/chaintracks/createNoDbChaintracks.ts +60 -0
  169. package/src/services/chaintracker/chaintracks/index.all.ts +12 -0
  170. package/src/services/chaintracker/chaintracks/index.client.ts +4 -0
  171. package/src/services/chaintracker/chaintracks/index.mobile.ts +37 -0
  172. package/src/services/chaintracker/chaintracks/util/BulkFileDataManager.ts +975 -0
  173. package/src/services/chaintracker/chaintracks/util/BulkFileDataReader.ts +60 -0
  174. package/src/services/chaintracker/chaintracks/util/BulkFilesReader.ts +336 -0
  175. package/src/services/chaintracker/chaintracks/util/BulkHeaderFile.ts +247 -0
  176. package/src/services/chaintracker/chaintracks/util/ChaintracksFetch.ts +69 -0
  177. package/src/services/chaintracker/chaintracks/util/ChaintracksFs.ts +141 -0
  178. package/src/services/chaintracker/chaintracks/util/HeightRange.ts +153 -0
  179. package/src/services/chaintracker/chaintracks/util/SingleWriterMultiReaderLock.ts +76 -0
  180. package/src/services/chaintracker/chaintracks/util/__tests/BulkFileDataManager.test.ts +304 -0
  181. package/src/services/chaintracker/chaintracks/util/__tests/ChaintracksFetch.test.ts +60 -0
  182. package/src/services/chaintracker/chaintracks/util/__tests/HeightRange.test.ts +67 -0
  183. package/src/services/chaintracker/chaintracks/util/__tests/SingleWriterMultiReaderLock.test.ts +49 -0
  184. package/src/services/chaintracker/chaintracks/util/blockHeaderUtilities.ts +573 -0
  185. package/src/services/chaintracker/chaintracks/util/dirtyHashes.ts +29 -0
  186. package/src/services/chaintracker/chaintracks/util/validBulkHeaderFilesByFileHash.ts +432 -0
  187. package/src/services/chaintracker/index.all.ts +4 -0
  188. package/src/services/chaintracker/index.client.ts +4 -0
  189. package/src/services/chaintracker/index.mobile.ts +4 -0
  190. package/src/services/createDefaultWalletServicesOptions.ts +77 -0
  191. package/src/services/index.ts +1 -0
  192. package/src/services/processingErrors/arcSuccessError.json +76 -0
  193. package/src/services/providers/ARC.ts +350 -0
  194. package/src/services/providers/Bitails.ts +256 -0
  195. package/src/services/providers/SdkWhatsOnChain.ts +83 -0
  196. package/src/services/providers/WhatsOnChain.ts +883 -0
  197. package/src/services/providers/__tests/WhatsOnChain.test.ts +242 -0
  198. package/src/services/providers/__tests/exchangeRates.test.ts +18 -0
  199. package/src/services/providers/exchangeRates.ts +265 -0
  200. package/src/services/providers/getBeefForTxid.ts +369 -0
  201. package/src/signer/README.md +5 -0
  202. package/src/signer/WalletSigner.ts +17 -0
  203. package/src/signer/methods/acquireDirectCertificate.ts +52 -0
  204. package/src/signer/methods/buildSignableTransaction.ts +183 -0
  205. package/src/signer/methods/completeSignedTransaction.ts +117 -0
  206. package/src/signer/methods/createAction.ts +172 -0
  207. package/src/signer/methods/internalizeAction.ts +106 -0
  208. package/src/signer/methods/proveCertificate.ts +43 -0
  209. package/src/signer/methods/signAction.ts +54 -0
  210. package/src/storage/README.md +14 -0
  211. package/src/storage/StorageIdb.ts +2304 -0
  212. package/src/storage/StorageKnex.ts +1425 -0
  213. package/src/storage/StorageProvider.ts +810 -0
  214. package/src/storage/StorageReader.ts +194 -0
  215. package/src/storage/StorageReaderWriter.ts +432 -0
  216. package/src/storage/StorageSyncReader.ts +34 -0
  217. package/src/storage/WalletStorageManager.ts +943 -0
  218. package/src/storage/__test/StorageIdb.test.ts +43 -0
  219. package/src/storage/__test/WalletStorageManager.test.ts +275 -0
  220. package/src/storage/__test/adminStats.man.test.ts +89 -0
  221. package/src/storage/__test/getBeefForTransaction.test.ts +385 -0
  222. package/src/storage/index.all.ts +11 -0
  223. package/src/storage/index.client.ts +7 -0
  224. package/src/storage/index.mobile.ts +6 -0
  225. package/src/storage/methods/ListActionsSpecOp.ts +70 -0
  226. package/src/storage/methods/ListOutputsSpecOp.ts +129 -0
  227. package/src/storage/methods/__test/GenerateChange/generateChangeSdk.test.ts +1057 -0
  228. package/src/storage/methods/__test/GenerateChange/randomValsUsed1.ts +20 -0
  229. package/src/storage/methods/__test/offsetKey.test.ts +274 -0
  230. package/src/storage/methods/attemptToPostReqsToNetwork.ts +389 -0
  231. package/src/storage/methods/createAction.ts +947 -0
  232. package/src/storage/methods/generateChange.ts +556 -0
  233. package/src/storage/methods/getBeefForTransaction.ts +139 -0
  234. package/src/storage/methods/getSyncChunk.ts +293 -0
  235. package/src/storage/methods/internalizeAction.ts +562 -0
  236. package/src/storage/methods/listActionsIdb.ts +183 -0
  237. package/src/storage/methods/listActionsKnex.ts +226 -0
  238. package/src/storage/methods/listCertificates.ts +73 -0
  239. package/src/storage/methods/listOutputsIdb.ts +203 -0
  240. package/src/storage/methods/listOutputsKnex.ts +263 -0
  241. package/src/storage/methods/offsetKey.ts +89 -0
  242. package/src/storage/methods/processAction.ts +420 -0
  243. package/src/storage/methods/purgeData.ts +251 -0
  244. package/src/storage/methods/purgeDataIdb.ts +10 -0
  245. package/src/storage/methods/reviewStatus.ts +101 -0
  246. package/src/storage/methods/reviewStatusIdb.ts +43 -0
  247. package/src/storage/methods/utils.Buffer.ts +33 -0
  248. package/src/storage/methods/utils.ts +56 -0
  249. package/src/storage/remoting/StorageClient.ts +567 -0
  250. package/src/storage/remoting/StorageMobile.ts +544 -0
  251. package/src/storage/remoting/StorageServer.ts +291 -0
  252. package/src/storage/remoting/__test/StorageClient.test.ts +113 -0
  253. package/src/storage/schema/KnexMigrations.ts +489 -0
  254. package/src/storage/schema/StorageIdbSchema.ts +150 -0
  255. package/src/storage/schema/entities/EntityBase.ts +210 -0
  256. package/src/storage/schema/entities/EntityCertificate.ts +188 -0
  257. package/src/storage/schema/entities/EntityCertificateField.ts +136 -0
  258. package/src/storage/schema/entities/EntityCommission.ts +148 -0
  259. package/src/storage/schema/entities/EntityOutput.ts +290 -0
  260. package/src/storage/schema/entities/EntityOutputBasket.ts +153 -0
  261. package/src/storage/schema/entities/EntityOutputTag.ts +121 -0
  262. package/src/storage/schema/entities/EntityOutputTagMap.ts +123 -0
  263. package/src/storage/schema/entities/EntityProvenTx.ts +319 -0
  264. package/src/storage/schema/entities/EntityProvenTxReq.ts +580 -0
  265. package/src/storage/schema/entities/EntitySyncState.ts +389 -0
  266. package/src/storage/schema/entities/EntityTransaction.ts +306 -0
  267. package/src/storage/schema/entities/EntityTxLabel.ts +121 -0
  268. package/src/storage/schema/entities/EntityTxLabelMap.ts +123 -0
  269. package/src/storage/schema/entities/EntityUser.ts +112 -0
  270. package/src/storage/schema/entities/MergeEntity.ts +73 -0
  271. package/src/storage/schema/entities/__tests/CertificateFieldTests.test.ts +353 -0
  272. package/src/storage/schema/entities/__tests/CertificateTests.test.ts +354 -0
  273. package/src/storage/schema/entities/__tests/CommissionTests.test.ts +371 -0
  274. package/src/storage/schema/entities/__tests/OutputBasketTests.test.ts +278 -0
  275. package/src/storage/schema/entities/__tests/OutputTagMapTests.test.ts +242 -0
  276. package/src/storage/schema/entities/__tests/OutputTagTests.test.ts +288 -0
  277. package/src/storage/schema/entities/__tests/OutputTests.test.ts +464 -0
  278. package/src/storage/schema/entities/__tests/ProvenTxReqTests.test.ts +340 -0
  279. package/src/storage/schema/entities/__tests/ProvenTxTests.test.ts +504 -0
  280. package/src/storage/schema/entities/__tests/SyncStateTests.test.ts +288 -0
  281. package/src/storage/schema/entities/__tests/TransactionTests.test.ts +604 -0
  282. package/src/storage/schema/entities/__tests/TxLabelMapTests.test.ts +361 -0
  283. package/src/storage/schema/entities/__tests/TxLabelTests.test.ts +198 -0
  284. package/src/storage/schema/entities/__tests/stampLogTests.test.ts +90 -0
  285. package/src/storage/schema/entities/__tests/usersTests.test.ts +340 -0
  286. package/src/storage/schema/entities/index.ts +16 -0
  287. package/src/storage/schema/tables/TableCertificate.ts +21 -0
  288. package/src/storage/schema/tables/TableCertificateField.ts +12 -0
  289. package/src/storage/schema/tables/TableCommission.ts +13 -0
  290. package/src/storage/schema/tables/TableMonitorEvent.ts +9 -0
  291. package/src/storage/schema/tables/TableOutput.ts +64 -0
  292. package/src/storage/schema/tables/TableOutputBasket.ts +12 -0
  293. package/src/storage/schema/tables/TableOutputTag.ts +10 -0
  294. package/src/storage/schema/tables/TableOutputTagMap.ts +9 -0
  295. package/src/storage/schema/tables/TableProvenTx.ts +14 -0
  296. package/src/storage/schema/tables/TableProvenTxReq.ts +65 -0
  297. package/src/storage/schema/tables/TableSettings.ts +17 -0
  298. package/src/storage/schema/tables/TableSyncState.ts +18 -0
  299. package/src/storage/schema/tables/TableTransaction.ts +54 -0
  300. package/src/storage/schema/tables/TableTxLabel.ts +10 -0
  301. package/src/storage/schema/tables/TableTxLabelMap.ts +9 -0
  302. package/src/storage/schema/tables/TableUser.ts +16 -0
  303. package/src/storage/schema/tables/index.ts +16 -0
  304. package/src/storage/sync/StorageMySQLDojoReader.ts +696 -0
  305. package/src/storage/sync/index.ts +1 -0
  306. package/src/utility/Format.ts +133 -0
  307. package/src/utility/README.md +3 -0
  308. package/src/utility/ReaderUint8Array.ts +187 -0
  309. package/src/utility/ScriptTemplateBRC29.ts +73 -0
  310. package/src/utility/__tests/utilityHelpers.noBuffer.test.ts +109 -0
  311. package/src/utility/aggregateResults.ts +68 -0
  312. package/src/utility/identityUtils.ts +159 -0
  313. package/src/utility/index.all.ts +7 -0
  314. package/src/utility/index.client.ts +7 -0
  315. package/src/utility/parseTxScriptOffsets.ts +29 -0
  316. package/src/utility/stampLog.ts +69 -0
  317. package/src/utility/tscProofToMerklePath.ts +48 -0
  318. package/src/utility/utilityHelpers.buffer.ts +34 -0
  319. package/src/utility/utilityHelpers.noBuffer.ts +60 -0
  320. package/src/utility/utilityHelpers.ts +275 -0
  321. package/src/wab-client/WABClient.ts +94 -0
  322. package/src/wab-client/__tests/WABClient.man.test.ts +59 -0
  323. package/src/wab-client/auth-method-interactors/AuthMethodInteractor.ts +47 -0
  324. package/src/wab-client/auth-method-interactors/DevConsoleInteractor.ts +73 -0
  325. package/src/wab-client/auth-method-interactors/PersonaIDInteractor.ts +35 -0
  326. package/src/wab-client/auth-method-interactors/TwilioPhoneInteractor.ts +72 -0
  327. package/syncVersions.js +71 -0
  328. package/test/Wallet/StorageClient/storageClient.man.test.ts +75 -0
  329. package/test/Wallet/action/abortAction.test.ts +47 -0
  330. package/test/Wallet/action/createAction.test.ts +299 -0
  331. package/test/Wallet/action/createAction2.test.ts +1273 -0
  332. package/test/Wallet/action/createActionToGenerateBeefs.man.test.ts +293 -0
  333. package/test/Wallet/action/internalizeAction.a.test.ts +286 -0
  334. package/test/Wallet/action/internalizeAction.test.ts +682 -0
  335. package/test/Wallet/action/relinquishOutput.test.ts +37 -0
  336. package/test/Wallet/certificate/acquireCertificate.test.ts +298 -0
  337. package/test/Wallet/certificate/listCertificates.test.ts +346 -0
  338. package/test/Wallet/construct/Wallet.constructor.test.ts +57 -0
  339. package/test/Wallet/get/getHeaderForHeight.test.ts +82 -0
  340. package/test/Wallet/get/getHeight.test.ts +52 -0
  341. package/test/Wallet/get/getKnownTxids.test.ts +86 -0
  342. package/test/Wallet/get/getNetwork.test.ts +27 -0
  343. package/test/Wallet/get/getVersion.test.ts +27 -0
  344. package/test/Wallet/list/listActions.test.ts +279 -0
  345. package/test/Wallet/list/listActions2.test.ts +1381 -0
  346. package/test/Wallet/list/listCertificates.test.ts +118 -0
  347. package/test/Wallet/list/listOutputs.test.ts +447 -0
  348. package/test/Wallet/live/walletLive.man.test.ts +521 -0
  349. package/test/Wallet/local/localWallet.man.test.ts +93 -0
  350. package/test/Wallet/local/localWallet2.man.test.ts +277 -0
  351. package/test/Wallet/signAction/mountaintop.man.test.ts +130 -0
  352. package/test/Wallet/specOps/specOps.man.test.ts +220 -0
  353. package/test/Wallet/support/janitor.man.test.ts +40 -0
  354. package/test/Wallet/support/operations.man.test.ts +407 -0
  355. package/test/Wallet/support/reqErrorReview.2025.05.06.man.test.ts +347 -0
  356. package/test/Wallet/sync/Wallet.sync.test.ts +215 -0
  357. package/test/Wallet/sync/Wallet.updateWalletLegacyTestData.man.test.ts +203 -0
  358. package/test/Wallet/sync/setActive.test.ts +170 -0
  359. package/test/WalletClient/LocalKVStore.man.test.ts +114 -0
  360. package/test/WalletClient/WERR.man.test.ts +35 -0
  361. package/test/bsv-ts-sdk/LocalKVStore.test.ts +102 -0
  362. package/test/checkDB.ts +57 -0
  363. package/test/checkdb +0 -0
  364. package/test/examples/backup.man.test.ts +59 -0
  365. package/test/examples/pushdrop.test.ts +282 -0
  366. package/test/monitor/Monitor.test.ts +620 -0
  367. package/test/services/Services.test.ts +263 -0
  368. package/test/storage/KnexMigrations.test.ts +86 -0
  369. package/test/storage/StorageMySQLDojoReader.man.test.ts +60 -0
  370. package/test/storage/count.test.ts +177 -0
  371. package/test/storage/find.test.ts +195 -0
  372. package/test/storage/findLegacy.test.ts +67 -0
  373. package/test/storage/idb/allocateChange.test.ts +251 -0
  374. package/test/storage/idb/count.test.ts +158 -0
  375. package/test/storage/idb/find.test.ts +177 -0
  376. package/test/storage/idb/idbSpeed.test.ts +36 -0
  377. package/test/storage/idb/insert.test.ts +268 -0
  378. package/test/storage/idb/transactionAbort.test.ts +108 -0
  379. package/test/storage/idb/update.test.ts +999 -0
  380. package/test/storage/insert.test.ts +278 -0
  381. package/test/storage/update.test.ts +1021 -0
  382. package/test/storage/update2.test.ts +897 -0
  383. package/test/utils/TestUtilsWalletStorage.ts +2526 -0
  384. package/test/utils/localWalletMethods.ts +363 -0
  385. package/test/utils/removeFailedFromDatabase.sql +17 -0
  386. package/ts2md.json +44 -0
  387. package/tsconfig.all.json +31 -0
  388. package/tsconfig.client.json +29 -0
  389. package/tsconfig.json +17 -0
  390. package/tsconfig.mobile.json +28 -0
@@ -0,0 +1,10 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Bash(cat:*)",
5
+ "Bash(git -C /Users/satchmo/wallet-toolbox log --oneline -20 --all -- mobile/package.json)",
6
+ "Bash(git -C /Users/satchmo/wallet-toolbox log --oneline -5 --all -- \"*.npmignore\")",
7
+ "Bash(git -C /Users/satchmo/wallet-toolbox log --oneline)"
8
+ ]
9
+ }
10
+ }
package/.env.template ADDED
@@ -0,0 +1,22 @@
1
+ # set to empty if MySQL is available for testing and database schemas exist, set to 1 to not test against MySQL
2
+ NOMYSQL = 1
3
+ # set to empty to not run slow and long running tests. set to 1 to run them.
4
+ RUNSLOWTESTS =
5
+
6
+ # this will be getEnv('main').identityKey property value
7
+ MY_MAIN_IDENTITY = '028cb1d772b59157ee2d72cce30c515e4c3312e5e73ea111ff689dac88d93aaeb8'
8
+ # this will be getEnv('main').userId property value
9
+ MY_MAIN_USERID = 83
10
+
11
+ # this will be getEnv('test').identityKey property value
12
+ MY_TEST_IDENTITY = '03ac2d10bdb0023f4145cc2eba2fcd2ad3070cb2107b0b48170c46a9440e4cc3fe'
13
+ # this will be getEnv('test').userId property value
14
+ MY_TEST_USERID = 6
15
+
16
+ # JSON.stringified of object who's keys are identityKey values and the values are corresponding private keys.
17
+ DEV_KEYS = '{
18
+ "03ac2d10bdb0023f4145cc2eba2fcd2ad3070cb2107b0b48170c46a9440e4cc3fe": "<private key as 32 hex bytes>"
19
+ }'
20
+
21
+ NOMYSQL = 1
22
+ RUNSLOWTESTS =
@@ -0,0 +1,40 @@
1
+ ---
2
+ name: Bug Report
3
+ about: Report a bug or an issue you've found with `@bsv/sdk`.
4
+ title: "[BUG]"
5
+ labels: bug
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ ## Bug Description
11
+
12
+ Briefly describe the bug/issue you've encountered.
13
+
14
+ ## Steps to Reproduce
15
+
16
+ 1. Step 1
17
+ 2. Step 2
18
+ 3. ...
19
+
20
+ ## Expected Behavior
21
+
22
+ What should have happened if the bug hadn't occurred?
23
+
24
+ ## Actual Behavior
25
+
26
+ What actually happened?
27
+
28
+ ## Stack Traces or Screenshots
29
+
30
+ If applicable, add screenshots or stack traces to help explain the issue.
31
+
32
+ ## Environment
33
+
34
+ - OS: [e.g. MacOS, Windows]
35
+ - Node version: [e.g. 12.20]
36
+ - `@bsv/sdk` version: [e.g. 1.2.3]
37
+
38
+ ## Additional Information
39
+
40
+ Provide any additional context or information about the bug.
@@ -0,0 +1,24 @@
1
+ ---
2
+ name: Discussion
3
+ about: Propose a discussion or seek clarification about a feature or topic.
4
+ title: "[DISCUSSION]"
5
+ labels: discussion
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ ## Summary
11
+
12
+ Briefly describe the topic you'd like to discuss.
13
+
14
+ ## Motivation
15
+
16
+ Why do you believe this to be important?
17
+
18
+ ## Description
19
+
20
+ Provide a detailed description or elaborate on your topic.
21
+
22
+ ## Additional References
23
+
24
+ Provide any additional articles, links, or context that would help facilitate the discussion.
@@ -0,0 +1,22 @@
1
+ ## Description of Changes
2
+
3
+ Provide a brief description of the changes you've made.
4
+
5
+ ## Linked Issues / Tickets
6
+
7
+ Reference any related issues or tickets, e.g. "Closes #123".
8
+
9
+ ## Testing Procedure
10
+
11
+ Describe the tests you've added or any testing steps you've taken.
12
+
13
+ - [ ] I have added new unit tests
14
+ - [ ] All tests pass locally
15
+ - [ ] I have tested manually in my local environment
16
+
17
+ ## Checklist:
18
+
19
+ - [ ] I have performed a self-review of my own code
20
+ - [ ] I have made corresponding changes to the documentation
21
+ - [ ] I have run `npm run doc` and `npm run lint` one final time before requesting a review
22
+ - [ ] I have run `npm version patch` so that my changes will trigger a new version to be released when they are merged
@@ -0,0 +1,145 @@
1
+ name: Test and Publish Package
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - master
7
+ - main
8
+ pull_request:
9
+
10
+ permissions:
11
+ id-token: write # Required for OIDC
12
+ contents: read
13
+
14
+ jobs:
15
+ test:
16
+ runs-on: ubuntu-latest
17
+ strategy:
18
+ matrix:
19
+ node-version: [20, 22, 24]
20
+ steps:
21
+ - uses: actions/checkout@v4
22
+
23
+ - uses: actions/setup-node@v4
24
+ with:
25
+ node-version: ${{ matrix.node-version }}
26
+
27
+ - run: npm ci
28
+ - run: npm run build --if-present
29
+ - run: npm test
30
+
31
+ publish:
32
+ runs-on: ubuntu-latest
33
+ needs: test
34
+ # Only run on push to master/main, not on PRs
35
+ if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main')
36
+ steps:
37
+ - uses: actions/checkout@v4
38
+
39
+ - uses: actions/setup-node@v4
40
+ with:
41
+ node-version: '24'
42
+ registry-url: 'https://registry.npmjs.org'
43
+ always-auth: false
44
+
45
+ - run: npm ci
46
+ - run: npm run build --if-present
47
+
48
+ - name: Sync client version with root
49
+ run: |
50
+ ROOT_VERSION=$(node -p "require('./package.json').version")
51
+ cd client
52
+ npm version $ROOT_VERSION --no-git-tag-version --allow-same-version
53
+ cd ..
54
+
55
+ - name: Sync mobile version with root
56
+ run: |
57
+ ROOT_VERSION=$(node -p "require('./package.json').version")
58
+ cd mobile
59
+ npm version $ROOT_VERSION --no-git-tag-version --allow-same-version
60
+ cd ..
61
+
62
+ - name: Check if root version already published
63
+ id: check-root-version
64
+ run: |
65
+ PACKAGE_NAME=$(node -p "require('./package.json').name")
66
+ PACKAGE_VERSION=$(node -p "require('./package.json').version")
67
+
68
+ echo "Root Package: $PACKAGE_NAME@$PACKAGE_VERSION"
69
+
70
+ # Check if this version exists on npm
71
+ if npm view "$PACKAGE_NAME@$PACKAGE_VERSION" version 2>/dev/null; then
72
+ echo "Root version $PACKAGE_VERSION already published"
73
+ echo "should_publish_root=false" >> $GITHUB_OUTPUT
74
+ else
75
+ echo "Root version $PACKAGE_VERSION not yet published"
76
+ echo "should_publish_root=true" >> $GITHUB_OUTPUT
77
+ fi
78
+
79
+ - name: Publish root to npm
80
+ if: steps.check-root-version.outputs.should_publish_root == 'true'
81
+ run: npm publish --access public
82
+
83
+ - name: Skip publishing root
84
+ if: steps.check-root-version.outputs.should_publish_root == 'false'
85
+ run: echo "Skipping publish root - version already exists on npm"
86
+
87
+ - name: Check if client version already published
88
+ id: check-client-version
89
+ run: |
90
+ cd client
91
+ PACKAGE_NAME=$(node -p "require('./package.json').name")
92
+ PACKAGE_VERSION=$(node -p "require('./package.json').version")
93
+
94
+ echo "Client Package: $PACKAGE_NAME@$PACKAGE_VERSION"
95
+
96
+ # Check if this version exists on npm
97
+ if npm view "$PACKAGE_NAME@$PACKAGE_VERSION" version 2>/dev/null; then
98
+ echo "Client version $PACKAGE_VERSION already published"
99
+ echo "should_publish_client=false" >> $GITHUB_OUTPUT
100
+ else
101
+ echo "Client version $PACKAGE_VERSION not yet published"
102
+ echo "should_publish_client=true" >> $GITHUB_OUTPUT
103
+ fi
104
+ cd ..
105
+
106
+ - name: Publish client to npm
107
+ if: steps.check-client-version.outputs.should_publish_client == 'true'
108
+ run: |
109
+ cd client
110
+ npm publish --access public
111
+ cd ..
112
+
113
+ - name: Skip publishing client
114
+ if: steps.check-client-version.outputs.should_publish_client == 'false'
115
+ run: echo "Skipping publish client - version already exists on npm"
116
+
117
+ - name: Check if mobile version already published
118
+ id: check-mobile-version
119
+ run: |
120
+ cd mobile
121
+ PACKAGE_NAME=$(node -p "require('./package.json').name")
122
+ PACKAGE_VERSION=$(node -p "require('./package.json').version")
123
+
124
+ echo "Mobile Package: $PACKAGE_NAME@$PACKAGE_VERSION"
125
+
126
+ # Check if this version exists on npm
127
+ if npm view "$PACKAGE_NAME@$PACKAGE_VERSION" version 2>/dev/null; then
128
+ echo "Mobile version $PACKAGE_VERSION already published"
129
+ echo "should_publish_mobile=false" >> $GITHUB_OUTPUT
130
+ else
131
+ echo "Mobile version $PACKAGE_VERSION not yet published"
132
+ echo "should_publish_mobile=true" >> $GITHUB_OUTPUT
133
+ fi
134
+ cd ..
135
+
136
+ - name: Publish mobile to npm
137
+ if: steps.check-mobile-version.outputs.should_publish_mobile == 'true'
138
+ run: |
139
+ cd mobile
140
+ npm publish --access public
141
+ cd ..
142
+
143
+ - name: Skip publishing mobile
144
+ if: steps.check-mobile-version.outputs.should_publish_mobile == 'false'
145
+ run: echo "Skipping publish mobile - version already exists on npm"
package/.prettierrc ADDED
@@ -0,0 +1,10 @@
1
+ {
2
+ "semi": false,
3
+ "singleQuote": true,
4
+ "trailingComma": "none",
5
+ "arrowParens": "avoid",
6
+ "printWidth": 120,
7
+ "tabWidth": 2,
8
+ "useTabs": false,
9
+ "endOfLine": "lf"
10
+ }
package/CHANGELOG.md ADDED
@@ -0,0 +1,280 @@
1
+ # wallet-toolbox Significant Changes History
2
+
3
+ This document captures the history of significant changes to the wallet-toolbox repository.
4
+ The git commit history contains the details but is unable to draw
5
+ attention to changes that materially alter behavior or extend functionality.
6
+
7
+ ## wallet-toolbox 1.7.18
8
+
9
+ - Fork published under @bopen-io scope as @bopen-io/wallet-toolbox
10
+ - Also publishes @bopen-io/wallet-toolbox-client and @bopen-io/wallet-toolbox-mobile
11
+
12
+ ## wallet-toolbox 1.7.17
13
+
14
+ - Fix push.yaml to sync versions, correct root package contents (no mobile), and publish client and mobile
15
+
16
+ ## wallet-toolbox 1.7.15
17
+
18
+ - Fix specOpInvalidChange to always ignore unbasketted outputs.
19
+ - Update dependency to bsv/sdk 1.9.24
20
+
21
+ ## wallet-toolbox 1.7.13
22
+
23
+ - Fix moreSatoshisNeeded amount in WERR_INSUFFICIENT_FUNDS (was releasing allocated change before saving value).
24
+
25
+ ## wallet-toolbox 1.7.12
26
+
27
+ - Add pluggable permissions module system (`PermissionsModule` interface) for custom P-basket and P-protocol handlers
28
+ - Add `permissionModules` config option to `WalletPermissionsManager` for registering scheme-specific modules
29
+ - Support request/response transformation chaining across multiple modules
30
+ - Add comprehensive test suite covering P-module delegation, chaining, and error handling
31
+
32
+ ## wallet-toolbox 1.7.11
33
+
34
+ - Change logging tweaks.
35
+
36
+ ## wallet-toolbox 1.7.6
37
+
38
+ - Change `WalletLogger` json name from logs[0]
39
+
40
+ ## wallet-toolbox 1.7.5
41
+
42
+ - Add `WalletLogger` flushFormat property.
43
+
44
+ ## wallet-toolbox 1.7.4
45
+
46
+ - Really Add `WalletLogger` to package exports (client, and complete).
47
+
48
+ (Still have to update top level index.all importing index.client importing index.mobile).
49
+
50
+ ## wallet-toolbox 1.7.3
51
+
52
+ - Add `WalletLogger` to package exports (mobile, client, and complete).
53
+
54
+ ## wallet-toolbox 1.7.2
55
+
56
+ - Add `WalletLogger` aggregate logger class for use by `Wallet`, `StorageClient` and `StorageServer`,
57
+ implementing the `WalletLoggerInterface` released in latest `@bsv/sdk`.
58
+ - Delete `validationHelpers.ts` from `sdk` folder and update code to reference functions and types moved to
59
+ `Validation` namespace exported from `@bsv/sdk`.
60
+
61
+ ## wallet-toolbox 1.7.1
62
+
63
+ - Add optional skipInvalidProofs to StorageGetBeefOptions
64
+
65
+ ## wallet-toolbox 1.7.0
66
+
67
+ - Update dependency to @bsv/sdk 1.9.3, makinig this new version a minor bump as well
68
+ - Add optional chaintracker to StorageGetBeefOptions
69
+ - Add WERR_INVALID_MERKLE_ROOT exception (code 8).
70
+ - Change add spendable value to WERR_INVALID_PARAMETER message thrown by createAction
71
+
72
+ ## wallet-toolbox 1.6.43
73
+
74
+ - Change WERR toJson methods to add code property for HTTPWalletJSON rethrow support.
75
+
76
+ ## wallet-toolbox 1.6.42
77
+
78
+ - Change WalletPermissionsManager changes
79
+
80
+ ## wallet-toolbox 1.6.41
81
+
82
+ - Change WalletPermissionsManager changes
83
+
84
+ ## wallet-toolbox 1.6.40
85
+
86
+ - Change correct import of WERR_REVIEW_ACTIONS in createActions.ts to wallet-toolbox package.
87
+
88
+ ## wallet-toolbox 1.6.39
89
+
90
+ - Change WalletError unknownToJson error to resolve unknown toJson error.
91
+
92
+ ## wallet-toolbox 1.6.38
93
+
94
+ - Update to @bsv/sdk 1.8.10
95
+
96
+ ## wallet-toolbox 1.6.37
97
+
98
+ - Change validationHelpers validateBase64String now polynomial time, sync changes on bsv/sdk
99
+ - Change log throw of dummy WERR_REVIEW_ACTIONS.
100
+
101
+ ## wallet-toolbox 1.6.35
102
+
103
+ - Change specOp WERR_REVIEW_ACTIONS throw to storage layer.
104
+
105
+ ## wallet-toolbox 1.6.34
106
+
107
+ - Change StorageServer / StorageClient to rethrow WERR errors including WERR_REVIEW_ACTIONS
108
+ - Change ChaintracksChainTracker to default to new public services.
109
+ - Add WalletError.test.ts and resolve issues related to WERR_errors
110
+ - Add retry support to ChaintracksFetch download method to handle WoC rate limits.
111
+
112
+ ## wallet-toolbox 1.6.33
113
+
114
+ - Add schema migration: outputs spendable index.
115
+
116
+ ## wallet-toolbox 1.6.31
117
+
118
+ - Change throw WERR_REVIEW_ACTIONS if an input's spentBy is valid
119
+
120
+ ## wallet-toolbox 1.6.30
121
+
122
+ - Add txid index to proven_tx_reqs table in storage knex schema
123
+
124
+ ## wallet-toolbox 1.6.29
125
+
126
+ - Add txid index to transactions table in storage knex schema
127
+
128
+ ## wallet-toolbox 1.6.28
129
+
130
+ - Fix The method `Services`.`getHeaderForHeight` must serialize four byte values LE
131
+
132
+ ## wallet-toolbox 1.6.27
133
+
134
+ - Change internalizeAction Improve handling of atomic beefs containing transactions unknown to storage.
135
+
136
+ ## wallet-toolbox 1.6.26
137
+
138
+ - Update to @bsv/sdk 1.8.2
139
+
140
+ ## wallet-toolbox 1.6.25
141
+
142
+ - Change `WalletPermissionsManager` coalescePermissionTokens logic
143
+
144
+ ## wallet-toolbox 1.6.24
145
+
146
+ - Add Monitor TaskReorg to handle Chaintracks reorg events, updating ProvenTxs with new merkle proofs.
147
+ - Add deactivatedHeaders as optional 4th param to `ReorgListener` in `ChaintracksClientApi`
148
+ - Add `ChaintracksStorageApi` `InsertHeaderResult` now includes deactivatedHeaders
149
+ - Add `createKnexChaintracks` exported function.
150
+ - Add `createNoDbChaintracks` exported function.
151
+ - Add `index.mobile.ts` to Chaintracks
152
+
153
+ - Change `validBulkHeaderFilesByFileHash` updated for 2025-10-06 Babbage CDN update.
154
+
155
+ ## wallet-toolbox 1.6.22
156
+
157
+ - Change verifyTruthy => validateSatoshis during input validation for createAction.
158
+
159
+ ## wallet-toolbox 1.6.20
160
+
161
+ - Add DevConsoleInteractor
162
+
163
+ ## wallet-toolbox 1.6.6
164
+
165
+ - Add robots.txt to StorageServer
166
+
167
+ ## wallet-toolbox 1.6.5
168
+
169
+ - Add ChaintracksStorageIdb to support in browser header storage.
170
+ - Cleanup createDefaultWalletServicesOptions, add comments.
171
+ - Some breaking API changes to Chaintracks storage and ingestors.
172
+
173
+ ## wallet-toolbox 1.6.4
174
+
175
+ - Resolve client dependencies for metanet-desktop, exclude ChaintracksService and Ws ingestors.
176
+
177
+ ## wallet-toolbox 1.6.3
178
+
179
+ - Resolve client dependencies for metanet-desktop
180
+
181
+ ## wallet-toolbox 1.6.2
182
+
183
+ - Change defaul chaintracksUrl from npm-registry.babbage.systems to ${chain}net-chaintracks.babbage.systems
184
+
185
+ ## wallet-toolbox 1.6.1
186
+
187
+ - Add initial port/re-implementation of Chaintracks
188
+
189
+ ## wallet-toolbox 1.5.21
190
+
191
+ - Add support for listOutputs with negative offsets. (Sorts newest first, offset -1 is newest output).
192
+
193
+ ## wallet-toolbox 1.5.10
194
+
195
+ - Add automatic request timeouts and deprioritization of postBeef services.
196
+
197
+ ## wallet-toolbox 1.5.7
198
+
199
+ - One-off authorizations are no longer cached, ensuring they can only be used once.
200
+
201
+ ## wallet-toolbox 1.5.0
202
+
203
+ - update to @bsv/sdk 1.6.8 and @bsv/auth-express-middleware 1.2.0 (Which include VarInt support for negative numbers, making it a breaking change)
204
+
205
+ ## wallet-toolbox 1.4.10
206
+
207
+ - when spending non-change outputs, atomically tests spendable before setting to spent.
208
+ - change unbasketted new outputs to spendable
209
+ - updated WalletStorageManager to use lockQueues for read/write/sync/sp scheduling
210
+
211
+ ## wallet-toolbox 1.4.7
212
+
213
+ - update to bsv/sdk 1.6.5
214
+ - add BHSServiceClient which allows for leaning on BlockHeadersService for chain tracking.
215
+ - add ARC callbackURL and callbackToken to createDefaultWalletServiceOptions
216
+
217
+ ## wallet-toolbox 1.4.?
218
+
219
+ - Only check for proofs when TaskNewHeader sets checkNow, tightens up control of required delay.
220
+
221
+ ## wallet-toolbox 1.4.3
222
+
223
+ - update monitor logging
224
+
225
+ ## wallet-toolbox 1.4.2
226
+
227
+ - update monitor TaskNewHeader, TaskCheckForProofs to ignore bleeding edge new blocks and proofs.
228
+
229
+ ## wallet-toolbox 1.4.1
230
+
231
+ - update to bsv/sdk 1.6.0 with reworked bignum and memory / performance improvements.
232
+
233
+ ## wallet-toolbox 1.3.32
234
+
235
+ - add permissions caching (5 minutes)
236
+
237
+ ## wallet-toolbox 1.3.30
238
+
239
+ - Enable gorillaPoolArc for postBeef Services
240
+ - Switch Services postBeef multi-service mode from 'PromiseAll' to 'UntilSuccess'
241
+
242
+ ## wallet-toolbox 1.3.29
243
+
244
+ - add verifyUnlockScripts to both createAction and signAction flows
245
+
246
+ ## wallet-toolbox 1.3.28
247
+
248
+ - adminStats now includes monitorStats and servicesStats of type ServicesCallHistory (wallet-toolbox/src/sdk/WalletServices.interfaces.ts)
249
+ - both sets of stats break down service calls by providers including both recent calls and interval based statistics.
250
+ - monitorStats correspond to service requests made by the active Monitor daemon. This includes “delayed” createActions. Intervals are currently 12 minutes.
251
+ - servicesStats corresponds to the service requests made by the StorageProvider service. This includes “non-delayed” createActions. Intervals are determined by rate of calls to adminStats, each call starts a new interval.
252
+
253
+ ## wallet-toolbox 1.3.25
254
+
255
+ - throws INVALID_PARAMETER if a createAction input is a change output.
256
+ - logging and potential fix for internalizeAction bug.
257
+ - adds gorillaPool to Services but leaves it disabled for now.
258
+ - adds service call history logging to Monitor Events table, but not yet tied in to adminStats return value.
259
+ - StorageProvider level “find” entity methods now support additional optional orderDescending boolean.
260
+
261
+ ## wallet-toolbox v1.3.4, 2025-04-24
262
+
263
+ ### Add StorageIdb
264
+
265
+ Adds support for `indexedDB` based wallet storage via the new `StorageIdb` `StorageProvider` class and a new `SetupClient` class.
266
+
267
+ ## wallet-toolbox v1.3.0, 2025-04-23
268
+
269
+ ### Change in Handling of New Outputs NOT Assigned to a Basket
270
+
271
+ New outputs created by `createAction` / `signAction` that are NOT assigned to a basket are considered immediately SPENT.
272
+
273
+ Implications:
274
+
275
+ - Outputs transferred to a second party, either through internalizeAction or custom means, MUST NOT be assigned to a basket
276
+ as this allows them to be spent without your wallet being notified that they are no longer spendable. This is a usage guideline, it is not enforced.
277
+ - These outputs will NOT be returned by `listOutputs`, as it only returns spendable outputs.
278
+ - These outputs WILL be returned by `listActions` with the includeOutputs option set to true.
279
+ - Your wallet will mark any output you include as inputs in your own transactions as spent at the time of transaction creation.
280
+ - If a created transaction subsequently fails to be broadcast (abandoned or invalid), the outputs are reset to spendable. This may not happen immediately.
@@ -0,0 +1,89 @@
1
+ # CONTRIBUTING to `@bsv/wallet-toolbox`
2
+
3
+ Thank you for considering contributing to the BSV Blockchain Libraries Project! This document outlines the processes and practices we expect contributors to adhere to.
4
+
5
+ ## Table of Contents
6
+
7
+ - [CONTRIBUTING to `@bsv/wallet-toolbox`](#contributing-to-bsvwallet-toolbox)
8
+ - [Table of Contents](#table-of-contents)
9
+ - [General Guidelines](#general-guidelines)
10
+ - [Code of Conduct](#code-of-conduct)
11
+ - [Posting Issues and Comments](#posting-issues-and-comments)
12
+ - [Coding and PRs](#coding-and-prs)
13
+ - [Getting Started](#getting-started)
14
+ - [Pull Request Process](#pull-request-process)
15
+ - [Coding Conventions](#coding-conventions)
16
+ - [Documentation and Testing](#documentation-and-testing)
17
+ - [Contact \& Support](#contact--support)
18
+
19
+ ## General Guidelines
20
+
21
+ - **Issues First**: If you're planning to add a new feature or change existing behavior, please open an issue first. This allows us to avoid multiple people working on similar features and provides a place for discussion.
22
+
23
+ - **Stay Updated**: Always pull the latest changes from the main branch before creating a new branch or starting on new code.
24
+
25
+ - **Simplicity Over Complexity**: Your solution should be as simple as possible, given the requirements.
26
+
27
+ ## Code of Conduct
28
+
29
+ ### Posting Issues and Comments
30
+
31
+ - **Be Respectful**: Everyone is here to help and grow. Avoid any language that might be considered rude or offensive.
32
+
33
+ - **Be Clear and Concise**: Always be clear about what you're suggesting or reporting. If an issue is related to a particular piece of code or a specific error message, include that in your comment.
34
+
35
+ - **Stay On Topic**: Keep the conversation relevant to the issue at hand. If you have a new idea or unrelated question, please open a new issue.
36
+
37
+ ### Coding and PRs
38
+
39
+ - **Stay Professional**: Avoid including "fun" code, comments, or irrelevant file changes in your commits and pull requests.
40
+
41
+ ## Getting Started
42
+
43
+ 1. **Fork the Repository**: Click on the "Fork" button at the top-right corner of this repository.
44
+
45
+ 2. **Clone the Forked Repository**: `git clone https://github.com/YOUR_USERNAME/wallet-toolbox.git`
46
+
47
+ 3. **Navigate to the Directory**: `cd wallet-toolbox`
48
+
49
+ 4. **Install Dependencies**: Since we maintain all code within this library, there shouldn't be any runtime dependencies. Nevertheless, always run `npm install` after pulling to ensure tooling is up to date.
50
+
51
+ ## Pull Request Process
52
+
53
+ 1. **Create a Branch**: For every new feature or bugfix, create a new branch.
54
+
55
+ 2. **Commit Your Changes**: Make your changes and commit them. Commit messages should be clear and concise to explain what was done.
56
+
57
+ 3. **Run Tests**: Ensure all tests pass using Jest: `npm test`.
58
+
59
+ 4. **Documentation**: All code must be fully annotated with comments. Update the documentation by running `npm run doc` before creating a pull request.
60
+
61
+ 5. **Push to Your Fork**: `git push origin your-new-branch`.
62
+
63
+ 6. **Open a Pull Request**: Go to your fork on GitHub and click "New Pull Request". Fill out the PR template, explaining your changes.
64
+
65
+ 7. **Code Review**: At least two maintainers must review and approve the PR before it's merged. Address any feedback or changes requested.
66
+
67
+ 8. **Merge**: Once approved, the PR will be merged into the main branch.
68
+
69
+ ## Coding Conventions
70
+
71
+ - **Code Style**: We use `ts-standard` for our TypeScript coding style. Run `npm run lint` to ensure your code adheres to this style.
72
+
73
+ - **No Runtime Dependencies**: All code should be maintained within this library. Do not introduce external dependencies.
74
+
75
+ - **Testing**: Always include tests for new code or changes. We aim for industry-standard levels of test coverage.
76
+
77
+ - **Documentation**: All functions, classes, and modules should be documented. Use annotation comments to describe the purpose, parameters, and return values.
78
+
79
+ ## Documentation and Testing
80
+
81
+ - **Documentation**: Update the documentation whenever you add or modify the code. Run `npm run doc` to generate the latest docs.
82
+
83
+ - **Testing**: We use Jest for all tests. Write comprehensive tests, ensuring edge cases are covered. All PRs should maintain or improve the current test coverage.
84
+
85
+ ## Contact & Support
86
+
87
+ If you have any questions or need assistance with your contributions, feel free to reach out. Remember, we're here to help each other grow and improve the `@bsv/wallet-toolbox`.
88
+
89
+ Thank you for being a part of this journey. Your contributions help shape the future of the BSV Blockchain Libraries Project!
package/README.md ADDED
@@ -0,0 +1,43 @@
1
+ # BSV WALLET TOOLBOX
2
+
3
+ BSV BLOCKCHAIN | BRC100 Conforming Wallet, Wallet Storage and Wallet Signer Components
4
+
5
+ ## Objective
6
+
7
+ The BSV Wallet Toolbox builds on the [SDK](https://bsv-blockchain.github.io/ts-sdk).
8
+
9
+ It aims to support building sophisticated applications and services on the BSV Blockchain technology stack.
10
+
11
+ By providing interlocking building blocks for persistent storage and protocol based key derivation, it serves as an essential toolbox for developers looking to build on the BSV Blockchain.
12
+
13
+ ## Documentation
14
+
15
+ [The Docs](https://bsv-blockchain.github.io/wallet-toolbox) are available here on Github pages.
16
+
17
+ The Toolbox is richly documented with code-level annotations. This should show up well within editors like VSCode.
18
+
19
+ ## Contribution Guidelines
20
+
21
+ We're always looking for contributors to help us improve the SDK. Whether it's bug reports, feature requests, or pull requests - all contributions are welcome.
22
+
23
+ 1. **Fork & Clone**: Fork this repository and clone it to your local machine.
24
+ 2. **Set Up**: Run `npm install` to install all dependencies.
25
+ 3. **Make Changes**: Create a new branch and make your changes.
26
+ 4. **Test**: Ensure all tests pass by running `npm test`.
27
+ 5. **Commit**: Commit your changes and push to your fork.
28
+ 6. **Pull Request**: Open a pull request from your fork to this repository.
29
+ For more details, check the [contribution guidelines](./CONTRIBUTING.md).
30
+
31
+ ## Support & Contacts
32
+
33
+ Project Owners: Thomas Giacomo and Darren Kellenschwiler
34
+
35
+ Development Team Lead: Ty Everett
36
+
37
+ For questions, bug reports, or feature requests, please open an issue on GitHub or contact us directly.
38
+
39
+ ## License
40
+
41
+ The license for the code in this repository is the Open BSV License. Refer to [LICENSE.txt](./LICENSE.txt) for the license text.
42
+
43
+ Thank you for being a part of the BSV Blockchain Libraries Project. Let's build the future of BSV Blockchain together!