@attocash/cli 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (400) hide show
  1. package/LICENSE +28 -0
  2. package/README.md +707 -0
  3. package/dist/application/app.d.ts +138 -0
  4. package/dist/application/app.js +654 -0
  5. package/dist/application/operations.d.ts +9 -0
  6. package/dist/application/operations.js +96 -0
  7. package/dist/cli/cli.d.ts +1 -0
  8. package/dist/cli/cli.js +460 -0
  9. package/dist/cli/help.d.ts +4 -0
  10. package/dist/cli/help.js +49 -0
  11. package/dist/cli/main.d.ts +2 -0
  12. package/dist/cli/main.js +13 -0
  13. package/dist/cli/onboarding.d.ts +14 -0
  14. package/dist/cli/onboarding.js +144 -0
  15. package/dist/cli/output.d.ts +2 -0
  16. package/dist/cli/output.js +231 -0
  17. package/dist/cli/terminal.d.ts +6 -0
  18. package/dist/cli/terminal.js +92 -0
  19. package/dist/cli/update-check.d.ts +1 -0
  20. package/dist/cli/update-check.js +12 -0
  21. package/dist/cli/updates.d.ts +2 -0
  22. package/dist/cli/updates.js +98 -0
  23. package/dist/core.d.ts +14 -0
  24. package/dist/core.js +14 -0
  25. package/dist/doctor/credential-probe.d.ts +7 -0
  26. package/dist/doctor/credential-probe.js +49 -0
  27. package/dist/doctor/doctor.d.ts +4 -0
  28. package/dist/doctor/doctor.js +213 -0
  29. package/dist/doctor/keyring.d.ts +7 -0
  30. package/dist/doctor/keyring.js +150 -0
  31. package/dist/doctor/profile.d.ts +19 -0
  32. package/dist/doctor/profile.js +73 -0
  33. package/dist/doctor/types.d.ts +40 -0
  34. package/dist/doctor/types.js +1 -0
  35. package/dist/domain/amount.d.ts +6 -0
  36. package/dist/domain/amount.js +27 -0
  37. package/dist/domain/errors.d.ts +10 -0
  38. package/dist/domain/errors.js +16 -0
  39. package/dist/labels/directory.d.ts +87 -0
  40. package/dist/labels/directory.js +140 -0
  41. package/dist/labels/personal.d.ts +17 -0
  42. package/dist/labels/personal.js +56 -0
  43. package/dist/labels/presentation.d.ts +154 -0
  44. package/dist/labels/presentation.js +90 -0
  45. package/dist/network/reader.d.ts +31 -0
  46. package/dist/network/reader.js +370 -0
  47. package/dist/network/retry.d.ts +7 -0
  48. package/dist/network/retry.js +53 -0
  49. package/dist/network/work.d.ts +3 -0
  50. package/dist/network/work.js +66 -0
  51. package/dist/pricing/market.d.ts +29 -0
  52. package/dist/pricing/market.js +150 -0
  53. package/dist/pricing/terms.d.ts +6 -0
  54. package/dist/pricing/terms.js +12 -0
  55. package/dist/spending/destination.d.ts +16 -0
  56. package/dist/spending/destination.js +42 -0
  57. package/dist/spending/journal.d.ts +28 -0
  58. package/dist/spending/journal.js +69 -0
  59. package/dist/spending/ledger.d.ts +118 -0
  60. package/dist/spending/ledger.js +444 -0
  61. package/dist/spending/payments.d.ts +67 -0
  62. package/dist/spending/payments.js +424 -0
  63. package/dist/spending/pool.d.ts +13 -0
  64. package/dist/spending/pool.js +38 -0
  65. package/dist/spending/reconcile.d.ts +18 -0
  66. package/dist/spending/reconcile.js +64 -0
  67. package/dist/storage/profiles.d.ts +13 -0
  68. package/dist/storage/profiles.js +86 -0
  69. package/dist/storage/secrets.d.ts +16 -0
  70. package/dist/storage/secrets.js +104 -0
  71. package/dist/storage/state.d.ts +32 -0
  72. package/dist/storage/state.js +255 -0
  73. package/dist/wallet/auto-receive.d.ts +57 -0
  74. package/dist/wallet/auto-receive.js +140 -0
  75. package/dist/wallet/defaults.d.ts +3 -0
  76. package/dist/wallet/defaults.js +26 -0
  77. package/dist/wallet/signing.d.ts +17 -0
  78. package/dist/wallet/signing.js +128 -0
  79. package/dist/wallet/types.d.ts +65 -0
  80. package/dist/wallet/types.js +1 -0
  81. package/dist/wallet/work.d.ts +29 -0
  82. package/dist/wallet/work.js +154 -0
  83. package/dist/watches/manager.d.ts +75 -0
  84. package/dist/watches/manager.js +197 -0
  85. package/node_modules/@attocash/commons-core/Kotlin-DateTime-library-kotlinx-datetime.mjs +6678 -0
  86. package/node_modules/@attocash/commons-core/Kotlin-DateTime-library-kotlinx-datetime.mjs.map +1 -0
  87. package/node_modules/@attocash/commons-core/LICENSE +28 -0
  88. package/node_modules/@attocash/commons-core/README.md +118 -0
  89. package/node_modules/@attocash/commons-core/commons-commons-core.d.mts +1036 -0
  90. package/node_modules/@attocash/commons-core/commons-commons-core.mjs +7701 -0
  91. package/node_modules/@attocash/commons-core/commons-commons-core.mjs.map +1 -0
  92. package/node_modules/@attocash/commons-core/kotlin-kotlin-stdlib.mjs +17681 -0
  93. package/node_modules/@attocash/commons-core/kotlin-kotlin-stdlib.mjs.map +1 -0
  94. package/node_modules/@attocash/commons-core/kotlin_org_jetbrains_kotlin_kotlin_dom_api_compat.mjs +4 -0
  95. package/node_modules/@attocash/commons-core/kotlin_org_jetbrains_kotlin_kotlin_dom_api_compat.mjs.map +1 -0
  96. package/node_modules/@attocash/commons-core/kotlinx-io-kotlinx-io-bytestring.mjs +209 -0
  97. package/node_modules/@attocash/commons-core/kotlinx-io-kotlinx-io-bytestring.mjs.map +1 -0
  98. package/node_modules/@attocash/commons-core/kotlinx-io-kotlinx-io-core.mjs +2284 -0
  99. package/node_modules/@attocash/commons-core/kotlinx-io-kotlinx-io-core.mjs.map +1 -0
  100. package/node_modules/@attocash/commons-core/kotlinx-serialization-kotlinx-serialization-core.mjs +6042 -0
  101. package/node_modules/@attocash/commons-core/kotlinx-serialization-kotlinx-serialization-core.mjs.map +1 -0
  102. package/node_modules/@attocash/commons-core/kotlinx-serialization-kotlinx-serialization-json.mjs +5294 -0
  103. package/node_modules/@attocash/commons-core/kotlinx-serialization-kotlinx-serialization-json.mjs.map +1 -0
  104. package/node_modules/@attocash/commons-core/package.json +27 -0
  105. package/node_modules/@attocash/commons-node/LICENSE +28 -0
  106. package/node_modules/@attocash/commons-node/README.md +92 -0
  107. package/node_modules/@attocash/commons-node/commons-commons-node.d.mts +255 -0
  108. package/node_modules/@attocash/commons-node/commons-commons-node.mjs +2977 -0
  109. package/node_modules/@attocash/commons-node/commons-commons-node.mjs.map +1 -0
  110. package/node_modules/@attocash/commons-node/kotlin-logging.mjs +432 -0
  111. package/node_modules/@attocash/commons-node/kotlin-logging.mjs.map +1 -0
  112. package/node_modules/@attocash/commons-node/kotlinx-serialization-kotlinx-serialization-json.mjs +5294 -0
  113. package/node_modules/@attocash/commons-node/kotlinx-serialization-kotlinx-serialization-json.mjs.map +1 -0
  114. package/node_modules/@attocash/commons-node/package.json +29 -0
  115. package/node_modules/@attocash/commons-node-remote/LICENSE +28 -0
  116. package/node_modules/@attocash/commons-node-remote/README.md +61 -0
  117. package/node_modules/@attocash/commons-node-remote/commons-commons-node-remote.d.mts +122 -0
  118. package/node_modules/@attocash/commons-node-remote/commons-commons-node-remote.mjs +1810 -0
  119. package/node_modules/@attocash/commons-node-remote/commons-commons-node-remote.mjs.map +1 -0
  120. package/node_modules/@attocash/commons-node-remote/kotlin-logging.mjs +432 -0
  121. package/node_modules/@attocash/commons-node-remote/kotlin-logging.mjs.map +1 -0
  122. package/node_modules/@attocash/commons-node-remote/kotlinx-browser.mjs +8 -0
  123. package/node_modules/@attocash/commons-node-remote/kotlinx-browser.mjs.map +1 -0
  124. package/node_modules/@attocash/commons-node-remote/kotlinx-serialization-kotlinx-serialization-json-io.mjs +4 -0
  125. package/node_modules/@attocash/commons-node-remote/kotlinx-serialization-kotlinx-serialization-json-io.mjs.map +1 -0
  126. package/node_modules/@attocash/commons-node-remote/kotlinx-serialization-kotlinx-serialization-json.mjs +5294 -0
  127. package/node_modules/@attocash/commons-node-remote/kotlinx-serialization-kotlinx-serialization-json.mjs.map +1 -0
  128. package/node_modules/@attocash/commons-node-remote/package.json +31 -0
  129. package/node_modules/@attocash/commons-transport/LICENSE +28 -0
  130. package/node_modules/@attocash/commons-transport/README.md +5 -0
  131. package/node_modules/@attocash/commons-transport/commons-commons-transport.d.mts +64 -0
  132. package/node_modules/@attocash/commons-transport/commons-commons-transport.mjs +249 -0
  133. package/node_modules/@attocash/commons-transport/commons-commons-transport.mjs.map +1 -0
  134. package/node_modules/@attocash/commons-transport/kotlinx-atomicfu.mjs +263 -0
  135. package/node_modules/@attocash/commons-transport/kotlinx-atomicfu.mjs.map +1 -0
  136. package/node_modules/@attocash/commons-transport/kotlinx-browser.mjs +8 -0
  137. package/node_modules/@attocash/commons-transport/kotlinx-browser.mjs.map +1 -0
  138. package/node_modules/@attocash/commons-transport/kotlinx-coroutines-core.mjs +11604 -0
  139. package/node_modules/@attocash/commons-transport/kotlinx-coroutines-core.mjs.map +1 -0
  140. package/node_modules/@attocash/commons-transport/kotlinx-serialization-kotlinx-serialization-json-io.mjs +4 -0
  141. package/node_modules/@attocash/commons-transport/kotlinx-serialization-kotlinx-serialization-json-io.mjs.map +1 -0
  142. package/node_modules/@attocash/commons-transport/kotlinx-serialization-kotlinx-serialization-json.mjs +5294 -0
  143. package/node_modules/@attocash/commons-transport/kotlinx-serialization-kotlinx-serialization-json.mjs.map +1 -0
  144. package/node_modules/@attocash/commons-transport/ktor-ktor-client-content-negotiation.mjs +499 -0
  145. package/node_modules/@attocash/commons-transport/ktor-ktor-client-content-negotiation.mjs.map +1 -0
  146. package/node_modules/@attocash/commons-transport/ktor-ktor-client-core.mjs +6456 -0
  147. package/node_modules/@attocash/commons-transport/ktor-ktor-client-core.mjs.map +1 -0
  148. package/node_modules/@attocash/commons-transport/ktor-ktor-events.mjs +83 -0
  149. package/node_modules/@attocash/commons-transport/ktor-ktor-events.mjs.map +1 -0
  150. package/node_modules/@attocash/commons-transport/ktor-ktor-http-cio.mjs +1714 -0
  151. package/node_modules/@attocash/commons-transport/ktor-ktor-http-cio.mjs.map +1 -0
  152. package/node_modules/@attocash/commons-transport/ktor-ktor-http.mjs +3197 -0
  153. package/node_modules/@attocash/commons-transport/ktor-ktor-http.mjs.map +1 -0
  154. package/node_modules/@attocash/commons-transport/ktor-ktor-io.mjs +2290 -0
  155. package/node_modules/@attocash/commons-transport/ktor-ktor-io.mjs.map +1 -0
  156. package/node_modules/@attocash/commons-transport/ktor-ktor-serialization-kotlinx-json.mjs +46 -0
  157. package/node_modules/@attocash/commons-transport/ktor-ktor-serialization-kotlinx-json.mjs.map +1 -0
  158. package/node_modules/@attocash/commons-transport/ktor-ktor-serialization-kotlinx.mjs +482 -0
  159. package/node_modules/@attocash/commons-transport/ktor-ktor-serialization-kotlinx.mjs.map +1 -0
  160. package/node_modules/@attocash/commons-transport/ktor-ktor-serialization.mjs +165 -0
  161. package/node_modules/@attocash/commons-transport/ktor-ktor-serialization.mjs.map +1 -0
  162. package/node_modules/@attocash/commons-transport/ktor-ktor-sse.mjs +4 -0
  163. package/node_modules/@attocash/commons-transport/ktor-ktor-sse.mjs.map +1 -0
  164. package/node_modules/@attocash/commons-transport/ktor-ktor-utils.mjs +3222 -0
  165. package/node_modules/@attocash/commons-transport/ktor-ktor-utils.mjs.map +1 -0
  166. package/node_modules/@attocash/commons-transport/ktor-ktor-websocket-serialization.mjs +4 -0
  167. package/node_modules/@attocash/commons-transport/ktor-ktor-websocket-serialization.mjs.map +1 -0
  168. package/node_modules/@attocash/commons-transport/ktor-ktor-websockets.mjs +1485 -0
  169. package/node_modules/@attocash/commons-transport/ktor-ktor-websockets.mjs.map +1 -0
  170. package/node_modules/@attocash/commons-transport/package.json +29 -0
  171. package/node_modules/@attocash/commons-worker/LICENSE +28 -0
  172. package/node_modules/@attocash/commons-worker/README.md +48 -0
  173. package/node_modules/@attocash/commons-worker/commons-commons-worker.d.mts +73 -0
  174. package/node_modules/@attocash/commons-worker/commons-commons-worker.mjs +702 -0
  175. package/node_modules/@attocash/commons-worker/commons-commons-worker.mjs.map +1 -0
  176. package/node_modules/@attocash/commons-worker/kotlin-logging.mjs +432 -0
  177. package/node_modules/@attocash/commons-worker/kotlin-logging.mjs.map +1 -0
  178. package/node_modules/@attocash/commons-worker/kotlinx-serialization-kotlinx-serialization-json.mjs +5294 -0
  179. package/node_modules/@attocash/commons-worker/kotlinx-serialization-kotlinx-serialization-json.mjs.map +1 -0
  180. package/node_modules/@attocash/commons-worker/package.json +29 -0
  181. package/node_modules/@attocash/commons-worker-remote/LICENSE +28 -0
  182. package/node_modules/@attocash/commons-worker-remote/README.md +60 -0
  183. package/node_modules/@attocash/commons-worker-remote/commons-commons-worker-remote.d.mts +93 -0
  184. package/node_modules/@attocash/commons-worker-remote/commons-commons-worker-remote.mjs +289 -0
  185. package/node_modules/@attocash/commons-worker-remote/commons-commons-worker-remote.mjs.map +1 -0
  186. package/node_modules/@attocash/commons-worker-remote/kotlin-logging.mjs +432 -0
  187. package/node_modules/@attocash/commons-worker-remote/kotlin-logging.mjs.map +1 -0
  188. package/node_modules/@attocash/commons-worker-remote/kotlinx-browser.mjs +8 -0
  189. package/node_modules/@attocash/commons-worker-remote/kotlinx-browser.mjs.map +1 -0
  190. package/node_modules/@attocash/commons-worker-remote/kotlinx-serialization-kotlinx-serialization-json-io.mjs +4 -0
  191. package/node_modules/@attocash/commons-worker-remote/kotlinx-serialization-kotlinx-serialization-json-io.mjs.map +1 -0
  192. package/node_modules/@attocash/commons-worker-remote/kotlinx-serialization-kotlinx-serialization-json.mjs +5294 -0
  193. package/node_modules/@attocash/commons-worker-remote/kotlinx-serialization-kotlinx-serialization-json.mjs.map +1 -0
  194. package/node_modules/@attocash/commons-worker-remote/package.json +31 -0
  195. package/node_modules/@js-joda/core/CHANGELOG.md +363 -0
  196. package/node_modules/@js-joda/core/CheatSheet.md +947 -0
  197. package/node_modules/@js-joda/core/LICENSE +34 -0
  198. package/node_modules/@js-joda/core/README.md +155 -0
  199. package/node_modules/@js-joda/core/bower.json +21 -0
  200. package/node_modules/@js-joda/core/dist/js-joda.d.ts +2452 -0
  201. package/node_modules/@js-joda/core/dist/js-joda.esm.js +13564 -0
  202. package/node_modules/@js-joda/core/dist/js-joda.flow.js +949 -0
  203. package/node_modules/@js-joda/core/dist/js-joda.js +13630 -0
  204. package/node_modules/@js-joda/core/dist/js-joda.js.map +1 -0
  205. package/node_modules/@js-joda/core/dist/js-joda.min.js +5 -0
  206. package/node_modules/@js-joda/core/package.json +76 -0
  207. package/node_modules/@js-joda/core/src/Clock.js +330 -0
  208. package/node_modules/@js-joda/core/src/DayOfWeek.js +451 -0
  209. package/node_modules/@js-joda/core/src/Duration.js +1205 -0
  210. package/node_modules/@js-joda/core/src/Enum.js +30 -0
  211. package/node_modules/@js-joda/core/src/Instant.js +1012 -0
  212. package/node_modules/@js-joda/core/src/LocalDate.js +1703 -0
  213. package/node_modules/@js-joda/core/src/LocalDateTime.js +1686 -0
  214. package/node_modules/@js-joda/core/src/LocalTime.js +1415 -0
  215. package/node_modules/@js-joda/core/src/MathUtil.js +236 -0
  216. package/node_modules/@js-joda/core/src/Month.js +600 -0
  217. package/node_modules/@js-joda/core/src/MonthDay.js +730 -0
  218. package/node_modules/@js-joda/core/src/OffsetDateTime.js +757 -0
  219. package/node_modules/@js-joda/core/src/OffsetTime.js +621 -0
  220. package/node_modules/@js-joda/core/src/Period.js +933 -0
  221. package/node_modules/@js-joda/core/src/StringUtil.js +43 -0
  222. package/node_modules/@js-joda/core/src/Year.js +1015 -0
  223. package/node_modules/@js-joda/core/src/YearConstants.js +21 -0
  224. package/node_modules/@js-joda/core/src/YearMonth.js +1096 -0
  225. package/node_modules/@js-joda/core/src/ZoneId.js +236 -0
  226. package/node_modules/@js-joda/core/src/ZoneIdFactory.js +201 -0
  227. package/node_modules/@js-joda/core/src/ZoneOffset.js +486 -0
  228. package/node_modules/@js-joda/core/src/ZoneRegion.js +72 -0
  229. package/node_modules/@js-joda/core/src/ZonedDateTime.js +2007 -0
  230. package/node_modules/@js-joda/core/src/_init.js +68 -0
  231. package/node_modules/@js-joda/core/src/assert.js +33 -0
  232. package/node_modules/@js-joda/core/src/chrono/ChronoLocalDate.js +230 -0
  233. package/node_modules/@js-joda/core/src/chrono/ChronoLocalDateTime.js +130 -0
  234. package/node_modules/@js-joda/core/src/chrono/ChronoZonedDateTime.js +194 -0
  235. package/node_modules/@js-joda/core/src/chrono/IsoChronology.js +235 -0
  236. package/node_modules/@js-joda/core/src/convert.js +83 -0
  237. package/node_modules/@js-joda/core/src/errors.js +54 -0
  238. package/node_modules/@js-joda/core/src/format/DateTimeBuilder.js +535 -0
  239. package/node_modules/@js-joda/core/src/format/DateTimeFormatter.js +728 -0
  240. package/node_modules/@js-joda/core/src/format/DateTimeFormatterBuilder.js +1545 -0
  241. package/node_modules/@js-joda/core/src/format/DateTimeParseContext.js +297 -0
  242. package/node_modules/@js-joda/core/src/format/DateTimePrintContext.js +138 -0
  243. package/node_modules/@js-joda/core/src/format/DecimalStyle.js +113 -0
  244. package/node_modules/@js-joda/core/src/format/EnumMap.js +70 -0
  245. package/node_modules/@js-joda/core/src/format/ParsePosition.js +31 -0
  246. package/node_modules/@js-joda/core/src/format/ResolverStyle.js +93 -0
  247. package/node_modules/@js-joda/core/src/format/SignStyle.js +38 -0
  248. package/node_modules/@js-joda/core/src/format/StringBuilder.js +47 -0
  249. package/node_modules/@js-joda/core/src/format/TextStyle.js +114 -0
  250. package/node_modules/@js-joda/core/src/format/parser/CharLiteralPrinterParser.js +46 -0
  251. package/node_modules/@js-joda/core/src/format/parser/CompositePrinterParser.js +89 -0
  252. package/node_modules/@js-joda/core/src/format/parser/FractionPrinterParser.js +162 -0
  253. package/node_modules/@js-joda/core/src/format/parser/NumberPrinterParser.js +367 -0
  254. package/node_modules/@js-joda/core/src/format/parser/OffsetIdPrinterParser.js +177 -0
  255. package/node_modules/@js-joda/core/src/format/parser/PadPrinterParserDecorator.js +81 -0
  256. package/node_modules/@js-joda/core/src/format/parser/SettingsParser.js +44 -0
  257. package/node_modules/@js-joda/core/src/format/parser/StringLiteralPrinterParser.js +39 -0
  258. package/node_modules/@js-joda/core/src/format/parser/ZoneIdPrinterParser.js +218 -0
  259. package/node_modules/@js-joda/core/src/js-joda.js +210 -0
  260. package/node_modules/@js-joda/core/src/license-preamble.js +3 -0
  261. package/node_modules/@js-joda/core/src/temporal/ChronoField.js +470 -0
  262. package/node_modules/@js-joda/core/src/temporal/ChronoUnit.js +310 -0
  263. package/node_modules/@js-joda/core/src/temporal/DefaultInterfaceTemporal.js +118 -0
  264. package/node_modules/@js-joda/core/src/temporal/IsoFields.js +859 -0
  265. package/node_modules/@js-joda/core/src/temporal/NativeJsTemporal.js +105 -0
  266. package/node_modules/@js-joda/core/src/temporal/Temporal.js +346 -0
  267. package/node_modules/@js-joda/core/src/temporal/TemporalAccessor.js +125 -0
  268. package/node_modules/@js-joda/core/src/temporal/TemporalAdjuster.js +92 -0
  269. package/node_modules/@js-joda/core/src/temporal/TemporalAdjusters.js +464 -0
  270. package/node_modules/@js-joda/core/src/temporal/TemporalAmount.js +166 -0
  271. package/node_modules/@js-joda/core/src/temporal/TemporalField.js +248 -0
  272. package/node_modules/@js-joda/core/src/temporal/TemporalQueries.js +223 -0
  273. package/node_modules/@js-joda/core/src/temporal/TemporalQueriesFactory.js +77 -0
  274. package/node_modules/@js-joda/core/src/temporal/TemporalQuery.js +107 -0
  275. package/node_modules/@js-joda/core/src/temporal/TemporalUnit.js +179 -0
  276. package/node_modules/@js-joda/core/src/temporal/ValueRange.js +257 -0
  277. package/node_modules/@js-joda/core/src/use.js +20 -0
  278. package/node_modules/@js-joda/core/src/zone/SystemDefaultZoneId.js +31 -0
  279. package/node_modules/@js-joda/core/src/zone/SystemDefaultZoneRules.js +162 -0
  280. package/node_modules/@js-joda/core/src/zone/ZoneOffsetTransition.js +289 -0
  281. package/node_modules/@js-joda/core/src/zone/ZoneRules.js +464 -0
  282. package/node_modules/@js-joda/core/src/zone/ZoneRulesProvider.js +36 -0
  283. package/node_modules/@noble/hashes/LICENSE +21 -0
  284. package/node_modules/@noble/hashes/README.md +563 -0
  285. package/node_modules/@noble/hashes/_blake.d.ts +21 -0
  286. package/node_modules/@noble/hashes/_blake.d.ts.map +1 -0
  287. package/node_modules/@noble/hashes/_blake.js +52 -0
  288. package/node_modules/@noble/hashes/_blake.js.map +1 -0
  289. package/node_modules/@noble/hashes/_md.d.ts +99 -0
  290. package/node_modules/@noble/hashes/_md.d.ts.map +1 -0
  291. package/node_modules/@noble/hashes/_md.js +202 -0
  292. package/node_modules/@noble/hashes/_md.js.map +1 -0
  293. package/node_modules/@noble/hashes/_u64.d.ts +63 -0
  294. package/node_modules/@noble/hashes/_u64.d.ts.map +1 -0
  295. package/node_modules/@noble/hashes/_u64.js +84 -0
  296. package/node_modules/@noble/hashes/_u64.js.map +1 -0
  297. package/node_modules/@noble/hashes/argon2.d.ts +112 -0
  298. package/node_modules/@noble/hashes/argon2.d.ts.map +1 -0
  299. package/node_modules/@noble/hashes/argon2.js +517 -0
  300. package/node_modules/@noble/hashes/argon2.js.map +1 -0
  301. package/node_modules/@noble/hashes/blake1.d.ts +156 -0
  302. package/node_modules/@noble/hashes/blake1.d.ts.map +1 -0
  303. package/node_modules/@noble/hashes/blake1.js +560 -0
  304. package/node_modules/@noble/hashes/blake1.js.map +1 -0
  305. package/node_modules/@noble/hashes/blake2.d.ts +184 -0
  306. package/node_modules/@noble/hashes/blake2.d.ts.map +1 -0
  307. package/node_modules/@noble/hashes/blake2.js +501 -0
  308. package/node_modules/@noble/hashes/blake2.js.map +1 -0
  309. package/node_modules/@noble/hashes/blake3.d.ts +68 -0
  310. package/node_modules/@noble/hashes/blake3.d.ts.map +1 -0
  311. package/node_modules/@noble/hashes/blake3.js +284 -0
  312. package/node_modules/@noble/hashes/blake3.js.map +1 -0
  313. package/node_modules/@noble/hashes/eskdf.d.ts +92 -0
  314. package/node_modules/@noble/hashes/eskdf.d.ts.map +1 -0
  315. package/node_modules/@noble/hashes/eskdf.js +218 -0
  316. package/node_modules/@noble/hashes/eskdf.js.map +1 -0
  317. package/node_modules/@noble/hashes/hkdf.d.ts +64 -0
  318. package/node_modules/@noble/hashes/hkdf.d.ts.map +1 -0
  319. package/node_modules/@noble/hashes/hkdf.js +120 -0
  320. package/node_modules/@noble/hashes/hkdf.js.map +1 -0
  321. package/node_modules/@noble/hashes/hmac.d.ts +47 -0
  322. package/node_modules/@noble/hashes/hmac.d.ts.map +1 -0
  323. package/node_modules/@noble/hashes/hmac.js +93 -0
  324. package/node_modules/@noble/hashes/hmac.js.map +1 -0
  325. package/node_modules/@noble/hashes/index.d.ts +2 -0
  326. package/node_modules/@noble/hashes/index.d.ts.map +1 -0
  327. package/node_modules/@noble/hashes/index.js +35 -0
  328. package/node_modules/@noble/hashes/index.js.map +1 -0
  329. package/node_modules/@noble/hashes/legacy.d.ts +102 -0
  330. package/node_modules/@noble/hashes/legacy.d.ts.map +1 -0
  331. package/node_modules/@noble/hashes/legacy.js +327 -0
  332. package/node_modules/@noble/hashes/legacy.js.map +1 -0
  333. package/node_modules/@noble/hashes/package.json +97 -0
  334. package/node_modules/@noble/hashes/pbkdf2.d.ts +56 -0
  335. package/node_modules/@noble/hashes/pbkdf2.d.ts.map +1 -0
  336. package/node_modules/@noble/hashes/pbkdf2.js +135 -0
  337. package/node_modules/@noble/hashes/pbkdf2.js.map +1 -0
  338. package/node_modules/@noble/hashes/scrypt.d.ts +65 -0
  339. package/node_modules/@noble/hashes/scrypt.d.ts.map +1 -0
  340. package/node_modules/@noble/hashes/scrypt.js +257 -0
  341. package/node_modules/@noble/hashes/scrypt.js.map +1 -0
  342. package/node_modules/@noble/hashes/sha2.d.ts +249 -0
  343. package/node_modules/@noble/hashes/sha2.d.ts.map +1 -0
  344. package/node_modules/@noble/hashes/sha2.js +458 -0
  345. package/node_modules/@noble/hashes/sha2.js.map +1 -0
  346. package/node_modules/@noble/hashes/sha3-addons.d.ts +461 -0
  347. package/node_modules/@noble/hashes/sha3-addons.d.ts.map +1 -0
  348. package/node_modules/@noble/hashes/sha3-addons.js +783 -0
  349. package/node_modules/@noble/hashes/sha3-addons.js.map +1 -0
  350. package/node_modules/@noble/hashes/sha3.d.ts +199 -0
  351. package/node_modules/@noble/hashes/sha3.d.ts.map +1 -0
  352. package/node_modules/@noble/hashes/sha3.js +431 -0
  353. package/node_modules/@noble/hashes/sha3.js.map +1 -0
  354. package/node_modules/@noble/hashes/src/_blake.ts +57 -0
  355. package/node_modules/@noble/hashes/src/_md.ts +222 -0
  356. package/node_modules/@noble/hashes/src/_u64.ts +117 -0
  357. package/node_modules/@noble/hashes/src/argon2.ts +667 -0
  358. package/node_modules/@noble/hashes/src/blake1.ts +614 -0
  359. package/node_modules/@noble/hashes/src/blake2.ts +582 -0
  360. package/node_modules/@noble/hashes/src/blake3.ts +317 -0
  361. package/node_modules/@noble/hashes/src/eskdf.ts +259 -0
  362. package/node_modules/@noble/hashes/src/hkdf.ts +133 -0
  363. package/node_modules/@noble/hashes/src/hmac.ts +126 -0
  364. package/node_modules/@noble/hashes/src/index.ts +33 -0
  365. package/node_modules/@noble/hashes/src/legacy.ts +339 -0
  366. package/node_modules/@noble/hashes/src/pbkdf2.ts +175 -0
  367. package/node_modules/@noble/hashes/src/scrypt.ts +315 -0
  368. package/node_modules/@noble/hashes/src/sha2.ts +530 -0
  369. package/node_modules/@noble/hashes/src/sha3-addons.ts +983 -0
  370. package/node_modules/@noble/hashes/src/sha3.ts +485 -0
  371. package/node_modules/@noble/hashes/src/utils.ts +848 -0
  372. package/node_modules/@noble/hashes/src/webcrypto.ts +239 -0
  373. package/node_modules/@noble/hashes/utils.d.ts +519 -0
  374. package/node_modules/@noble/hashes/utils.d.ts.map +1 -0
  375. package/node_modules/@noble/hashes/utils.js +578 -0
  376. package/node_modules/@noble/hashes/utils.js.map +1 -0
  377. package/node_modules/@noble/hashes/webcrypto.d.ts +120 -0
  378. package/node_modules/@noble/hashes/webcrypto.d.ts.map +1 -0
  379. package/node_modules/@noble/hashes/webcrypto.js +165 -0
  380. package/node_modules/@noble/hashes/webcrypto.js.map +1 -0
  381. package/node_modules/ws/LICENSE +20 -0
  382. package/node_modules/ws/README.md +548 -0
  383. package/node_modules/ws/browser.js +8 -0
  384. package/node_modules/ws/index.js +22 -0
  385. package/node_modules/ws/lib/buffer-util.js +131 -0
  386. package/node_modules/ws/lib/constants.js +19 -0
  387. package/node_modules/ws/lib/event-target.js +292 -0
  388. package/node_modules/ws/lib/extension.js +203 -0
  389. package/node_modules/ws/lib/limiter.js +55 -0
  390. package/node_modules/ws/lib/permessage-deflate.js +530 -0
  391. package/node_modules/ws/lib/receiver.js +743 -0
  392. package/node_modules/ws/lib/sender.js +607 -0
  393. package/node_modules/ws/lib/stream.js +161 -0
  394. package/node_modules/ws/lib/subprotocol.js +62 -0
  395. package/node_modules/ws/lib/validation.js +152 -0
  396. package/node_modules/ws/lib/websocket-server.js +562 -0
  397. package/node_modules/ws/lib/websocket.js +1407 -0
  398. package/node_modules/ws/package.json +74 -0
  399. package/node_modules/ws/wrapper.mjs +21 -0
  400. package/package.json +53 -0
