@bsv/wallet-toolbox 1.3.20 → 1.3.22

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 (517) hide show
  1. package/.github/workflows/push.yaml +5 -0
  2. package/mobile/out/src/CWIStyleWalletManager.d.ts +437 -0
  3. package/mobile/out/src/CWIStyleWalletManager.d.ts.map +1 -0
  4. package/mobile/out/src/CWIStyleWalletManager.js +1255 -0
  5. package/mobile/out/src/CWIStyleWalletManager.js.map +1 -0
  6. package/mobile/out/src/SetupClient.d.ts +126 -0
  7. package/mobile/out/src/SetupClient.d.ts.map +1 -0
  8. package/mobile/out/src/SetupClient.js +220 -0
  9. package/mobile/out/src/SetupClient.js.map +1 -0
  10. package/mobile/out/src/SetupWallet.d.ts +100 -0
  11. package/mobile/out/src/SetupWallet.d.ts.map +1 -0
  12. package/mobile/out/src/SetupWallet.js +3 -0
  13. package/mobile/out/src/SetupWallet.js.map +1 -0
  14. package/mobile/out/src/SimpleWalletManager.d.ts +169 -0
  15. package/mobile/out/src/SimpleWalletManager.d.ts.map +1 -0
  16. package/mobile/out/src/SimpleWalletManager.js +315 -0
  17. package/mobile/out/src/SimpleWalletManager.js.map +1 -0
  18. package/mobile/out/src/Wallet.d.ts +177 -0
  19. package/mobile/out/src/Wallet.d.ts.map +1 -0
  20. package/mobile/out/src/Wallet.js +742 -0
  21. package/mobile/out/src/Wallet.js.map +1 -0
  22. package/mobile/out/src/WalletAuthenticationManager.d.ts +33 -0
  23. package/mobile/out/src/WalletAuthenticationManager.d.ts.map +1 -0
  24. package/mobile/out/src/WalletAuthenticationManager.js +113 -0
  25. package/mobile/out/src/WalletAuthenticationManager.js.map +1 -0
  26. package/mobile/out/src/WalletPermissionsManager.d.ts +598 -0
  27. package/mobile/out/src/WalletPermissionsManager.d.ts.map +1 -0
  28. package/mobile/out/src/WalletPermissionsManager.js +1868 -0
  29. package/mobile/out/src/WalletPermissionsManager.js.map +1 -0
  30. package/mobile/out/src/WalletSettingsManager.d.ts +52 -0
  31. package/mobile/out/src/WalletSettingsManager.d.ts.map +1 -0
  32. package/mobile/out/src/WalletSettingsManager.js +82 -0
  33. package/mobile/out/src/WalletSettingsManager.js.map +1 -0
  34. package/mobile/out/src/index.client.d.ts +19 -0
  35. package/mobile/out/src/index.client.d.ts.map +1 -0
  36. package/mobile/out/src/index.client.js +58 -0
  37. package/mobile/out/src/index.client.js.map +1 -0
  38. package/mobile/out/src/index.mobile.d.ts +19 -0
  39. package/mobile/out/src/index.mobile.d.ts.map +1 -0
  40. package/mobile/out/src/index.mobile.js +58 -0
  41. package/mobile/out/src/index.mobile.js.map +1 -0
  42. package/mobile/out/src/monitor/Monitor.d.ts +91 -0
  43. package/mobile/out/src/monitor/Monitor.d.ts.map +1 -0
  44. package/mobile/out/src/monitor/Monitor.js +298 -0
  45. package/mobile/out/src/monitor/Monitor.js.map +1 -0
  46. package/mobile/out/src/monitor/tasks/TaskCheckForProofs.d.ts +53 -0
  47. package/mobile/out/src/monitor/tasks/TaskCheckForProofs.d.ts.map +1 -0
  48. package/mobile/out/src/monitor/tasks/TaskCheckForProofs.js +194 -0
  49. package/mobile/out/src/monitor/tasks/TaskCheckForProofs.js.map +1 -0
  50. package/mobile/out/src/monitor/tasks/TaskCheckNoSends.d.ts +33 -0
  51. package/mobile/out/src/monitor/tasks/TaskCheckNoSends.d.ts.map +1 -0
  52. package/mobile/out/src/monitor/tasks/TaskCheckNoSends.js +65 -0
  53. package/mobile/out/src/monitor/tasks/TaskCheckNoSends.js.map +1 -0
  54. package/mobile/out/src/monitor/tasks/TaskClock.d.ts +14 -0
  55. package/mobile/out/src/monitor/tasks/TaskClock.d.ts.map +1 -0
  56. package/mobile/out/src/monitor/tasks/TaskClock.js +27 -0
  57. package/mobile/out/src/monitor/tasks/TaskClock.js.map +1 -0
  58. package/mobile/out/src/monitor/tasks/TaskFailAbandoned.d.ts +20 -0
  59. package/mobile/out/src/monitor/tasks/TaskFailAbandoned.d.ts.map +1 -0
  60. package/mobile/out/src/monitor/tasks/TaskFailAbandoned.js +52 -0
  61. package/mobile/out/src/monitor/tasks/TaskFailAbandoned.js.map +1 -0
  62. package/mobile/out/src/monitor/tasks/TaskNewHeader.d.ts +15 -0
  63. package/mobile/out/src/monitor/tasks/TaskNewHeader.d.ts.map +1 -0
  64. package/mobile/out/src/monitor/tasks/TaskNewHeader.js +43 -0
  65. package/mobile/out/src/monitor/tasks/TaskNewHeader.js.map +1 -0
  66. package/mobile/out/src/monitor/tasks/TaskPurge.d.ts +45 -0
  67. package/mobile/out/src/monitor/tasks/TaskPurge.d.ts.map +1 -0
  68. package/mobile/out/src/monitor/tasks/TaskPurge.js +34 -0
  69. package/mobile/out/src/monitor/tasks/TaskPurge.js.map +1 -0
  70. package/mobile/out/src/monitor/tasks/TaskReviewStatus.d.ts +26 -0
  71. package/mobile/out/src/monitor/tasks/TaskReviewStatus.d.ts.map +1 -0
  72. package/mobile/out/src/monitor/tasks/TaskReviewStatus.js +43 -0
  73. package/mobile/out/src/monitor/tasks/TaskReviewStatus.js.map +1 -0
  74. package/mobile/out/src/monitor/tasks/TaskSendWaiting.d.ts +35 -0
  75. package/mobile/out/src/monitor/tasks/TaskSendWaiting.d.ts.map +1 -0
  76. package/mobile/out/src/monitor/tasks/TaskSendWaiting.js +107 -0
  77. package/mobile/out/src/monitor/tasks/TaskSendWaiting.js.map +1 -0
  78. package/mobile/out/src/monitor/tasks/TaskSyncWhenIdle.d.ts +12 -0
  79. package/mobile/out/src/monitor/tasks/TaskSyncWhenIdle.d.ts.map +1 -0
  80. package/mobile/out/src/monitor/tasks/TaskSyncWhenIdle.js +22 -0
  81. package/mobile/out/src/monitor/tasks/TaskSyncWhenIdle.js.map +1 -0
  82. package/mobile/out/src/monitor/tasks/TaskUnFail.d.ts +41 -0
  83. package/mobile/out/src/monitor/tasks/TaskUnFail.d.ts.map +1 -0
  84. package/mobile/out/src/monitor/tasks/TaskUnFail.js +144 -0
  85. package/mobile/out/src/monitor/tasks/TaskUnFail.js.map +1 -0
  86. package/mobile/out/src/monitor/tasks/WalletMonitorTask.d.ts +40 -0
  87. package/mobile/out/src/monitor/tasks/WalletMonitorTask.d.ts.map +1 -0
  88. package/mobile/out/src/monitor/tasks/WalletMonitorTask.js +37 -0
  89. package/mobile/out/src/monitor/tasks/WalletMonitorTask.js.map +1 -0
  90. package/mobile/out/src/sdk/CertOpsWallet.d.ts +7 -0
  91. package/mobile/out/src/sdk/CertOpsWallet.d.ts.map +1 -0
  92. package/mobile/out/src/sdk/CertOpsWallet.js +3 -0
  93. package/mobile/out/src/sdk/CertOpsWallet.js.map +1 -0
  94. package/mobile/out/src/sdk/PrivilegedKeyManager.d.ts +125 -0
  95. package/mobile/out/src/sdk/PrivilegedKeyManager.d.ts.map +1 -0
  96. package/mobile/out/src/sdk/PrivilegedKeyManager.js +293 -0
  97. package/mobile/out/src/sdk/PrivilegedKeyManager.js.map +1 -0
  98. package/mobile/out/src/sdk/WERR_errors.d.ts +115 -0
  99. package/mobile/out/src/sdk/WERR_errors.d.ts.map +1 -0
  100. package/mobile/out/src/sdk/WERR_errors.js +158 -0
  101. package/mobile/out/src/sdk/WERR_errors.js.map +1 -0
  102. package/mobile/out/src/sdk/WalletError.d.ts +44 -0
  103. package/mobile/out/src/sdk/WalletError.d.ts.map +1 -0
  104. package/mobile/out/src/sdk/WalletError.js +118 -0
  105. package/mobile/out/src/sdk/WalletError.js.map +1 -0
  106. package/mobile/out/src/sdk/WalletServices.interfaces.d.ts +430 -0
  107. package/mobile/out/src/sdk/WalletServices.interfaces.d.ts.map +1 -0
  108. package/mobile/out/src/sdk/WalletServices.interfaces.js +3 -0
  109. package/mobile/out/src/sdk/WalletServices.interfaces.js.map +1 -0
  110. package/mobile/out/src/sdk/WalletSigner.interfaces.d.ts +10 -0
  111. package/mobile/out/src/sdk/WalletSigner.interfaces.d.ts.map +1 -0
  112. package/mobile/out/src/sdk/WalletSigner.interfaces.js +3 -0
  113. package/mobile/out/src/sdk/WalletSigner.interfaces.js.map +1 -0
  114. package/mobile/out/src/sdk/WalletStorage.interfaces.d.ts +452 -0
  115. package/mobile/out/src/sdk/WalletStorage.interfaces.d.ts.map +1 -0
  116. package/mobile/out/src/sdk/WalletStorage.interfaces.js +3 -0
  117. package/mobile/out/src/sdk/WalletStorage.interfaces.js.map +1 -0
  118. package/mobile/out/src/sdk/index.d.ts +10 -0
  119. package/mobile/out/src/sdk/index.d.ts.map +1 -0
  120. package/mobile/out/src/sdk/index.js +26 -0
  121. package/mobile/out/src/sdk/index.js.map +1 -0
  122. package/mobile/out/src/sdk/types.d.ts +158 -0
  123. package/mobile/out/src/sdk/types.d.ts.map +1 -0
  124. package/mobile/out/src/sdk/types.js +90 -0
  125. package/mobile/out/src/sdk/types.js.map +1 -0
  126. package/mobile/out/src/sdk/validationHelpers.d.ts +301 -0
  127. package/mobile/out/src/sdk/validationHelpers.d.ts.map +1 -0
  128. package/mobile/out/src/sdk/validationHelpers.js +629 -0
  129. package/mobile/out/src/sdk/validationHelpers.js.map +1 -0
  130. package/mobile/out/src/services/ServiceCollection.d.ts +25 -0
  131. package/mobile/out/src/services/ServiceCollection.d.ts.map +1 -0
  132. package/mobile/out/src/services/ServiceCollection.js +43 -0
  133. package/mobile/out/src/services/ServiceCollection.js.map +1 -0
  134. package/mobile/out/src/services/Services.d.ts +67 -0
  135. package/mobile/out/src/services/Services.d.ts.map +1 -0
  136. package/mobile/out/src/services/Services.js +391 -0
  137. package/mobile/out/src/services/Services.js.map +1 -0
  138. package/mobile/out/src/services/chaintracker/ChaintracksChainTracker.d.ts +15 -0
  139. package/mobile/out/src/services/chaintracker/ChaintracksChainTracker.d.ts.map +1 -0
  140. package/mobile/out/src/services/chaintracker/ChaintracksChainTracker.js +51 -0
  141. package/mobile/out/src/services/chaintracker/ChaintracksChainTracker.js.map +1 -0
  142. package/mobile/out/src/services/chaintracker/chaintracks/BlockHeaderApi.d.ts +98 -0
  143. package/mobile/out/src/services/chaintracker/chaintracks/BlockHeaderApi.d.ts.map +1 -0
  144. package/mobile/out/src/services/chaintracker/chaintracks/BlockHeaderApi.js +38 -0
  145. package/mobile/out/src/services/chaintracker/chaintracks/BlockHeaderApi.js.map +1 -0
  146. package/mobile/out/src/services/chaintracker/chaintracks/ChaintracksServiceClient.d.ts +36 -0
  147. package/mobile/out/src/services/chaintracker/chaintracks/ChaintracksServiceClient.d.ts.map +1 -0
  148. package/mobile/out/src/services/chaintracker/chaintracks/ChaintracksServiceClient.js +128 -0
  149. package/mobile/out/src/services/chaintracker/chaintracks/ChaintracksServiceClient.js.map +1 -0
  150. package/mobile/out/src/services/chaintracker/chaintracks/index.d.ts +3 -0
  151. package/mobile/out/src/services/chaintracker/chaintracks/index.d.ts.map +1 -0
  152. package/mobile/out/src/services/chaintracker/chaintracks/index.js +19 -0
  153. package/mobile/out/src/services/chaintracker/chaintracks/index.js.map +1 -0
  154. package/mobile/out/src/services/chaintracker/index.d.ts +3 -0
  155. package/mobile/out/src/services/chaintracker/index.d.ts.map +1 -0
  156. package/mobile/out/src/services/chaintracker/index.js +19 -0
  157. package/mobile/out/src/services/chaintracker/index.js.map +1 -0
  158. package/mobile/out/src/services/createDefaultWalletServicesOptions.d.ts +4 -0
  159. package/mobile/out/src/services/createDefaultWalletServicesOptions.d.ts.map +1 -0
  160. package/mobile/out/src/services/createDefaultWalletServicesOptions.js +46 -0
  161. package/mobile/out/src/services/createDefaultWalletServicesOptions.js.map +1 -0
  162. package/mobile/out/src/services/index.d.ts +2 -0
  163. package/mobile/out/src/services/index.d.ts.map +1 -0
  164. package/mobile/out/src/services/index.js +18 -0
  165. package/mobile/out/src/services/index.js.map +1 -0
  166. package/mobile/out/src/services/providers/ARC.d.ts +91 -0
  167. package/mobile/out/src/services/providers/ARC.d.ts.map +1 -0
  168. package/mobile/out/src/services/providers/ARC.js +267 -0
  169. package/mobile/out/src/services/providers/ARC.js.map +1 -0
  170. package/mobile/out/src/services/providers/Bitails.d.ts +49 -0
  171. package/mobile/out/src/services/providers/Bitails.d.ts.map +1 -0
  172. package/mobile/out/src/services/providers/Bitails.js +222 -0
  173. package/mobile/out/src/services/providers/Bitails.js.map +1 -0
  174. package/mobile/out/src/services/providers/SdkWhatsOnChain.d.ts +21 -0
  175. package/mobile/out/src/services/providers/SdkWhatsOnChain.d.ts.map +1 -0
  176. package/mobile/out/src/services/providers/SdkWhatsOnChain.js +67 -0
  177. package/mobile/out/src/services/providers/SdkWhatsOnChain.js.map +1 -0
  178. package/mobile/out/src/services/providers/WhatsOnChain.d.ts +71 -0
  179. package/mobile/out/src/services/providers/WhatsOnChain.d.ts.map +1 -0
  180. package/mobile/out/src/services/providers/WhatsOnChain.js +582 -0
  181. package/mobile/out/src/services/providers/WhatsOnChain.js.map +1 -0
  182. package/mobile/out/src/services/providers/echangeRates.d.ts +12 -0
  183. package/mobile/out/src/services/providers/echangeRates.d.ts.map +1 -0
  184. package/mobile/out/src/services/providers/echangeRates.js +237 -0
  185. package/mobile/out/src/services/providers/echangeRates.js.map +1 -0
  186. package/mobile/out/src/services/providers/getBeefForTxid.d.ts +4 -0
  187. package/mobile/out/src/services/providers/getBeefForTxid.d.ts.map +1 -0
  188. package/mobile/out/src/services/providers/getBeefForTxid.js +286 -0
  189. package/mobile/out/src/services/providers/getBeefForTxid.js.map +1 -0
  190. package/mobile/out/src/signer/WalletSigner.d.ts +11 -0
  191. package/mobile/out/src/signer/WalletSigner.d.ts.map +1 -0
  192. package/mobile/out/src/signer/WalletSigner.js +13 -0
  193. package/mobile/out/src/signer/WalletSigner.js.map +1 -0
  194. package/mobile/out/src/signer/methods/acquireDirectCertificate.d.ts +4 -0
  195. package/mobile/out/src/signer/methods/acquireDirectCertificate.d.ts.map +1 -0
  196. package/mobile/out/src/signer/methods/acquireDirectCertificate.js +45 -0
  197. package/mobile/out/src/signer/methods/acquireDirectCertificate.js.map +1 -0
  198. package/mobile/out/src/signer/methods/buildSignableTransaction.d.ts +10 -0
  199. package/mobile/out/src/signer/methods/buildSignableTransaction.d.ts.map +1 -0
  200. package/mobile/out/src/signer/methods/buildSignableTransaction.js +126 -0
  201. package/mobile/out/src/signer/methods/buildSignableTransaction.js.map +1 -0
  202. package/mobile/out/src/signer/methods/createAction.d.ts +20 -0
  203. package/mobile/out/src/signer/methods/createAction.d.ts.map +1 -0
  204. package/mobile/out/src/signer/methods/createAction.js +160 -0
  205. package/mobile/out/src/signer/methods/createAction.js.map +1 -0
  206. package/mobile/out/src/signer/methods/internalizeAction.d.ts +31 -0
  207. package/mobile/out/src/signer/methods/internalizeAction.d.ts.map +1 -0
  208. package/mobile/out/src/signer/methods/internalizeAction.js +95 -0
  209. package/mobile/out/src/signer/methods/internalizeAction.js.map +1 -0
  210. package/mobile/out/src/signer/methods/proveCertificate.d.ts +4 -0
  211. package/mobile/out/src/signer/methods/proveCertificate.d.ts.map +1 -0
  212. package/mobile/out/src/signer/methods/proveCertificate.js +29 -0
  213. package/mobile/out/src/signer/methods/proveCertificate.js.map +1 -0
  214. package/mobile/out/src/signer/methods/signAction.d.ts +13 -0
  215. package/mobile/out/src/signer/methods/signAction.d.ts.map +1 -0
  216. package/mobile/out/src/signer/methods/signAction.js +89 -0
  217. package/mobile/out/src/signer/methods/signAction.js.map +1 -0
  218. package/mobile/out/src/storage/StorageIdb.d.ts +208 -0
  219. package/mobile/out/src/storage/StorageIdb.d.ts.map +1 -0
  220. package/mobile/out/src/storage/StorageIdb.js +2296 -0
  221. package/mobile/out/src/storage/StorageIdb.js.map +1 -0
  222. package/mobile/out/src/storage/StorageProvider.d.ts +209 -0
  223. package/mobile/out/src/storage/StorageProvider.d.ts.map +1 -0
  224. package/mobile/out/src/storage/StorageProvider.js +550 -0
  225. package/mobile/out/src/storage/StorageProvider.js.map +1 -0
  226. package/mobile/out/src/storage/StorageReader.d.ts +76 -0
  227. package/mobile/out/src/storage/StorageReader.d.ts.map +1 -0
  228. package/mobile/out/src/storage/StorageReader.js +129 -0
  229. package/mobile/out/src/storage/StorageReader.js.map +1 -0
  230. package/mobile/out/src/storage/StorageReaderWriter.d.ts +87 -0
  231. package/mobile/out/src/storage/StorageReaderWriter.d.ts.map +1 -0
  232. package/mobile/out/src/storage/StorageReaderWriter.js +338 -0
  233. package/mobile/out/src/storage/StorageReaderWriter.js.map +1 -0
  234. package/mobile/out/src/storage/StorageSyncReader.d.ts +17 -0
  235. package/mobile/out/src/storage/StorageSyncReader.d.ts.map +1 -0
  236. package/mobile/out/src/storage/StorageSyncReader.js +38 -0
  237. package/mobile/out/src/storage/StorageSyncReader.js.map +1 -0
  238. package/mobile/out/src/storage/WalletStorageManager.d.ts +184 -0
  239. package/mobile/out/src/storage/WalletStorageManager.d.ts.map +1 -0
  240. package/mobile/out/src/storage/WalletStorageManager.js +665 -0
  241. package/mobile/out/src/storage/WalletStorageManager.js.map +1 -0
  242. package/mobile/out/src/storage/index.client.d.ts +8 -0
  243. package/mobile/out/src/storage/index.client.d.ts.map +1 -0
  244. package/mobile/out/src/storage/index.client.js +24 -0
  245. package/mobile/out/src/storage/index.client.js.map +1 -0
  246. package/mobile/out/src/storage/index.mobile.d.ts +7 -0
  247. package/mobile/out/src/storage/index.mobile.d.ts.map +1 -0
  248. package/mobile/out/src/storage/index.mobile.js +23 -0
  249. package/mobile/out/src/storage/index.mobile.js.map +1 -0
  250. package/mobile/out/src/storage/methods/ListActionsSpecOp.d.ts +16 -0
  251. package/mobile/out/src/storage/methods/ListActionsSpecOp.d.ts.map +1 -0
  252. package/mobile/out/src/storage/methods/ListActionsSpecOp.js +40 -0
  253. package/mobile/out/src/storage/methods/ListActionsSpecOp.js.map +1 -0
  254. package/mobile/out/src/storage/methods/ListOutputsSpecOp.d.ts +26 -0
  255. package/mobile/out/src/storage/methods/ListOutputsSpecOp.d.ts.map +1 -0
  256. package/mobile/out/src/storage/methods/ListOutputsSpecOp.js +71 -0
  257. package/mobile/out/src/storage/methods/ListOutputsSpecOp.js.map +1 -0
  258. package/mobile/out/src/storage/methods/attemptToPostReqsToNetwork.d.ts +41 -0
  259. package/mobile/out/src/storage/methods/attemptToPostReqsToNetwork.d.ts.map +1 -0
  260. package/mobile/out/src/storage/methods/attemptToPostReqsToNetwork.js +320 -0
  261. package/mobile/out/src/storage/methods/attemptToPostReqsToNetwork.js.map +1 -0
  262. package/mobile/out/src/storage/methods/createAction.d.ts +24 -0
  263. package/mobile/out/src/storage/methods/createAction.d.ts.map +1 -0
  264. package/mobile/out/src/storage/methods/createAction.js +705 -0
  265. package/mobile/out/src/storage/methods/createAction.js.map +1 -0
  266. package/mobile/out/src/storage/methods/generateChange.d.ts +119 -0
  267. package/mobile/out/src/storage/methods/generateChange.d.ts.map +1 -0
  268. package/mobile/out/src/storage/methods/generateChange.js +448 -0
  269. package/mobile/out/src/storage/methods/generateChange.js.map +1 -0
  270. package/mobile/out/src/storage/methods/getBeefForTransaction.d.ts +22 -0
  271. package/mobile/out/src/storage/methods/getBeefForTransaction.d.ts.map +1 -0
  272. package/mobile/out/src/storage/methods/getBeefForTransaction.js +92 -0
  273. package/mobile/out/src/storage/methods/getBeefForTransaction.js.map +1 -0
  274. package/mobile/out/src/storage/methods/getSyncChunk.d.ts +10 -0
  275. package/mobile/out/src/storage/methods/getSyncChunk.d.ts.map +1 -0
  276. package/mobile/out/src/storage/methods/getSyncChunk.js +271 -0
  277. package/mobile/out/src/storage/methods/getSyncChunk.js.map +1 -0
  278. package/mobile/out/src/storage/methods/internalizeAction.d.ts +38 -0
  279. package/mobile/out/src/storage/methods/internalizeAction.d.ts.map +1 -0
  280. package/mobile/out/src/storage/methods/internalizeAction.js +371 -0
  281. package/mobile/out/src/storage/methods/internalizeAction.js.map +1 -0
  282. package/mobile/out/src/storage/methods/listActionsIdb.d.ts +5 -0
  283. package/mobile/out/src/storage/methods/listActionsIdb.d.ts.map +1 -0
  284. package/mobile/out/src/storage/methods/listActionsIdb.js +155 -0
  285. package/mobile/out/src/storage/methods/listActionsIdb.js.map +1 -0
  286. package/mobile/out/src/storage/methods/listCertificates.d.ts +5 -0
  287. package/mobile/out/src/storage/methods/listCertificates.d.ts.map +1 -0
  288. package/mobile/out/src/storage/methods/listCertificates.js +68 -0
  289. package/mobile/out/src/storage/methods/listCertificates.js.map +1 -0
  290. package/mobile/out/src/storage/methods/listOutputsIdb.d.ts +5 -0
  291. package/mobile/out/src/storage/methods/listOutputsIdb.d.ts.map +1 -0
  292. package/mobile/out/src/storage/methods/listOutputsIdb.js +181 -0
  293. package/mobile/out/src/storage/methods/listOutputsIdb.js.map +1 -0
  294. package/mobile/out/src/storage/methods/processAction.d.ts +35 -0
  295. package/mobile/out/src/storage/methods/processAction.d.ts.map +1 -0
  296. package/mobile/out/src/storage/methods/processAction.js +311 -0
  297. package/mobile/out/src/storage/methods/processAction.js.map +1 -0
  298. package/mobile/out/src/storage/methods/purgeDataIdb.d.ts +4 -0
  299. package/mobile/out/src/storage/methods/purgeDataIdb.d.ts.map +1 -0
  300. package/mobile/out/src/storage/methods/purgeDataIdb.js +9 -0
  301. package/mobile/out/src/storage/methods/purgeDataIdb.js.map +1 -0
  302. package/mobile/out/src/storage/methods/reviewStatusIdb.d.ts +20 -0
  303. package/mobile/out/src/storage/methods/reviewStatusIdb.d.ts.map +1 -0
  304. package/mobile/out/src/storage/methods/reviewStatusIdb.js +35 -0
  305. package/mobile/out/src/storage/methods/reviewStatusIdb.js.map +1 -0
  306. package/mobile/out/src/storage/remoting/StorageClient.d.ts +283 -0
  307. package/mobile/out/src/storage/remoting/StorageClient.d.ts.map +1 -0
  308. package/mobile/out/src/storage/remoting/StorageClient.js +477 -0
  309. package/mobile/out/src/storage/remoting/StorageClient.js.map +1 -0
  310. package/mobile/out/src/storage/schema/StorageIdbSchema.d.ts +133 -0
  311. package/mobile/out/src/storage/schema/StorageIdbSchema.d.ts.map +1 -0
  312. package/mobile/out/src/storage/schema/StorageIdbSchema.js +3 -0
  313. package/mobile/out/src/storage/schema/StorageIdbSchema.js.map +1 -0
  314. package/mobile/out/src/storage/schema/entities/EntityBase.d.ts +105 -0
  315. package/mobile/out/src/storage/schema/entities/EntityBase.d.ts.map +1 -0
  316. package/mobile/out/src/storage/schema/entities/EntityBase.js +100 -0
  317. package/mobile/out/src/storage/schema/entities/EntityBase.js.map +1 -0
  318. package/mobile/out/src/storage/schema/entities/EntityCertificate.d.ts +43 -0
  319. package/mobile/out/src/storage/schema/entities/EntityCertificate.d.ts.map +1 -0
  320. package/mobile/out/src/storage/schema/entities/EntityCertificate.js +162 -0
  321. package/mobile/out/src/storage/schema/entities/EntityCertificate.js.map +1 -0
  322. package/mobile/out/src/storage/schema/entities/EntityCertificateField.d.ts +32 -0
  323. package/mobile/out/src/storage/schema/entities/EntityCertificateField.d.ts.map +1 -0
  324. package/mobile/out/src/storage/schema/entities/EntityCertificateField.js +111 -0
  325. package/mobile/out/src/storage/schema/entities/EntityCertificateField.js.map +1 -0
  326. package/mobile/out/src/storage/schema/entities/EntityCommission.d.ts +37 -0
  327. package/mobile/out/src/storage/schema/entities/EntityCommission.d.ts.map +1 -0
  328. package/mobile/out/src/storage/schema/entities/EntityCommission.js +127 -0
  329. package/mobile/out/src/storage/schema/entities/EntityCommission.js.map +1 -0
  330. package/mobile/out/src/storage/schema/entities/EntityOutput.d.ts +67 -0
  331. package/mobile/out/src/storage/schema/entities/EntityOutput.d.ts.map +1 -0
  332. package/mobile/out/src/storage/schema/entities/EntityOutput.js +264 -0
  333. package/mobile/out/src/storage/schema/entities/EntityOutput.js.map +1 -0
  334. package/mobile/out/src/storage/schema/entities/EntityOutputBasket.d.ts +35 -0
  335. package/mobile/out/src/storage/schema/entities/EntityOutputBasket.d.ts.map +1 -0
  336. package/mobile/out/src/storage/schema/entities/EntityOutputBasket.js +133 -0
  337. package/mobile/out/src/storage/schema/entities/EntityOutputBasket.js.map +1 -0
  338. package/mobile/out/src/storage/schema/entities/EntityOutputTag.d.ts +31 -0
  339. package/mobile/out/src/storage/schema/entities/EntityOutputTag.d.ts.map +1 -0
  340. package/mobile/out/src/storage/schema/entities/EntityOutputTag.js +104 -0
  341. package/mobile/out/src/storage/schema/entities/EntityOutputTag.js.map +1 -0
  342. package/mobile/out/src/storage/schema/entities/EntityOutputTagMap.d.ts +28 -0
  343. package/mobile/out/src/storage/schema/entities/EntityOutputTagMap.d.ts.map +1 -0
  344. package/mobile/out/src/storage/schema/entities/EntityOutputTagMap.js +97 -0
  345. package/mobile/out/src/storage/schema/entities/EntityOutputTagMap.js.map +1 -0
  346. package/mobile/out/src/storage/schema/entities/EntityProvenTx.d.ts +84 -0
  347. package/mobile/out/src/storage/schema/entities/EntityProvenTx.d.ts.map +1 -0
  348. package/mobile/out/src/storage/schema/entities/EntityProvenTx.js +276 -0
  349. package/mobile/out/src/storage/schema/entities/EntityProvenTx.js.map +1 -0
  350. package/mobile/out/src/storage/schema/entities/EntityProvenTxReq.d.ts +135 -0
  351. package/mobile/out/src/storage/schema/entities/EntityProvenTxReq.d.ts.map +1 -0
  352. package/mobile/out/src/storage/schema/entities/EntityProvenTxReq.js +522 -0
  353. package/mobile/out/src/storage/schema/entities/EntityProvenTxReq.js.map +1 -0
  354. package/mobile/out/src/storage/schema/entities/EntitySyncState.d.ts +67 -0
  355. package/mobile/out/src/storage/schema/entities/EntitySyncState.d.ts.map +1 -0
  356. package/mobile/out/src/storage/schema/entities/EntitySyncState.js +319 -0
  357. package/mobile/out/src/storage/schema/entities/EntitySyncState.js.map +1 -0
  358. package/mobile/out/src/storage/schema/entities/EntityTransaction.d.ts +67 -0
  359. package/mobile/out/src/storage/schema/entities/EntityTransaction.d.ts.map +1 -0
  360. package/mobile/out/src/storage/schema/entities/EntityTransaction.js +255 -0
  361. package/mobile/out/src/storage/schema/entities/EntityTransaction.js.map +1 -0
  362. package/mobile/out/src/storage/schema/entities/EntityTxLabel.d.ts +31 -0
  363. package/mobile/out/src/storage/schema/entities/EntityTxLabel.d.ts.map +1 -0
  364. package/mobile/out/src/storage/schema/entities/EntityTxLabel.js +104 -0
  365. package/mobile/out/src/storage/schema/entities/EntityTxLabel.js.map +1 -0
  366. package/mobile/out/src/storage/schema/entities/EntityTxLabelMap.d.ts +28 -0
  367. package/mobile/out/src/storage/schema/entities/EntityTxLabelMap.d.ts.map +1 -0
  368. package/mobile/out/src/storage/schema/entities/EntityTxLabelMap.js +97 -0
  369. package/mobile/out/src/storage/schema/entities/EntityTxLabelMap.js.map +1 -0
  370. package/mobile/out/src/storage/schema/entities/EntityUser.d.ts +29 -0
  371. package/mobile/out/src/storage/schema/entities/EntityUser.d.ts.map +1 -0
  372. package/mobile/out/src/storage/schema/entities/EntityUser.js +98 -0
  373. package/mobile/out/src/storage/schema/entities/EntityUser.js.map +1 -0
  374. package/mobile/out/src/storage/schema/entities/MergeEntity.d.ts +33 -0
  375. package/mobile/out/src/storage/schema/entities/MergeEntity.d.ts.map +1 -0
  376. package/mobile/out/src/storage/schema/entities/MergeEntity.js +62 -0
  377. package/mobile/out/src/storage/schema/entities/MergeEntity.js.map +1 -0
  378. package/mobile/out/src/storage/schema/entities/index.d.ts +17 -0
  379. package/mobile/out/src/storage/schema/entities/index.d.ts.map +1 -0
  380. package/mobile/out/src/storage/schema/entities/index.js +33 -0
  381. package/mobile/out/src/storage/schema/entities/index.js.map +1 -0
  382. package/mobile/out/src/storage/schema/tables/TableCertificate.d.ts +20 -0
  383. package/mobile/out/src/storage/schema/tables/TableCertificate.d.ts.map +1 -0
  384. package/mobile/out/src/storage/schema/tables/TableCertificate.js +3 -0
  385. package/mobile/out/src/storage/schema/tables/TableCertificate.js.map +1 -0
  386. package/mobile/out/src/storage/schema/tables/TableCertificateField.d.ts +12 -0
  387. package/mobile/out/src/storage/schema/tables/TableCertificateField.d.ts.map +1 -0
  388. package/mobile/out/src/storage/schema/tables/TableCertificateField.js +3 -0
  389. package/mobile/out/src/storage/schema/tables/TableCertificateField.js.map +1 -0
  390. package/mobile/out/src/storage/schema/tables/TableCommission.d.ts +13 -0
  391. package/mobile/out/src/storage/schema/tables/TableCommission.d.ts.map +1 -0
  392. package/mobile/out/src/storage/schema/tables/TableCommission.js +3 -0
  393. package/mobile/out/src/storage/schema/tables/TableCommission.js.map +1 -0
  394. package/mobile/out/src/storage/schema/tables/TableMonitorEvent.d.ts +9 -0
  395. package/mobile/out/src/storage/schema/tables/TableMonitorEvent.d.ts.map +1 -0
  396. package/mobile/out/src/storage/schema/tables/TableMonitorEvent.js +3 -0
  397. package/mobile/out/src/storage/schema/tables/TableMonitorEvent.js.map +1 -0
  398. package/mobile/out/src/storage/schema/tables/TableOutput.d.ts +36 -0
  399. package/mobile/out/src/storage/schema/tables/TableOutput.d.ts.map +1 -0
  400. package/mobile/out/src/storage/schema/tables/TableOutput.js +31 -0
  401. package/mobile/out/src/storage/schema/tables/TableOutput.js.map +1 -0
  402. package/mobile/out/src/storage/schema/tables/TableOutputBasket.d.ts +12 -0
  403. package/mobile/out/src/storage/schema/tables/TableOutputBasket.d.ts.map +1 -0
  404. package/mobile/out/src/storage/schema/tables/TableOutputBasket.js +3 -0
  405. package/mobile/out/src/storage/schema/tables/TableOutputBasket.js.map +1 -0
  406. package/mobile/out/src/storage/schema/tables/TableOutputTag.d.ts +10 -0
  407. package/mobile/out/src/storage/schema/tables/TableOutputTag.d.ts.map +1 -0
  408. package/mobile/out/src/storage/schema/tables/TableOutputTag.js +3 -0
  409. package/mobile/out/src/storage/schema/tables/TableOutputTag.js.map +1 -0
  410. package/mobile/out/src/storage/schema/tables/TableOutputTagMap.d.ts +9 -0
  411. package/mobile/out/src/storage/schema/tables/TableOutputTagMap.d.ts.map +1 -0
  412. package/mobile/out/src/storage/schema/tables/TableOutputTagMap.js +3 -0
  413. package/mobile/out/src/storage/schema/tables/TableOutputTagMap.js.map +1 -0
  414. package/mobile/out/src/storage/schema/tables/TableProvenTx.d.ts +14 -0
  415. package/mobile/out/src/storage/schema/tables/TableProvenTx.d.ts.map +1 -0
  416. package/mobile/out/src/storage/schema/tables/TableProvenTx.js +3 -0
  417. package/mobile/out/src/storage/schema/tables/TableProvenTx.js.map +1 -0
  418. package/mobile/out/src/storage/schema/tables/TableProvenTxReq.d.ts +64 -0
  419. package/mobile/out/src/storage/schema/tables/TableProvenTxReq.d.ts.map +1 -0
  420. package/mobile/out/src/storage/schema/tables/TableProvenTxReq.js +3 -0
  421. package/mobile/out/src/storage/schema/tables/TableProvenTxReq.js.map +1 -0
  422. package/mobile/out/src/storage/schema/tables/TableSettings.d.ts +17 -0
  423. package/mobile/out/src/storage/schema/tables/TableSettings.d.ts.map +1 -0
  424. package/mobile/out/src/storage/schema/tables/TableSettings.js +3 -0
  425. package/mobile/out/src/storage/schema/tables/TableSettings.js.map +1 -0
  426. package/mobile/out/src/storage/schema/tables/TableSyncState.d.ts +18 -0
  427. package/mobile/out/src/storage/schema/tables/TableSyncState.d.ts.map +1 -0
  428. package/mobile/out/src/storage/schema/tables/TableSyncState.js +3 -0
  429. package/mobile/out/src/storage/schema/tables/TableSyncState.js.map +1 -0
  430. package/mobile/out/src/storage/schema/tables/TableTransaction.d.ts +37 -0
  431. package/mobile/out/src/storage/schema/tables/TableTransaction.d.ts.map +1 -0
  432. package/mobile/out/src/storage/schema/tables/TableTransaction.js +21 -0
  433. package/mobile/out/src/storage/schema/tables/TableTransaction.js.map +1 -0
  434. package/mobile/out/src/storage/schema/tables/TableTxLabel.d.ts +10 -0
  435. package/mobile/out/src/storage/schema/tables/TableTxLabel.d.ts.map +1 -0
  436. package/mobile/out/src/storage/schema/tables/TableTxLabel.js +3 -0
  437. package/mobile/out/src/storage/schema/tables/TableTxLabel.js.map +1 -0
  438. package/mobile/out/src/storage/schema/tables/TableTxLabelMap.d.ts +9 -0
  439. package/mobile/out/src/storage/schema/tables/TableTxLabelMap.d.ts.map +1 -0
  440. package/mobile/out/src/storage/schema/tables/TableTxLabelMap.js +3 -0
  441. package/mobile/out/src/storage/schema/tables/TableTxLabelMap.js.map +1 -0
  442. package/mobile/out/src/storage/schema/tables/TableUser.d.ts +16 -0
  443. package/mobile/out/src/storage/schema/tables/TableUser.d.ts.map +1 -0
  444. package/mobile/out/src/storage/schema/tables/TableUser.js +3 -0
  445. package/mobile/out/src/storage/schema/tables/TableUser.js.map +1 -0
  446. package/mobile/out/src/storage/schema/tables/index.d.ts +17 -0
  447. package/mobile/out/src/storage/schema/tables/index.d.ts.map +1 -0
  448. package/mobile/out/src/storage/schema/tables/index.js +33 -0
  449. package/mobile/out/src/storage/schema/tables/index.js.map +1 -0
  450. package/mobile/out/src/utility/ScriptTemplateBRC29.d.ts +25 -0
  451. package/mobile/out/src/utility/ScriptTemplateBRC29.d.ts.map +1 -0
  452. package/mobile/out/src/utility/ScriptTemplateBRC29.js +48 -0
  453. package/mobile/out/src/utility/ScriptTemplateBRC29.js.map +1 -0
  454. package/mobile/out/src/utility/identityUtils.d.ts +31 -0
  455. package/mobile/out/src/utility/identityUtils.d.ts.map +1 -0
  456. package/mobile/out/src/utility/identityUtils.js +116 -0
  457. package/mobile/out/src/utility/identityUtils.js.map +1 -0
  458. package/mobile/out/src/utility/index.client.d.ts +7 -0
  459. package/mobile/out/src/utility/index.client.d.ts.map +1 -0
  460. package/mobile/out/src/utility/index.client.js +23 -0
  461. package/mobile/out/src/utility/index.client.js.map +1 -0
  462. package/mobile/out/src/utility/parseTxScriptOffsets.d.ts +14 -0
  463. package/mobile/out/src/utility/parseTxScriptOffsets.d.ts.map +1 -0
  464. package/mobile/out/src/utility/parseTxScriptOffsets.js +26 -0
  465. package/mobile/out/src/utility/parseTxScriptOffsets.js.map +1 -0
  466. package/mobile/out/src/utility/stampLog.d.ts +18 -0
  467. package/mobile/out/src/utility/stampLog.d.ts.map +1 -0
  468. package/mobile/out/src/utility/stampLog.js +72 -0
  469. package/mobile/out/src/utility/stampLog.js.map +1 -0
  470. package/mobile/out/src/utility/tscProofToMerklePath.d.ts +8 -0
  471. package/mobile/out/src/utility/tscProofToMerklePath.d.ts.map +1 -0
  472. package/mobile/out/src/utility/tscProofToMerklePath.js +41 -0
  473. package/mobile/out/src/utility/tscProofToMerklePath.js.map +1 -0
  474. package/mobile/out/src/utility/utilityHelpers.d.ts +129 -0
  475. package/mobile/out/src/utility/utilityHelpers.d.ts.map +1 -0
  476. package/mobile/out/src/utility/utilityHelpers.js +266 -0
  477. package/mobile/out/src/utility/utilityHelpers.js.map +1 -0
  478. package/mobile/out/src/utility/utilityHelpers.noBuffer.d.ts +9 -0
  479. package/mobile/out/src/utility/utilityHelpers.noBuffer.d.ts.map +1 -0
  480. package/mobile/out/src/utility/utilityHelpers.noBuffer.js +23 -0
  481. package/mobile/out/src/utility/utilityHelpers.noBuffer.js.map +1 -0
  482. package/mobile/out/src/wab-client/WABClient.d.ts +49 -0
  483. package/mobile/out/src/wab-client/WABClient.d.ts.map +1 -0
  484. package/mobile/out/src/wab-client/WABClient.js +80 -0
  485. package/mobile/out/src/wab-client/WABClient.js.map +1 -0
  486. package/mobile/out/src/wab-client/auth-method-interactors/AuthMethodInteractor.d.ts +34 -0
  487. package/mobile/out/src/wab-client/auth-method-interactors/AuthMethodInteractor.d.ts.map +1 -0
  488. package/mobile/out/src/wab-client/auth-method-interactors/AuthMethodInteractor.js +16 -0
  489. package/mobile/out/src/wab-client/auth-method-interactors/AuthMethodInteractor.js.map +1 -0
  490. package/mobile/out/src/wab-client/auth-method-interactors/PersonaIDInteractor.d.ts +7 -0
  491. package/mobile/out/src/wab-client/auth-method-interactors/PersonaIDInteractor.d.ts.map +1 -0
  492. package/mobile/out/src/wab-client/auth-method-interactors/PersonaIDInteractor.js +36 -0
  493. package/mobile/out/src/wab-client/auth-method-interactors/PersonaIDInteractor.js.map +1 -0
  494. package/mobile/out/src/wab-client/auth-method-interactors/TwilioPhoneInteractor.d.ts +28 -0
  495. package/mobile/out/src/wab-client/auth-method-interactors/TwilioPhoneInteractor.d.ts.map +1 -0
  496. package/mobile/out/src/wab-client/auth-method-interactors/TwilioPhoneInteractor.js +69 -0
  497. package/mobile/out/src/wab-client/auth-method-interactors/TwilioPhoneInteractor.js.map +1 -0
  498. package/mobile/out/tsconfig.mobile.tsbuildinfo +1 -0
  499. package/mobile/package-lock.json +22 -0
  500. package/mobile/package.json +25 -0
  501. package/out/src/index.mobile.d.ts +19 -0
  502. package/out/src/index.mobile.d.ts.map +1 -0
  503. package/out/src/index.mobile.js +58 -0
  504. package/out/src/index.mobile.js.map +1 -0
  505. package/out/src/storage/index.mobile.d.ts +7 -0
  506. package/out/src/storage/index.mobile.d.ts.map +1 -0
  507. package/out/src/storage/index.mobile.js +23 -0
  508. package/out/src/storage/index.mobile.js.map +1 -0
  509. package/out/src/wab-client/WABClient.js +2 -5
  510. package/out/src/wab-client/WABClient.js.map +1 -1
  511. package/out/tsconfig.all.tsbuildinfo +1 -1
  512. package/package.json +1 -1
  513. package/src/index.mobile.ts +18 -0
  514. package/src/storage/index.mobile.ts +6 -0
  515. package/src/wab-client/WABClient.ts +2 -2
  516. package/tsconfig.json +3 -0
  517. package/tsconfig.mobile.json +22 -0