@@ -0,0 +1,702 @@
1
+ import {
2
+ initMetadataForCompanion1wyw17z38v6ac as initMetadataForCompanion,
3
+ AutoCloseable1l5p57f9lp7kv as AutoCloseable,
4
+ initMetadataForInterface1egvbzx539z91 as initMetadataForInterface,
5
+ VOID3gxj6tk5isa35 as VOID,
6
+ Unit_instance3vdlo4e4f5ggx as Unit_instance,
7
+ Exceptiondt2hlxn7j7vw as Exception,
8
+ constructCallableReference23y65rf941mch as constructCallableReference,
9
+ HashMap1a0ld5kgwhmhv as HashMap,
10
+ initMetadataForClassbxx6q50dy2s7 as initMetadataForClass,
11
+ _UShort___get_data__impl__g02451joe1vsk2vach as _UShort___get_data__impl__g0245,
12
+ protoOf180f3jzyo7rfj as protoOf,
13
+ toByte4i43936u611k as toByte,
14
+ fromInt2ii0rejb1w62w as fromInt,
15
+ _ULong___init__impl__c78o9k3fkiaf1q5xsf7 as _ULong___init__impl__c78o9k,
16
+ _ULong___get_data__impl__fggpzb35t7vg7og3i8u as _ULong___get_data__impl__fggpzb,
17
+ multiply2k9eolhnz1bjv as multiply,
18
+ add2suhfggl4zvkk as add,
19
+ get_ONEazvfdh9ju3d4 as get_ONE,
20
+ ulongDivide3e52ct8hxp5n7 as ulongDivide,
21
+ LazyThreadSafetyMode_PUBLICATION_getInstance20ynwq7b0awd8 as LazyThreadSafetyMode_PUBLICATION_getInstance,
22
+ lazy1261dae0bgscp as lazy,
23
+ THROW_CCE2g6jy02ryeudk as THROW_CCE,
24
+ initMetadataForObject1cxne3s9w65el as initMetadataForObject,
25
+ getStringHashCode26igk1bx568vk as getStringHashCode,
26
+ createThis2j2avj17cvnv2 as createThis,
27
+ IllegalArgumentException2asla15b5jaob as IllegalArgumentException,
28
+ toString1pkumu07cwy4m as toString,
29
+ promisify1z0ncraq1ipzh as promisify,
30
+ await335x4cz7ixnm4 as await_0,
31
+ _UShort___init__impl__jigrne1zu56ujvuii2n as _UShort___init__impl__jigrne,
32
+ } from '@attocash/commons-core/kotlin-kotlin-stdlib.mjs';
33
+ import {
34
+ Companion_instancer1aiy15xy072 as Companion_instance,
35
+ Companion_instance1lv0f3n6qbbrs as Companion_instance_0,
36
+ AttoWorkTarget3v4zqc5kfdpel as AttoWorkTarget,
37
+ AttoWorkrxvyu0kmlxrx as AttoWork,
38
+ toByteArray1xevcsrk0l409 as toByteArray,
39
+ values1ix93lj72gxe9 as values,
40
+ AttoInstantAsLongSerializer_getInstance28lzw2ejfk8eg as AttoInstantAsLongSerializer_getInstance,
41
+ AttoWorkAsStringSerializer_getInstance2p64tpzgy1wj6 as AttoWorkAsStringSerializer_getInstance,
42
+ toHexcxaq2tti5e5x as toHex,
43
+ } from '@attocash/commons-core/commons-commons-core.mjs';
44
+ import {
45
+ Dispatchers_getInstance20p7pyqnrepag as Dispatchers_getInstance,
46
+ asyncz02dsa2nb2zt as async,
47
+ SupervisorJobythnfxkr3jxc as SupervisorJob,
48
+ CoroutineScopelux7s7zphw7e as CoroutineScope,
49
+ Mutex16li1l0asjv17 as Mutex,
50
+ cancel36mj9lv3a0whl as cancel,
51
+ Job13y4jkazwjho0 as Job,
52
+ Key_instancebefxze3q9f64 as Key_instance,
53
+ get_isActivehakov5bm97hw as get_isActive,
54
+ yieldyvh2mab0488 as yield_0,
55
+ CompletableDeferred2lnqvsbvx74d3 as CompletableDeferred,
56
+ launch1c91vkjzdi9sd as launch,
57
+ } from '@attocash/commons-transport/kotlinx-coroutines-core.mjs';
58
+ import {
59
+ createSimpleEnumSerializer2guioz11kk1m0 as createSimpleEnumSerializer,
60
+ PluginGeneratedSerialDescriptorqdzeg5asqhfg as PluginGeneratedSerialDescriptor,
61
+ UnknownFieldExceptiona60e3a6v1xqo as UnknownFieldException,
62
+ StringSerializer_getInstancerxlnwnlbnwri as StringSerializer_getInstance,
63
+ typeParametersSerializers2likxjr48tr7y as typeParametersSerializers,
64
+ GeneratedSerializer1f7t7hssdd2ws as GeneratedSerializer,
65
+ throwMissingFieldException2cmke0v3ynf14 as throwMissingFieldException,
66
+ SerializableWithd2dap36updxd as SerializableWith,
67
+ } from '@attocash/commons-core/kotlinx-serialization-kotlinx-serialization-core.mjs';
68
+ //region block: imports
69
+ var imul = Math.imul;
70
+ //endregion
71
+ //region block: pre-declaration
72
+ class Companion {
73
+ k3j(parallelism) {
74
+ return new AttoWorkerCpu(parallelism);
75
+ }
76
+ l3j() {
77
+ return defaultCpuWorker();
78
+ }
79
+ }
80
+ class AttoWorker {}
81
+ function *work(network, timestamp, target, $completion) {
82
+ var threshold = Companion_instance.p2q(network, timestamp);
83
+ return yield* this.m3j(threshold, target, $completion);
84
+ }
85
+ function *work_0(block, $completion) {
86
+ var target = block.y2h();
87
+ return yield* this.n3j(block.network, block.timestamp, target, $completion);
88
+ }
89
+ class AttoWorkerCache {
90
+ constructor(delegate, dispatcher) {
91
+ dispatcher = dispatcher === VOID ? Dispatchers_getInstance().q32_1 : dispatcher;
92
+ this.p3j_1 = delegate;
93
+ this.q3j_1 = CoroutineScope(dispatcher.xl(SupervisorJob()));
94
+ this.r3j_1 = Mutex();
95
+ this.s3j_1 = HashMap.v8();
96
+ }
97
+ *m3j(threshold, target, $completion) {
98
+ var deferred = yield* /*#__NOINLINE__*/delegateWork(this, target, AttoWorkerCache$work$slambda(this, threshold), $completion);
99
+ var work = yield* deferred.d2u($completion);
100
+ // Inline function 'kotlinx.coroutines.sync.withLock' call
101
+ var this_0 = this.r3j_1;
102
+ yield* this_0.c3h(null, $completion);
103
+ var tmp;
104
+ try {
105
+ tmp = this.s3j_1.h4(target);
106
+ }finally {
107
+ this_0.o3g(null);
108
+ }
109
+ if (Companion_instance.r2q(threshold, target, work.value)) {
110
+ return work;
111
+ }
112
+ return yield* this.m3j(threshold, target, $completion);
113
+ }
114
+ *n3j(network, timestamp, target, $completion) {
115
+ var deferred = yield* /*#__NOINLINE__*/delegateWork(this, target, AttoWorkerCache$work$slambda_0(this, network, timestamp), $completion);
116
+ var work = yield* deferred.d2u($completion);
117
+ // Inline function 'kotlinx.coroutines.sync.withLock' call
118
+ var this_0 = this.r3j_1;
119
+ yield* this_0.c3h(null, $completion);
120
+ var tmp;
121
+ try {
122
+ tmp = this.s3j_1.h4(target);
123
+ }finally {
124
+ this_0.o3g(null);
125
+ }
126
+ if (Companion_instance.t2q(network, timestamp, target, work.value)) {
127
+ return work;
128
+ }
129
+ return yield* this.n3j(network, timestamp, target, $completion);
130
+ }
131
+ *o3j(block, $completion) {
132
+ var tmp = block.y2h();
133
+ var deferred = yield* /*#__NOINLINE__*/delegateWork(this, tmp, AttoWorkerCache$work$slambda_1(this, block), $completion);
134
+ var work = yield* deferred.d2u($completion);
135
+ // Inline function 'kotlinx.coroutines.sync.withLock' call
136
+ var this_0 = this.r3j_1;
137
+ yield* this_0.c3h(null, $completion);
138
+ var tmp_0;
139
+ try {
140
+ tmp_0 = this.s3j_1.h4(block.y2h());
141
+ }finally {
142
+ this_0.o3g(null);
143
+ }
144
+ var nextTarget = new AttoWorkTarget(block.hash.value);
145
+ yield* /*#__NOINLINE__*/delegateWork(this, nextTarget, AttoWorkerCache$work$slambda_2(this, block), $completion);
146
+ if (work.isValid(block)) {
147
+ return work;
148
+ }
149
+ return yield* this.o3j(block, $completion);
150
+ }
151
+ q6() {
152
+ this.s3j_1.j4();
153
+ cancel(this.q3j_1);
154
+ this.p3j_1.q6();
155
+ }
156
+ }
157
+ class AttoWorkerCpu {
158
+ constructor(parallelism) {
159
+ this.t3j_1 = parallelism;
160
+ this.u3j_1 = SupervisorJob();
161
+ var tmp = this;
162
+ var tmp_0 = Dispatchers_getInstance().q32_1;
163
+ // Inline function 'kotlin.UShort.toInt' call
164
+ var this_0 = this.t3j_1;
165
+ var tmp$ret$0 = _UShort___get_data__impl__g0245(this_0) & 65535;
166
+ tmp.v3j_1 = tmp_0.i2y(tmp$ret$0);
167
+ }
168
+ *m3j(threshold, target, $completion) {
169
+ var workJob = Job(this.u3j_1);
170
+ // Inline function 'kotlin.js.getCoroutineContext' call
171
+ var tmp0_safe_receiver = $completion.sc().ed(Key_instance);
172
+ var tmp;
173
+ if (tmp0_safe_receiver == null) {
174
+ tmp = null;
175
+ } else {
176
+ tmp = tmp0_safe_receiver.r2s(AttoWorkerCpu$work$lambda(workJob));
177
+ }
178
+ var callerCancellation = tmp;
179
+ try {
180
+ var controller = new WorkerController(this.v3j_1.xl(workJob), this.t3j_1, threshold, target.s2q_1);
181
+ return yield* controller.b3k($completion);
182
+ }finally {
183
+ if (callerCancellation == null)
184
+ null;
185
+ else {
186
+ callerCancellation.d2v();
187
+ }
188
+ workJob.z2s();
189
+ }
190
+ }
191
+ q6() {
192
+ this.u3j_1.z2s();
193
+ }
194
+ }
195
+ class WorkerController {
196
+ constructor(context, parallelism, threshold, target) {
197
+ this.w3j_1 = parallelism;
198
+ this.x3j_1 = threshold;
199
+ this.y3j_1 = target;
200
+ this.z3j_1 = CoroutineScope(context);
201
+ var tmp = this;
202
+ // Inline function 'kotlin.apply' call
203
+ var this_0 = CompletableDeferred();
204
+ this_0.r2s(WorkerController$result$lambda(this));
205
+ tmp.a3k_1 = this_0;
206
+ }
207
+ *b3k($completion) {
208
+ var tmp0 = _ULong___init__impl__c78o9k(-1n);
209
+ // Inline function 'kotlin.UShort.toULong' call
210
+ var this_0 = this.w3j_1;
211
+ // Inline function 'kotlin.ULong.div' call
212
+ var other = _ULong___init__impl__c78o9k(fromInt(_UShort___get_data__impl__g0245(this_0)) & 65535n);
213
+ var rangeSize = ulongDivide(tmp0, other);
214
+ // Inline function 'kotlin.UShort.toInt' call
215
+ var this_1 = this.w3j_1;
216
+ // Inline function 'kotlin.repeat' call
217
+ var times = _UShort___get_data__impl__g0245(this_1) & 65535;
218
+ var inductionVariable = 0;
219
+ if (inductionVariable < times)
220
+ do {
221
+ var index = inductionVariable;
222
+ inductionVariable = inductionVariable + 1 | 0;
223
+ launch(this.z3j_1, VOID, VOID, WorkerController$calculate$slambda(index, rangeSize, this));
224
+ }
225
+ while (inductionVariable < times);
226
+ try {
227
+ return yield* this.a3k_1.d2u($completion);
228
+ }finally {
229
+ cancel(this.z3j_1);
230
+ }
231
+ }
232
+ }
233
+ class Companion_0 {
234
+ constructor() {
235
+ Companion_instance_2 = this;
236
+ var tmp = this;
237
+ var tmp_0 = LazyThreadSafetyMode_PUBLICATION_getInstance();
238
+ // Inline function 'kotlin.arrayOf' call
239
+ // Inline function 'kotlin.js.unsafeCast' call
240
+ // Inline function 'kotlin.js.asDynamic' call
241
+ tmp.c3k_1 = [lazy(tmp_0, AttoWorkerOperations$Request$Companion$$childSerializers$_anonymous__k0cb7d), null, null];
242
+ }
243
+ }
244
+ class $serializer {
245
+ constructor() {
246
+ $serializer_instance = this;
247
+ var tmp0_serialDesc = new PluginGeneratedSerialDescriptor('cash.atto.commons.worker.AttoWorkerOperations.Request', this, 3);
248
+ tmp0_serialDesc.s16('network', false);
249
+ tmp0_serialDesc.s16('timestamp', false);
250
+ tmp0_serialDesc.s16('target', false);
251
+ this.d3k_1 = tmp0_serialDesc;
252
+ }
253
+ e3k(encoder, value) {
254
+ var tmp0_desc = this.d3k_1;
255
+ var tmp1_output = encoder.ez(tmp0_desc);
256
+ var tmp2_cached = Companion_getInstance_0().c3k_1;
257
+ tmp1_output.v10(tmp0_desc, 0, tmp2_cached[0].b3(), value.f3k_1);
258
+ tmp1_output.v10(tmp0_desc, 1, AttoInstantAsLongSerializer_getInstance(), value.g3k_1);
259
+ tmp1_output.t10(tmp0_desc, 2, value.h3k_1);
260
+ tmp1_output.fz(tmp0_desc);
261
+ }
262
+ qu(encoder, value) {
263
+ return this.e3k(encoder, value instanceof Request ? value : THROW_CCE());
264
+ }
265
+ ru(decoder) {
266
+ var tmp0_desc = this.d3k_1;
267
+ var tmp1_flag = true;
268
+ var tmp2_index = 0;
269
+ var tmp3_bitMask0 = 0;
270
+ var tmp4_local0 = null;
271
+ var tmp5_local1 = null;
272
+ var tmp6_local2 = null;
273
+ var tmp7_input = decoder.ez(tmp0_desc);
274
+ var tmp8_cached = Companion_getInstance_0().c3k_1;
275
+ if (tmp7_input.tz()) {
276
+ tmp4_local0 = tmp7_input.qz(tmp0_desc, 0, tmp8_cached[0].b3(), tmp4_local0);
277
+ tmp3_bitMask0 = tmp3_bitMask0 | 1;
278
+ tmp5_local1 = tmp7_input.qz(tmp0_desc, 1, AttoInstantAsLongSerializer_getInstance(), tmp5_local1);
279
+ tmp3_bitMask0 = tmp3_bitMask0 | 2;
280
+ tmp6_local2 = tmp7_input.oz(tmp0_desc, 2);
281
+ tmp3_bitMask0 = tmp3_bitMask0 | 4;
282
+ } else
283
+ while (tmp1_flag) {
284
+ tmp2_index = tmp7_input.uz(tmp0_desc);
285
+ switch (tmp2_index) {
286
+ case -1:
287
+ tmp1_flag = false;
288
+ break;
289
+ case 0:
290
+ tmp4_local0 = tmp7_input.qz(tmp0_desc, 0, tmp8_cached[0].b3(), tmp4_local0);
291
+ tmp3_bitMask0 = tmp3_bitMask0 | 1;
292
+ break;
293
+ case 1:
294
+ tmp5_local1 = tmp7_input.qz(tmp0_desc, 1, AttoInstantAsLongSerializer_getInstance(), tmp5_local1);
295
+ tmp3_bitMask0 = tmp3_bitMask0 | 2;
296
+ break;
297
+ case 2:
298
+ tmp6_local2 = tmp7_input.oz(tmp0_desc, 2);
299
+ tmp3_bitMask0 = tmp3_bitMask0 | 4;
300
+ break;
301
+ default:
302
+ throw UnknownFieldException.lw(tmp2_index);
303
+ }
304
+ }
305
+ tmp7_input.fz(tmp0_desc);
306
+ return Request.i3k(tmp3_bitMask0, tmp4_local0, tmp5_local1, tmp6_local2, null);
307
+ }
308
+ pu() {
309
+ return this.d3k_1;
310
+ }
311
+ h17() {
312
+ // Inline function 'kotlin.arrayOf' call
313
+ // Inline function 'kotlin.js.unsafeCast' call
314
+ // Inline function 'kotlin.js.asDynamic' call
315
+ return [Companion_getInstance_0().c3k_1[0].b3(), AttoInstantAsLongSerializer_getInstance(), StringSerializer_getInstance()];
316
+ }
317
+ }
318
+ class Companion_1 {}
319
+ class $serializer_0 {
320
+ constructor() {
321
+ $serializer_instance_0 = this;
322
+ var tmp0_serialDesc = new PluginGeneratedSerialDescriptor('cash.atto.commons.worker.AttoWorkerOperations.Response', this, 1);
323
+ tmp0_serialDesc.s16('work', false);
324
+ this.j3k_1 = tmp0_serialDesc;
325
+ }
326
+ k3k(encoder, value) {
327
+ var tmp0_desc = this.j3k_1;
328
+ var tmp1_output = encoder.ez(tmp0_desc);
329
+ tmp1_output.v10(tmp0_desc, 0, AttoWorkAsStringSerializer_getInstance(), value.l3k_1);
330
+ tmp1_output.fz(tmp0_desc);
331
+ }
332
+ qu(encoder, value) {
333
+ return this.k3k(encoder, value instanceof Response ? value : THROW_CCE());
334
+ }
335
+ ru(decoder) {
336
+ var tmp0_desc = this.j3k_1;
337
+ var tmp1_flag = true;
338
+ var tmp2_index = 0;
339
+ var tmp3_bitMask0 = 0;
340
+ var tmp4_local0 = null;
341
+ var tmp5_input = decoder.ez(tmp0_desc);
342
+ if (tmp5_input.tz()) {
343
+ tmp4_local0 = tmp5_input.qz(tmp0_desc, 0, AttoWorkAsStringSerializer_getInstance(), tmp4_local0);
344
+ tmp3_bitMask0 = tmp3_bitMask0 | 1;
345
+ } else
346
+ while (tmp1_flag) {
347
+ tmp2_index = tmp5_input.uz(tmp0_desc);
348
+ switch (tmp2_index) {
349
+ case -1:
350
+ tmp1_flag = false;
351
+ break;
352
+ case 0:
353
+ tmp4_local0 = tmp5_input.qz(tmp0_desc, 0, AttoWorkAsStringSerializer_getInstance(), tmp4_local0);
354
+ tmp3_bitMask0 = tmp3_bitMask0 | 1;
355
+ break;
356
+ default:
357
+ throw UnknownFieldException.lw(tmp2_index);
358
+ }
359
+ }
360
+ tmp5_input.fz(tmp0_desc);
361
+ return Response.m3k(tmp3_bitMask0, tmp4_local0, null);
362
+ }
363
+ pu() {
364
+ return this.j3k_1;
365
+ }
366
+ h17() {
367
+ // Inline function 'kotlin.arrayOf' call
368
+ // Inline function 'kotlin.js.unsafeCast' call
369
+ // Inline function 'kotlin.js.asDynamic' call
370
+ return [AttoWorkAsStringSerializer_getInstance()];
371
+ }
372
+ }
373
+ class Request {
374
+ constructor(network, timestamp, target) {
375
+ Companion_getInstance_0();
376
+ this.f3k_1 = network;
377
+ this.g3k_1 = timestamp;
378
+ this.h3k_1 = target;
379
+ }
380
+ toString() {
381
+ return 'Request(network=' + this.f3k_1.toString() + ', timestamp=' + this.g3k_1.toString() + ', target=' + this.h3k_1 + ')';
382
+ }
383
+ hashCode() {
384
+ var result = this.f3k_1.hashCode();
385
+ result = imul(result, 31) + this.g3k_1.hashCode() | 0;
386
+ result = imul(result, 31) + getStringHashCode(this.h3k_1) | 0;
387
+ return result;
388
+ }
389
+ equals(other) {
390
+ if (this === other)
391
+ return true;
392
+ if (!(other instanceof Request))
393
+ return false;
394
+ if (!this.f3k_1.equals(other.f3k_1))
395
+ return false;
396
+ if (!this.g3k_1.equals(other.g3k_1))
397
+ return false;
398
+ if (!(this.h3k_1 === other.h3k_1))
399
+ return false;
400
+ return true;
401
+ }
402
+ static i3k(seen0, network, timestamp, target, serializationConstructorMarker) {
403
+ Companion_getInstance_0();
404
+ if (!(7 === (7 & seen0))) {
405
+ throwMissingFieldException(seen0, 7, $serializer_getInstance().d3k_1);
406
+ }
407
+ var $this = createThis(this);
408
+ $this.f3k_1 = network;
409
+ $this.g3k_1 = timestamp;
410
+ $this.h3k_1 = target;
411
+ return $this;
412
+ }
413
+ }
414
+ class Response {
415
+ constructor(work) {
416
+ this.l3k_1 = work;
417
+ }
418
+ toString() {
419
+ return 'Response(work=' + this.l3k_1.toString() + ')';
420
+ }
421
+ hashCode() {
422
+ return this.l3k_1.hashCode();
423
+ }
424
+ equals(other) {
425
+ if (this === other)
426
+ return true;
427
+ if (!(other instanceof Response))
428
+ return false;
429
+ if (!this.l3k_1.equals(other.l3k_1))
430
+ return false;
431
+ return true;
432
+ }
433
+ static m3k(seen0, work, serializationConstructorMarker) {
434
+ if (!(1 === (1 & seen0))) {
435
+ throwMissingFieldException(seen0, 1, $serializer_getInstance_0().j3k_1);
436
+ }
437
+ var $this = createThis(this);
438
+ $this.l3k_1 = work;
439
+ return $this;
440
+ }
441
+ }
442
+ class AttoWorkerOperations {}
443
+ function *work_1(network, timestamp, target, $completion) {
444
+ var request = new Request(network, timestamp, toHex(target.s2q_1));
445
+ var response = yield* this.n3k(request, $completion);
446
+ var work = response.l3k_1;
447
+ // Inline function 'kotlin.require' call
448
+ if (!Companion_instance.t2q(network, timestamp, target, work.value)) {
449
+ var message = 'Worker returned invalid work for network=' + network.toString() + ' timestamp=' + timestamp.toString() + ' target=' + toHex(target.s2q_1);
450
+ throw IllegalArgumentException.n2(toString(message));
451
+ }
452
+ return work;
453
+ }
454
+ class AttoWorkerAsync {
455
+ constructor(worker, dispatcher) {
456
+ this.worker = worker;
457
+ }
458
+ o3k() {
459
+ return this.worker;
460
+ }
461
+ *m3j(threshold, target, $completion) {
462
+ return yield* this.worker.m3j(threshold, target, $completion);
463
+ }
464
+ workThreshold(threshold, target) {
465
+ return promisify(($completion) => this.m3j(threshold, target, $completion));
466
+ }
467
+ *p3k(threshold, target, $completion) {
468
+ return this.workThreshold === protoOf(AttoWorkerAsync).workThreshold ? (yield* this.m3j(threshold, target, $completion)) : (yield* await_0(this.workThreshold(threshold, target), $completion));
469
+ }
470
+ *n3j(network, timestamp, target, $completion) {
471
+ return yield* this.worker.n3j(network, timestamp, target, $completion);
472
+ }
473
+ workNetwork(network, timestamp, target) {
474
+ return promisify(($completion) => this.n3j(network, timestamp, target, $completion));
475
+ }
476
+ *q3k(network, timestamp, target, $completion) {
477
+ return this.workNetwork === protoOf(AttoWorkerAsync).workNetwork ? (yield* this.n3j(network, timestamp, target, $completion)) : (yield* await_0(this.workNetwork(network, timestamp, target), $completion));
478
+ }
479
+ *o3j(block, $completion) {
480
+ return yield* this.worker.o3j(block, $completion);
481
+ }
482
+ workBlock(block) {
483
+ return promisify(($completion) => this.o3j(block, $completion));
484
+ }
485
+ *r3k(block, $completion) {
486
+ return this.workBlock === protoOf(AttoWorkerAsync).workBlock ? (yield* this.o3j(block, $completion)) : (yield* await_0(this.workBlock(block), $completion));
487
+ }
488
+ }
489
+ //endregion
490
+ var Companion_instance_1;
491
+ function Companion_getInstance() {
492
+ return Companion_instance_1;
493
+ }
494
+ function toAsync(_this__u8e3s4, dispatcher) {
495
+ return new AttoWorkerAsync(_this__u8e3s4, dispatcher);
496
+ }
497
+ function cached(_this__u8e3s4, dispatcher) {
498
+ dispatcher = dispatcher === VOID ? Dispatchers_getInstance().q32_1 : dispatcher;
499
+ return new AttoWorkerCache(_this__u8e3s4, dispatcher);
500
+ }
501
+ function *delegateWork($this, target, delegate, $completion) {
502
+ // Inline function 'kotlinx.coroutines.sync.withLock' call
503
+ var this_0 = $this.r3j_1;
504
+ yield* this_0.c3h(null, $completion);
505
+ var tmp;
506
+ try {
507
+ var deferred = $this.s3j_1.o4(target);
508
+ if (!(deferred == null)) {
509
+ return deferred;
510
+ }
511
+ deferred = async($this.q3j_1, VOID, VOID, AttoWorkerCache$delegateWork$slambda(delegate, target, $this));
512
+ var tmp0 = $this.s3j_1;
513
+ // Inline function 'kotlin.collections.set' call
514
+ var value = deferred;
515
+ tmp0.g4(target, value);
516
+ return deferred;
517
+ }finally {
518
+ this_0.o3g(null);
519
+ }
520
+ }
521
+ function AttoWorkerCache$delegateWork$slambda($delegate, $target, this$0) {
522
+ return constructCallableReference(function *($this$async, $completion) {
523
+ var tmp;
524
+ try {
525
+ return yield* $delegate($target, $completion);
526
+ } catch ($p) {
527
+ var tmp_0;
528
+ if ($p instanceof Exception) {
529
+ var e = $p;
530
+ // Inline function 'kotlinx.coroutines.sync.withLock' call
531
+ var this_0 = this$0.r3j_1;
532
+ yield* this_0.c3h(null, $completion);
533
+ var tmp_1;
534
+ try {
535
+ tmp_1 = this$0.s3j_1.h4($target);
536
+ }finally {
537
+ this_0.o3g(null);
538
+ }
539
+ throw e;
540
+ } else {
541
+ throw $p;
542
+ }
543
+ }
544
+ }, 1);
545
+ }
546
+ function AttoWorkerCache$work$slambda(this$0, $threshold) {
547
+ return constructCallableReference(function *(it, $completion) {
548
+ return yield* this$0.p3j_1.m3j($threshold, it, $completion);
549
+ }, 1);
550
+ }
551
+ function AttoWorkerCache$work$slambda_0(this$0, $network, $timestamp) {
552
+ return constructCallableReference(function *(it, $completion) {
553
+ return yield* this$0.p3j_1.n3j($network, $timestamp, it, $completion);
554
+ }, 1);
555
+ }
556
+ function AttoWorkerCache$work$slambda_1(this$0, $block) {
557
+ return constructCallableReference(function *(it, $completion) {
558
+ return yield* this$0.p3j_1.o3j($block, $completion);
559
+ }, 1);
560
+ }
561
+ function AttoWorkerCache$work$slambda_2(this$0, $block) {
562
+ return constructCallableReference(function *(it, $completion) {
563
+ return yield* this$0.p3j_1.n3j($block.network, Companion_instance_0.now(), it, $completion);
564
+ }, 1);
565
+ }
566
+ function AttoWorkerCpu$work$lambda($workJob) {
567
+ return (cause) => {
568
+ var tmp;
569
+ if (!(cause == null)) {
570
+ $workJob.z2s();
571
+ tmp = Unit_instance;
572
+ }
573
+ return Unit_instance;
574
+ };
575
+ }
576
+ function tryComplete($this, work) {
577
+ if (!Companion_instance.q2q($this.x3j_1, $this.y3j_1, work)) {
578
+ return false;
579
+ }
580
+ // Inline function 'kotlin.collections.copyOf' call
581
+ // Inline function 'kotlin.js.asDynamic' call
582
+ var tmp$ret$0 = work.slice();
583
+ return $this.a3k_1.c2y(new AttoWork(tmp$ret$0));
584
+ }
585
+ function incrementByteArray($this, byteArray) {
586
+ var carry = 1;
587
+ var inductionVariable = 0;
588
+ var last = byteArray.length - 1 | 0;
589
+ if (inductionVariable <= last)
590
+ $l$loop: do {
591
+ var i = inductionVariable;
592
+ inductionVariable = inductionVariable + 1 | 0;
593
+ var sum = (byteArray[i] & 255) + carry | 0;
594
+ byteArray[i] = toByte(sum);
595
+ carry = sum > 255 ? 1 : 0;
596
+ }
597
+ while (carry !== 0 && inductionVariable <= last);
598
+ }
599
+ function WorkerController$result$lambda(this$0) {
600
+ return (it) => {
601
+ cancel(this$0.z3j_1);
602
+ return Unit_instance;
603
+ };
604
+ }
605
+ function WorkerController$calculate$slambda($i, $rangeSize, this$0) {
606
+ return constructCallableReference(function *($this$launch, $completion) {
607
+ // Inline function 'kotlin.toULong' call
608
+ var this_0 = $i;
609
+ var tmp0 = _ULong___init__impl__c78o9k(fromInt(this_0));
610
+ // Inline function 'kotlin.ULong.times' call
611
+ var other = $rangeSize;
612
+ var start = _ULong___init__impl__c78o9k(multiply(_ULong___get_data__impl__fggpzb(tmp0), _ULong___get_data__impl__fggpzb(other)));
613
+ // Inline function 'kotlin.ULong.plus' call
614
+ var other_0 = $rangeSize;
615
+ var end = _ULong___init__impl__c78o9k(add(_ULong___get_data__impl__fggpzb(start), _ULong___get_data__impl__fggpzb(other_0)));
616
+ var work = toByteArray(start);
617
+ var current = start;
618
+ var iterationsUntilYield = 4096;
619
+ while (!(current === end) && get_isActive($this$launch)) {
620
+ if (tryComplete(this$0, work))
621
+ return Unit_instance;
622
+ incrementByteArray(this$0, work);
623
+ // Inline function 'kotlin.ULong.inc' call
624
+ var this_1 = current;
625
+ current = _ULong___init__impl__c78o9k(add(_ULong___get_data__impl__fggpzb(this_1), get_ONE()));
626
+ iterationsUntilYield = iterationsUntilYield - 1 | 0;
627
+ if (iterationsUntilYield === 0) {
628
+ iterationsUntilYield = 4096;
629
+ yield* yield_0($completion);
630
+ }
631
+ }
632
+ return Unit_instance;
633
+ }, 1);
634
+ }
635
+ function AttoWorkerOperations$Request$Companion$$childSerializers$_anonymous__k0cb7d() {
636
+ return createSimpleEnumSerializer('cash.atto.commons.AttoNetwork', values());
637
+ }
638
+ var Companion_instance_2;
639
+ function Companion_getInstance_0() {
640
+ if (Companion_instance_2 === VOID)
641
+ new Companion_0();
642
+ return Companion_instance_2;
643
+ }
644
+ var $serializer_instance;
645
+ function $serializer_getInstance() {
646
+ if ($serializer_instance === VOID)
647
+ new $serializer();
648
+ return $serializer_instance;
649
+ }
650
+ var Companion_instance_3;
651
+ function Companion_getInstance_1() {
652
+ return Companion_instance_3;
653
+ }
654
+ var $serializer_instance_0;
655
+ function $serializer_getInstance_0() {
656
+ if ($serializer_instance_0 === VOID)
657
+ new $serializer_0();
658
+ return $serializer_instance_0;
659
+ }
660
+ function defaultCpuWorker() {
661
+ return Companion_instance_1.k3j(_UShort___init__impl__jigrne(1));
662
+ }
663
+ //region block: post-declaration
664
+ initMetadataForCompanion(Companion);
665
+ initMetadataForInterface(AttoWorker, 'AttoWorker', VOID, VOID, [AutoCloseable], [2, 3, 1]);
666
+ initMetadataForClass(AttoWorkerCache, 'AttoWorkerCache', VOID, VOID, [AttoWorker], [2, 3, 1]);
667
+ protoOf(AttoWorkerCpu).n3j = work;
668
+ protoOf(AttoWorkerCpu).o3j = work_0;
669
+ initMetadataForClass(AttoWorkerCpu, 'AttoWorkerCpu', VOID, VOID, [AttoWorker], [2, 3, 1]);
670
+ initMetadataForClass(WorkerController, 'WorkerController', VOID, VOID, VOID, [0]);
671
+ initMetadataForCompanion(Companion_0);
672
+ protoOf($serializer).i17 = typeParametersSerializers;
673
+ initMetadataForObject($serializer, '$serializer', VOID, VOID, [GeneratedSerializer]);
674
+ initMetadataForCompanion(Companion_1);
675
+ protoOf($serializer_0).i17 = typeParametersSerializers;
676
+ initMetadataForObject($serializer_0, '$serializer', VOID, VOID, [GeneratedSerializer]);
677
+ initMetadataForClass(Request, 'Request', VOID, VOID, VOID, VOID, VOID, {0: $serializer_getInstance});
678
+ initMetadataForClass(Response, 'Response', VOID, VOID, VOID, VOID, VOID, {0: $serializer_getInstance_0});
679
+ initMetadataForInterface(AttoWorkerOperations, 'AttoWorkerOperations', VOID, VOID, [AttoWorker], [1, 3, 2]);
680
+ initMetadataForClass(AttoWorkerAsync, 'AttoWorkerAsync', VOID, VOID, VOID, [2, 3, 1]);
681
+ //endregion
682
+ //region block: init
683
+ Companion_instance_1 = new Companion();
684
+ Companion_instance_3 = new Companion_1();
685
+ //endregion
686
+ //region block: exports
687
+ export {
688
+ AttoWorkerAsync as AttoWorkerAsync,
689
+ };
690
+ export {
691
+ Request as Request2o3t1kyfw778m,
692
+ Response as Response3lq22kwwmc6vl,
693
+ AttoWorkerOperations as AttoWorkerOperations1gnkwfcdzd0wa,
694
+ cached as cached1s4yf99twpuut,
695
+ toAsync as toAsync10i9ow1f352l5,
696
+ Companion_instance_1 as Companion_instance1kp6jnubfith,
697
+ work_0 as work3q0nhsjbo6lx9,
698
+ work_1 as work2x6e1hnelgs5b,
699
+ };
700
+ //endregion
701
+
702
+ //# sourceMappingURL=commons-commons-worker.mjs.map