@@ -0,0 +1,293 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PrivilegedKeyManager = void 0;
4
+ const sdk_1 = require("@bsv/sdk");
5
+ /**
6
+ * PrivilegedKeyManager
7
+ *
8
+ * This class manages a privileged (i.e., very sensitive) private key, obtained from
9
+ * an external function (`keyGetter`), which might be backed by HSMs, secure enclaves,
10
+ * or other secure storage. The manager retains the key in memory only for a limited
11
+ * duration (`retentionPeriod`), uses XOR-based chunk-splitting obfuscation, and
12
+ * includes decoy data to raise the difficulty of discovering the real key in memory.
13
+ *
14
+ * IMPORTANT: While these measures raise the bar for attackers, JavaScript environments
15
+ * do not provide perfect in-memory secrecy.
16
+ */
17
+ class PrivilegedKeyManager {
18
+ /**
19
+ * @param keyGetter - Asynchronous function that retrieves the PrivateKey from a secure environment.
20
+ * @param retentionPeriod - Time in milliseconds to retain the obfuscated key in memory before zeroizing.
21
+ */
22
+ constructor(keyGetter, retentionPeriod = 120000) {
23
+ /**
24
+ * A list of dynamically generated property names used to store
25
+ * real key chunks (XORed with random pads).
26
+ */
27
+ this.chunkPropNames = [];
28
+ /**
29
+ * A list of dynamically generated property names used to store
30
+ * the random pads that correspond to the real key chunks.
31
+ */
32
+ this.chunkPadPropNames = [];
33
+ /**
34
+ * A list of decoy property names that will be removed
35
+ * when the real key is destroyed.
36
+ */
37
+ this.decoyPropNamesDestroy = [];
38
+ /**
39
+ * A list of decoy property names that remain in memory
40
+ * even after the real key is destroyed (just to cause confusion).
41
+ */
42
+ this.decoyPropNamesRemain = [];
43
+ /**
44
+ * Number of chunks to split the 32-byte key into.
45
+ * Adjust to increase or decrease obfuscation complexity.
46
+ */
47
+ this.CHUNK_COUNT = 4;
48
+ this.keyGetter = keyGetter;
49
+ this.retentionPeriod = retentionPeriod;
50
+ // Initialize some random decoy properties that always remain:
51
+ for (let i = 0; i < 2; i++) {
52
+ const propName = this.generateRandomPropName();
53
+ this[propName] = Uint8Array.from((0, sdk_1.Random)(16));
54
+ this.decoyPropNamesRemain.push(propName);
55
+ }
56
+ }
57
+ /**
58
+ * Safely destroys the in-memory obfuscated key material by zeroizing
59
+ * and deleting related fields. Also destroys some (but not all) decoy
60
+ * properties to further confuse an attacker.
61
+ */
62
+ destroyKey() {
63
+ try {
64
+ // Zero out real chunk data
65
+ for (const name of this.chunkPropNames) {
66
+ const data = this[name];
67
+ if (data) {
68
+ data.fill(0);
69
+ }
70
+ delete this[name];
71
+ }
72
+ for (const name of this.chunkPadPropNames) {
73
+ const data = this[name];
74
+ if (data) {
75
+ data.fill(0);
76
+ }
77
+ delete this[name];
78
+ }
79
+ // Destroy some decoys
80
+ for (const name of this.decoyPropNamesDestroy) {
81
+ const data = this[name];
82
+ if (data) {
83
+ data.fill(0);
84
+ }
85
+ delete this[name];
86
+ }
87
+ // Clear arrays of property names
88
+ this.chunkPropNames = [];
89
+ this.chunkPadPropNames = [];
90
+ this.decoyPropNamesDestroy = [];
91
+ }
92
+ catch (_) {
93
+ // Swallow any errors in the destruction process
94
+ }
95
+ finally {
96
+ if (this.destroyTimer) {
97
+ clearTimeout(this.destroyTimer);
98
+ this.destroyTimer = undefined;
99
+ }
100
+ }
101
+ }
102
+ /**
103
+ * Re/sets the destruction timer that removes the key from memory
104
+ * after `retentionPeriod` ms. If a timer is already running, it
105
+ * is cleared and re-set. This ensures the key remains in memory
106
+ * for exactly the desired window after its most recent acquisition.
107
+ */
108
+ scheduleKeyDestruction() {
109
+ if (this.destroyTimer) {
110
+ // TODO: Consider a constructor flag to avoid clearing timers for higher security
111
+ clearTimeout(this.destroyTimer);
112
+ }
113
+ this.destroyTimer = setTimeout(() => {
114
+ this.destroyKey();
115
+ }, this.retentionPeriod);
116
+ }
117
+ /**
118
+ * XOR-based obfuscation on a per-chunk basis.
119
+ * This function takes two equal-length byte arrays
120
+ * and returns the XOR combination.
121
+ */
122
+ xorBytes(a, b) {
123
+ const out = new Uint8Array(a.length);
124
+ for (let i = 0; i < a.length; i++) {
125
+ out[i] = a[i] ^ b[i];
126
+ }
127
+ return out;
128
+ }
129
+ /**
130
+ * Splits the 32-byte key into `this.CHUNK_COUNT` smaller chunks
131
+ * (mostly equal length; the last chunk picks up leftover bytes
132
+ * if 32 is not evenly divisible).
133
+ */
134
+ splitKeyIntoChunks(keyBytes) {
135
+ const chunkSize = Math.floor(keyBytes.length / this.CHUNK_COUNT);
136
+ const chunks = [];
137
+ let offset = 0;
138
+ for (let i = 0; i < this.CHUNK_COUNT; i++) {
139
+ const size = i === this.CHUNK_COUNT - 1 ? keyBytes.length - offset : chunkSize;
140
+ chunks.push(keyBytes.slice(offset, offset + size));
141
+ offset += size;
142
+ }
143
+ return chunks;
144
+ }
145
+ /**
146
+ * Reassembles the chunks from the dynamic properties, XORs them
147
+ * with their corresponding pads, and returns a single 32-byte
148
+ * Uint8Array representing the raw key.
149
+ */
150
+ reassembleKeyFromChunks() {
151
+ try {
152
+ const chunkArrays = [];
153
+ for (let i = 0; i < this.chunkPropNames.length; i++) {
154
+ const chunkEnc = this[this.chunkPropNames[i]];
155
+ const chunkPad = this[this.chunkPadPropNames[i]];
156
+ if (!chunkEnc || !chunkPad || chunkEnc.length !== chunkPad.length) {
157
+ return null;
158
+ }
159
+ const rawChunk = this.xorBytes(chunkEnc, chunkPad);
160
+ chunkArrays.push(rawChunk);
161
+ }
162
+ // Concat them back to a single 32-byte array:
163
+ const totalLength = chunkArrays.reduce((sum, c) => sum + c.length, 0);
164
+ if (totalLength !== 32) {
165
+ // We only handle 32-byte keys
166
+ return null;
167
+ }
168
+ const rawKey = new Uint8Array(totalLength);
169
+ let offset = 0;
170
+ for (const chunk of chunkArrays) {
171
+ rawKey.set(chunk, offset);
172
+ offset += chunk.length;
173
+ // Attempt to zero the ephemeral chunk
174
+ chunk.fill(0);
175
+ }
176
+ return rawKey;
177
+ }
178
+ catch (_) {
179
+ // If any property is missing or type mismatch, we return null
180
+ return null;
181
+ }
182
+ }
183
+ /**
184
+ * Generates a random property name to store key chunks or decoy data.
185
+ */
186
+ generateRandomPropName() {
187
+ // E.g., 8 random hex characters for the property name
188
+ const randomHex = sdk_1.Utils.toHex((0, sdk_1.Random)(4));
189
+ return `_${randomHex}_${Math.floor(Math.random() * 1e6)}`;
190
+ }
191
+ /**
192
+ * Forces a PrivateKey to be represented as exactly 32 bytes, left-padding
193
+ * with zeros if its numeric value has fewer than 32 bytes.
194
+ */
195
+ get32ByteRepresentation(privKey) {
196
+ // The internal "toArray()" can be up to 32 bytes, but sometimes fewer
197
+ // if the numeric value has leading zeros.
198
+ const buf = privKey.toArray();
199
+ if (buf.length > 32) {
200
+ throw new Error('PrivilegedKeyManager: Expected a 32-byte key, but got more.');
201
+ }
202
+ // Left-pad with zeros if needed
203
+ const keyBytes = new Uint8Array(32);
204
+ keyBytes.set(buf, 32 - buf.length);
205
+ return keyBytes;
206
+ }
207
+ /**
208
+ * Returns the privileged key needed to perform cryptographic operations.
209
+ * Uses in-memory chunk-based obfuscation if the key was already fetched.
210
+ * Otherwise, it calls out to `keyGetter`, splits the 32-byte representation
211
+ * of the key, XORs each chunk with a random pad, and stores them under
212
+ * dynamic property names. Also populates new decoy properties.
213
+ *
214
+ * @param reason - The reason for why the key is needed, passed to keyGetter.
215
+ * @returns The PrivateKey object needed for cryptographic operations.
216
+ */
217
+ async getPrivilegedKey(reason) {
218
+ // If we already have chunk properties, try reassemble
219
+ if (this.chunkPropNames.length > 0 && this.chunkPadPropNames.length > 0) {
220
+ const rawKeyBytes = this.reassembleKeyFromChunks();
221
+ if (rawKeyBytes && rawKeyBytes.length === 32) {
222
+ // Convert 32 raw bytes back to a PrivateKey
223
+ // (Leading zeros are preserved, but PrivateKey() will parse it as a big integer.)
224
+ const hexKey = sdk_1.Utils.toHex([...rawKeyBytes]); // 64 hex chars
225
+ rawKeyBytes.fill(0); // Zero ephemeral copy
226
+ this.scheduleKeyDestruction();
227
+ return new sdk_1.PrivateKey(hexKey, 'hex');
228
+ }
229
+ }
230
+ // Otherwise, fetch a fresh key from the secure environment
231
+ const fetchedKey = await this.keyGetter(reason);
232
+ // Force 32‑byte representation (left-pad if necessary)
233
+ const keyBytes = this.get32ByteRepresentation(fetchedKey);
234
+ // Clean up any old data first (in case we had something stale)
235
+ this.destroyKey();
236
+ // Split the key
237
+ const chunks = this.splitKeyIntoChunks(keyBytes);
238
+ // Store new chunk data under random property names
239
+ for (let i = 0; i < chunks.length; i++) {
240
+ const chunkProp = this.generateRandomPropName();
241
+ const padProp = this.generateRandomPropName();
242
+ this.chunkPropNames.push(chunkProp);
243
+ this.chunkPadPropNames.push(padProp);
244
+ // Generate random pad of the same length as the chunk
245
+ const pad = Uint8Array.from((0, sdk_1.Random)(chunks[i].length));
246
+ // XOR the chunk to obfuscate
247
+ const obf = this.xorBytes(chunks[i], pad);
248
+ this[chunkProp] = obf;
249
+ this[padProp] = pad;
250
+ }
251
+ // Generate some decoy properties that will be destroyed with the key
252
+ for (let i = 0; i < 2; i++) {
253
+ const decoyProp = this.generateRandomPropName();
254
+ this[decoyProp] = Uint8Array.from((0, sdk_1.Random)(32));
255
+ this.decoyPropNamesDestroy.push(decoyProp);
256
+ }
257
+ // Zero out ephemeral original
258
+ keyBytes.fill(0);
259
+ // Schedule destruction
260
+ this.scheduleKeyDestruction();
261
+ // Return the newly fetched key as a normal PrivateKey
262
+ return fetchedKey;
263
+ }
264
+ async getPublicKey(args) {
265
+ return new sdk_1.ProtoWallet(await this.getPrivilegedKey(args.privilegedReason)).getPublicKey(args);
266
+ }
267
+ async revealCounterpartyKeyLinkage(args) {
268
+ return new sdk_1.ProtoWallet(await this.getPrivilegedKey(args.privilegedReason)).revealCounterpartyKeyLinkage(args);
269
+ }
270
+ async revealSpecificKeyLinkage(args) {
271
+ return new sdk_1.ProtoWallet(await this.getPrivilegedKey(args.privilegedReason)).revealSpecificKeyLinkage(args);
272
+ }
273
+ async encrypt(args) {
274
+ return new sdk_1.ProtoWallet(await this.getPrivilegedKey(args.privilegedReason)).encrypt(args);
275
+ }
276
+ async decrypt(args) {
277
+ return new sdk_1.ProtoWallet(await this.getPrivilegedKey(args.privilegedReason)).decrypt(args);
278
+ }
279
+ async createHmac(args) {
280
+ return new sdk_1.ProtoWallet(await this.getPrivilegedKey(args.privilegedReason)).createHmac(args);
281
+ }
282
+ async verifyHmac(args) {
283
+ return new sdk_1.ProtoWallet(await this.getPrivilegedKey(args.privilegedReason)).verifyHmac(args);
284
+ }
285
+ async createSignature(args) {
286
+ return new sdk_1.ProtoWallet(await this.getPrivilegedKey(args.privilegedReason)).createSignature(args);
287
+ }
288
+ async verifySignature(args) {
289
+ return new sdk_1.ProtoWallet(await this.getPrivilegedKey(args.privilegedReason)).verifySignature(args);
290
+ }
291
+ }
292
+ exports.PrivilegedKeyManager = PrivilegedKeyManager;
293
+ //# sourceMappingURL=PrivilegedKeyManager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PrivilegedKeyManager.js","sourceRoot":"","sources":["../../../../src/sdk/PrivilegedKeyManager.ts"],"names":[],"mappings":";;;AAAA,kCAuBiB;AAEjB;;;;;;;;;;;GAWG;AACH,MAAa,oBAAoB;IAmD/B;;;OAGG;IACH,YAAY,SAAkD,EAAE,eA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AC,IAAoB;QACnC,OAAO,IAAI,iBAAW,CAAC,MAAM,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,gBAA0B,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,CAAA;IACvG,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,IAAyB;QAC7C,OAAO,IAAI,iBAAW,CAAC,MAAM,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,gBAA0B,CAAC,CAAC,CAAC,eAAe,CAAC,IAAI,CAAC,CAAA;IAC5G,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,IAAyB;QAC7C,OAAO,IAAI,iBAAW,CAAC,MAAM,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,gBAA0B,CAAC,CAAC,CAAC,eAAe,CAAC,IAAI,CAAC,CAAA;IAC5G,CAAC;CACF;AA9UD,oDA8UC"}
@@ -0,0 +1,115 @@
1
+ import { AtomicBEEF, OutpointString, SendWithResult, TXIDHexString, WalletNetwork } from '@bsv/sdk';
2
+ import { WalletError } from './WalletError';
3
+ import { ReviewActionResult } from './WalletStorage.interfaces';
4
+ /**
5
+ * Not implemented.
6
+ */
7
+ export declare class WERR_NOT_IMPLEMENTED extends WalletError {
8
+ constructor(message?: string);
9
+ }
10
+ /**
11
+ * An internal error has occurred.
12
+ *
13
+ * This is an example of an error with an optional custom `message`.
14
+ */
15
+ export declare class WERR_INTERNAL extends WalletError {
16
+ constructor(message?: string);
17
+ }
18
+ /**
19
+ * The ${parameter} parameter is invalid.
20
+ *
21
+ * This is an example of an error object with a custom property `parameter` and templated `message`.
22
+ */
23
+ export declare class WERR_INVALID_OPERATION extends WalletError {
24
+ constructor(message?: string);
25
+ }
26
+ /**
27
+ * Unable to broadcast transaction at this time.
28
+ */
29
+ export declare class WERR_BROADCAST_UNAVAILABLE extends WalletError {
30
+ constructor(message?: string);
31
+ }
32
+ /**
33
+ * The ${parameter} parameter is invalid.
34
+ *
35
+ * This is an example of an error object with a custom property `parameter` and templated `message`.
36
+ */
37
+ export declare class WERR_INVALID_PARAMETER extends WalletError {
38
+ parameter: string;
39
+ constructor(parameter: string, mustBe?: string);
40
+ }
41
+ /**
42
+ * The required ${parameter} parameter is missing.
43
+ *
44
+ * This is an example of an error object with a custom property `parameter`
45
+ */
46
+ export declare class WERR_MISSING_PARAMETER extends WalletError {
47
+ parameter: string;
48
+ constructor(parameter: string);
49
+ }
50
+ /**
51
+ * The request is invalid.
52
+ */
53
+ export declare class WERR_BAD_REQUEST extends WalletError {
54
+ constructor(message?: string);
55
+ }
56
+ /**
57
+ * Configured network chain is invalid or does not match across services.
58
+ */
59
+ export declare class WERR_NETWORK_CHAIN extends WalletError {
60
+ constructor(message?: string);
61
+ }
62
+ /**
63
+ * Access is denied due to an authorization error.
64
+ */
65
+ export declare class WERR_UNAUTHORIZED extends WalletError {
66
+ constructor(message?: string);
67
+ }
68
+ /**
69
+ * WalletStorageManager is not accessing user's active storage or there are conflicting active stores configured.
70
+ */
71
+ export declare class WERR_NOT_ACTIVE extends WalletError {
72
+ constructor(message?: string);
73
+ }
74
+ /**
75
+ * Insufficient funds in the available inputs to cover the cost of the required outputs
76
+ * and the transaction fee (${moreSatoshisNeeded} more satoshis are needed,
77
+ * for a total of ${totalSatoshisNeeded}), plus whatever would be required in order
78
+ * to pay the fee to unlock and spend the outputs used to provide the additional satoshis.
79
+ */
80
+ export declare class WERR_INSUFFICIENT_FUNDS extends WalletError {
81
+ totalSatoshisNeeded: number;
82
+ moreSatoshisNeeded: number;
83
+ /**
84
+ * @param totalSatoshisNeeded Total satoshis required to fund transactions after net of required inputs and outputs.
85
+ * @param moreSatoshisNeeded Shortfall on total satoshis required to fund transactions after net of required inputs and outputs.
86
+ */
87
+ constructor(totalSatoshisNeeded: number, moreSatoshisNeeded: number);
88
+ }
89
+ export declare class WERR_INVALID_PUBLIC_KEY extends WalletError {
90
+ key: string;
91
+ /**
92
+ * @param key The invalid public key that caused the error.
93
+ * @param environment Optional environment flag to control whether the key is included in the message.
94
+ */
95
+ constructor(key: string, network?: WalletNetwork);
96
+ }
97
+ /**
98
+ * When a `createAction` or `signAction` is completed in undelayed mode (`acceptDelayedBroadcast`: false),
99
+ * any unsucccessful result will return the results by way of this exception to ensure attention is
100
+ * paid to processing errors.
101
+ */
102
+ export declare class WERR_REVIEW_ACTIONS extends WalletError {
103
+ reviewActionResults: ReviewActionResult[];
104
+ sendWithResults: SendWithResult[];
105
+ txid?: TXIDHexString | undefined;
106
+ tx?: AtomicBEEF | undefined;
107
+ noSendChange?: OutpointString[] | undefined;
108
+ /**
109
+ * All parameters correspond to their comparable `createAction` or `signSction` results
110
+ * with the exception of `reviewActionResults`;
111
+ * which contains more details, particularly for double spend results.
112
+ */
113
+ constructor(reviewActionResults: ReviewActionResult[], sendWithResults: SendWithResult[], txid?: TXIDHexString | undefined, tx?: AtomicBEEF | undefined, noSendChange?: OutpointString[] | undefined);
114
+ }
115
+ //# sourceMappingURL=WERR_errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WERR_errors.d.ts","sourceRoot":"","sources":["../../../../src/sdk/WERR_errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,cAAc,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACnG,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAE/D;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,WAAW;gBACvC,OAAO,CAAC,EAAE,MAAM;CAG7B;AAED;;;;GAIG;AACH,qBAAa,aAAc,SAAQ,WAAW;gBAChC,OAAO,CAAC,EAAE,MAAM;CAG7B;AAED;;;;GAIG;AACH,qBAAa,sBAAuB,SAAQ,WAAW;gBACzC,OAAO,CAAC,EAAE,MAAM;CAG7B;AAED;;GAEG;AACH,qBAAa,0BAA2B,SAAQ,WAAW;gBAC7C,OAAO,CAAC,EAAE,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,EACpB,EAAE,CAAC,EAAE,UAAU,YAAA,EACf,YAAY,CAAC,EAAE,cAAc,EAAE,YAAA;CAIzC"}
@@ -0,0 +1,158 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WERR_REVIEW_ACTIONS = exports.WERR_INVALID_PUBLIC_KEY = exports.WERR_INSUFFICIENT_FUNDS = exports.WERR_NOT_ACTIVE = exports.WERR_UNAUTHORIZED = exports.WERR_NETWORK_CHAIN = exports.WERR_BAD_REQUEST = exports.WERR_MISSING_PARAMETER = exports.WERR_INVALID_PARAMETER = exports.WERR_BROADCAST_UNAVAILABLE = exports.WERR_INVALID_OPERATION = exports.WERR_INTERNAL = exports.WERR_NOT_IMPLEMENTED = void 0;
4
+ const WalletError_1 = require("./WalletError");
5
+ /**
6
+ * Not implemented.
7
+ */
8
+ class WERR_NOT_IMPLEMENTED extends WalletError_1.WalletError {
9
+ constructor(message) {
10
+ super('WERR_NOT_IMPLEMENTED', message !== null && message !== void 0 ? message : 'Not implemented.');
11
+ }
12
+ }
13
+ exports.WERR_NOT_IMPLEMENTED = WERR_NOT_IMPLEMENTED;
14
+ /**
15
+ * An internal error has occurred.
16
+ *
17
+ * This is an example of an error with an optional custom `message`.
18
+ */
19
+ class WERR_INTERNAL extends WalletError_1.WalletError {
20
+ constructor(message) {
21
+ super('WERR_INTERNAL', message !== null && message !== void 0 ? message : 'An internal error has occurred.');
22
+ }
23
+ }
24
+ exports.WERR_INTERNAL = WERR_INTERNAL;
25
+ /**
26
+ * The ${parameter} parameter is invalid.
27
+ *
28
+ * This is an example of an error object with a custom property `parameter` and templated `message`.
29
+ */
30
+ class WERR_INVALID_OPERATION extends WalletError_1.WalletError {
31
+ constructor(message) {
32
+ super('WERR_INVALID_OPERATION', message !== null && message !== void 0 ? message : `An invalid operation was requested.`);
33
+ }
34
+ }
35
+ exports.WERR_INVALID_OPERATION = WERR_INVALID_OPERATION;
36
+ /**
37
+ * Unable to broadcast transaction at this time.
38
+ */
39
+ class WERR_BROADCAST_UNAVAILABLE extends WalletError_1.WalletError {
40
+ constructor(message) {
41
+ super('WERR_BROADCAST_UNAVAILABLE', `Unable to broadcast transaction at this time.`);
42
+ }
43
+ }
44
+ exports.WERR_BROADCAST_UNAVAILABLE = WERR_BROADCAST_UNAVAILABLE;
45
+ /**
46
+ * The ${parameter} parameter is invalid.
47
+ *
48
+ * This is an example of an error object with a custom property `parameter` and templated `message`.
49
+ */
50
+ class WERR_INVALID_PARAMETER extends WalletError_1.WalletError {
51
+ constructor(parameter, mustBe) {
52
+ super('WERR_INVALID_PARAMETER', `The ${parameter} parameter must be ${mustBe !== null && mustBe !== void 0 ? mustBe : 'valid.'}`);
53
+ this.parameter = parameter;
54
+ }
55
+ }
56
+ exports.WERR_INVALID_PARAMETER = WERR_INVALID_PARAMETER;
57
+ /**
58
+ * The required ${parameter} parameter is missing.
59
+ *
60
+ * This is an example of an error object with a custom property `parameter`
61
+ */
62
+ class WERR_MISSING_PARAMETER extends WalletError_1.WalletError {
63
+ constructor(parameter) {
64
+ super('WERR_MISSING_PARAMETER', `The required ${parameter} parameter is missing.`);
65
+ this.parameter = parameter;
66
+ }
67
+ }
68
+ exports.WERR_MISSING_PARAMETER = WERR_MISSING_PARAMETER;
69
+ /**
70
+ * The request is invalid.
71
+ */
72
+ class WERR_BAD_REQUEST extends WalletError_1.WalletError {
73
+ constructor(message) {
74
+ super('WERR_BAD_REQUEST', message !== null && message !== void 0 ? message : 'The request is invalid.');
75
+ }
76
+ }
77
+ exports.WERR_BAD_REQUEST = WERR_BAD_REQUEST;
78
+ /**
79
+ * Configured network chain is invalid or does not match across services.
80
+ */
81
+ class WERR_NETWORK_CHAIN extends WalletError_1.WalletError {
82
+ constructor(message) {
83
+ super('WERR_NETWORK_CHAIN', message !== null && message !== void 0 ? message : 'Configured network chain is invalid or does not match across services.');
84
+ }
85
+ }
86
+ exports.WERR_NETWORK_CHAIN = WERR_NETWORK_CHAIN;
87
+ /**
88
+ * Access is denied due to an authorization error.
89
+ */
90
+ class WERR_UNAUTHORIZED extends WalletError_1.WalletError {
91
+ constructor(message) {
92
+ super('WERR_UNAUTHORIZED', message !== null && message !== void 0 ? message : 'Access is denied due to an authorization error.');
93
+ }
94
+ }
95
+ exports.WERR_UNAUTHORIZED = WERR_UNAUTHORIZED;
96
+ /**
97
+ * WalletStorageManager is not accessing user's active storage or there are conflicting active stores configured.
98
+ */
99
+ class WERR_NOT_ACTIVE extends WalletError_1.WalletError {
100
+ constructor(message) {
101
+ super('WERR_NOT_ACTIVE', message !== null && message !== void 0 ? message : `WalletStorageManager is not accessing user's active storage or there are conflicting active stores configured.`);
102
+ }
103
+ }
104
+ exports.WERR_NOT_ACTIVE = WERR_NOT_ACTIVE;
105
+ /**
106
+ * Insufficient funds in the available inputs to cover the cost of the required outputs
107
+ * and the transaction fee (${moreSatoshisNeeded} more satoshis are needed,
108
+ * for a total of ${totalSatoshisNeeded}), plus whatever would be required in order
109
+ * to pay the fee to unlock and spend the outputs used to provide the additional satoshis.
110
+ */
111
+ class WERR_INSUFFICIENT_FUNDS extends WalletError_1.WalletError {
112
+ /**
113
+ * @param totalSatoshisNeeded Total satoshis required to fund transactions after net of required inputs and outputs.
114
+ * @param moreSatoshisNeeded Shortfall on total satoshis required to fund transactions after net of required inputs and outputs.
115
+ */
116
+ constructor(totalSatoshisNeeded, moreSatoshisNeeded) {
117
+ super('WERR_INSUFFICIENT_FUNDS', `Insufficient funds in the available inputs to cover the cost of the required outputs and the transaction fee (${moreSatoshisNeeded} more satoshis are needed, for a total of ${totalSatoshisNeeded}), plus whatever would be required in order to pay the fee to unlock and spend the outputs used to provide the additional satoshis.`);
118
+ this.totalSatoshisNeeded = totalSatoshisNeeded;
119
+ this.moreSatoshisNeeded = moreSatoshisNeeded;
120
+ }
121
+ }
122
+ exports.WERR_INSUFFICIENT_FUNDS = WERR_INSUFFICIENT_FUNDS;
123
+ class WERR_INVALID_PUBLIC_KEY extends WalletError_1.WalletError {
124
+ /**
125
+ * @param key The invalid public key that caused the error.
126
+ * @param environment Optional environment flag to control whether the key is included in the message.
127
+ */
128
+ constructor(key, network = 'mainnet') {
129
+ const message = network === 'mainnet'
130
+ ? `The provided public key "${key}" is invalid or malformed.`
131
+ : `The provided public key is invalid or malformed.`;
132
+ super('WERR_INVALID_PUBLIC_KEY', message);
133
+ this.key = key;
134
+ }
135
+ }
136
+ exports.WERR_INVALID_PUBLIC_KEY = WERR_INVALID_PUBLIC_KEY;
137
+ /**
138
+ * When a `createAction` or `signAction` is completed in undelayed mode (`acceptDelayedBroadcast`: false),
139
+ * any unsucccessful result will return the results by way of this exception to ensure attention is
140
+ * paid to processing errors.
141
+ */
142
+ class WERR_REVIEW_ACTIONS extends WalletError_1.WalletError {
143
+ /**
144
+ * All parameters correspond to their comparable `createAction` or `signSction` results
145
+ * with the exception of `reviewActionResults`;
146
+ * which contains more details, particularly for double spend results.
147
+ */
148
+ constructor(reviewActionResults, sendWithResults, txid, tx, noSendChange) {
149
+ super('WERR_REVIEW_ACTIONS', 'Undelayed createAction or signAction results require review.');
150
+ this.reviewActionResults = reviewActionResults;
151
+ this.sendWithResults = sendWithResults;
152
+ this.txid = txid;
153
+ this.tx = tx;
154
+ this.noSendChange = noSendChange;
155
+ }
156
+ }
157
+ exports.WERR_REVIEW_ACTIONS = WERR_REVIEW_ACTIONS;
158
+ //# sourceMappingURL=WERR_errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WERR_errors.js","sourceRoot":"","sources":["../../../../src/sdk/WERR_errors.ts"],"names":[],"mappings":";;;AACA,+CAA2C;AAG3C;;GAEG;AACH,MAAa,oBAAqB,SAAQ,yBAAW;IACnD,YAAY,OAAgB;QAC1B,KAAK,CAAC,sBAAsB,EAAE,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,kBAAkB,CAAC,CAAA;IAC9D,CAAC;CACF;AAJD,oDAIC;AAED;;;;GAIG;AACH,MAAa,aAAc,SAAQ,yBAAW;IAC5C,YAAY,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B,mBAAmB,CAAsB;QACzC,oBAAe,GAAf,eAAe,CAAkB;QACjC,SAAI,GAAJ,IAAI,CAAgB;QACpB,OAAE,GAAF,EAAE,CAAa;QACf,iBAAY,GAAZ,YAAY,CAAmB;IAGxC,CAAC;CACF;AAfD,kDAeC"}
@@ -0,0 +1,44 @@
1
+ import { ErrorCodeString10To40Bytes, ErrorDescriptionString20To200Bytes, WalletErrorObject } from '@bsv/sdk';
2
+ /**
3
+ * Derived class constructors should use the derived class name as the value for `name`,
4
+ * and an internationalizable constant string for `message`.
5
+ *
6
+ * If a derived class intends to wrap another WalletError, the public property should
7
+ * be named `walletError` and will be recovered by `fromUnknown`.
8
+ *
9
+ * Optionaly, the derived class `message` can include template parameters passed in
10
+ * to the constructor. See WERR_MISSING_PARAMETER for an example.
11
+ *
12
+ * To avoid derived class name colisions, packages should include a package specific
13
+ * identifier after the 'WERR_' prefix. e.g. 'WERR_FOO_' as the prefix for Foo package error
14
+ * classes.
15
+ */
16
+ export declare class WalletError extends Error implements WalletErrorObject {
17
+ details?: Record<string, string> | undefined;
18
+ isError: true;
19
+ constructor(name: string, message: string, stack?: string, details?: Record<string, string> | undefined);
20
+ /**
21
+ * Error class compatible accessor for `code`.
22
+ */
23
+ get code(): ErrorCodeString10To40Bytes;
24
+ set code(v: ErrorCodeString10To40Bytes);
25
+ /**
26
+ * Error class compatible accessor for `description`.
27
+ */
28
+ get description(): ErrorDescriptionString20To200Bytes;
29
+ set description(v: ErrorDescriptionString20To200Bytes);
30
+ /**
31
+ * Recovers all public fields from WalletError derived error classes and relevant Error derived errors.
32
+ *
33
+ */
34
+ static fromUnknown(err: unknown): WalletError;
35
+ /**
36
+ * @returns standard HTTP error status object with status property set to 'error'.
37
+ */
38
+ asStatus(): {
39
+ status: string;
40
+ code: string;
41
+ description: string;
42
+ };
43
+ }
44
+ //# sourceMappingURL=WalletError.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WalletError.d.ts","sourceRoot":"","sources":["../../../../src/sdk/WalletError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,kCAAkC,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAE5G;;;;;;;;;;;;;GAaG;AACH,qBAAa,WAAY,SAAQ,KAAM,YAAW,iBAAiB;IAQxD,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IANzC,OAAO,EAAE,IAAI,CAAO;gBAGlB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,KAAK,CAAC,EAAE,MAAM,EACP,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,YAAA;IAOzC;;OAEG;IACH,IAAI,IAAI,IAAI,0BAA0B,CAErC;IACD,IAAI,IAAI,CAAC,CAAC,EAAE,0BAA0B,EAErC;IAED;;OAEG;IACH,IAAI,WAAW,IAAI,kCAAkC,CAEpD;IACD,IAAI,WAAW,CAAC,CAAC,EAAE,kCAAkC,EAEpD;IAED;;;OAGG;IACH,MAAM,CAAC,WAAW,CAAC,GAAG,EAAE,OAAO,GAAG,WAAW;IAqD7C;;OAEG;IACH,QAAQ,IAAI;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE;CAOlE"}