Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 18 additions & 19 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
@@ -1,31 +1,30 @@
import sbt.*

object Dependencies {
val akka = "2.6.20"
val akkaHttp = "10.2.10"
val akkaHttpCircie = "1.39.2"
val typesafeConfig = "1.4.3"
val akkaQuartz = "1.9.3-akka-2.6.x"
val pekko = "1.1.5"
val pekkoHttp = "1.3.0"
val pekkoHttpCircie = "3.6.0"
val typesafeConfig = "1.4.5"
val pekkoQuartz = "1.3.0-pekko-1.1.x"
val macWire = "2.5.8"
val scalaLogging = "3.9.5"
val slf4j = "2.0.13"
val logback = "1.5.6"
val scalaTest = "3.2.15"
val sttp = "3.9.7"
val scalaLogging = "3.9.6"
val slf4j = "2.0.17"
val logback = "1.5.20"
val scalaTest = "3.2.19"
val sttp = "3.11.0"
val web3j = "4.10.3"
val circe = "0.14.9"
val circe = "0.14.15"
val retry = "0.3.6"

lazy val dependencies: Seq[ModuleID] = Seq(
"com.typesafe.akka" %% "akka-actor-typed" % akka cross CrossVersion.for3Use2_13 excludeAll
"org.apache.pekko" %% "pekko-actor-typed" % pekko cross CrossVersion.for3Use2_13 excludeAll
(ExclusionRule(organization = "org.slf4j"), ExclusionRule("com.typesafe", "config")),
"com.typesafe.akka" %% "akka-stream" % akka cross CrossVersion.for3Use2_13,
"com.typesafe.akka" %% "akka-http" % akkaHttp cross CrossVersion.for3Use2_13,
"de.heikoseeberger" %% "akka-http-circe" % akkaHttpCircie cross CrossVersion.for3Use2_13 excludeAll (ExclusionRule(
"org.apache.pekko" %% "pekko-stream" % pekko cross CrossVersion.for3Use2_13,
"org.apache.pekko" %% "pekko-http" % pekkoHttp cross CrossVersion.for3Use2_13,
"com.github.pjfanning" %% "pekko-http-circe" % pekkoHttpCircie cross CrossVersion.for3Use2_13 excludeAll ExclusionRule(
organization = "io.circe"
),
ExclusionRule("com.typesafe.akka", "akka-http")),
"com.enragedginger" % "akka-quartz-scheduler" % akkaQuartz cross CrossVersion.for3Use2_13 excludeAll
"io.github.samueleresca" % "pekko-quartz-scheduler" % pekkoQuartz cross CrossVersion.for3Use2_13 excludeAll
ExclusionRule(organization = "org.slf4j"),
"com.typesafe" % "config" % typesafeConfig,
"io.circe" %% "circe-core" % circe,
Expand All @@ -36,7 +35,7 @@ object Dependencies {
ExclusionRule(organization = "org.slf4j"),
"ch.qos.logback" % "logback-classic" % logback,
"com.softwaremill.sttp.client3" %% "core" % sttp cross CrossVersion.for3Use2_13,
"com.softwaremill.sttp.client3" % "akka-http-backend" % sttp cross CrossVersion.for3Use2_13,
"com.softwaremill.sttp.client3" % "pekko-http-backend" % sttp cross CrossVersion.for3Use2_13,
"com.softwaremill.sttp.client3" %% "circe" % sttp cross CrossVersion.for3Use2_13 excludeAll
ExclusionRule(organization = "io.circe"),
"org.web3j" % "core" % web3j excludeAll
Expand All @@ -47,7 +46,7 @@ object Dependencies {
lazy val testDependencies: Seq[ModuleID] = Seq(
"org.scalatest" %% "scalatest" % scalaTest % "test",
"org.scalatest" %% "scalatest-shouldmatchers" % scalaTest % "test",
"com.typesafe.akka" %% "akka-actor-testkit-typed" % akka % "test" cross CrossVersion.for3Use2_13
"org.apache.pekko" %% "pekko-actor-testkit-typed" % pekko % "test" cross CrossVersion.for3Use2_13
)

lazy val allDependencies: Seq[ModuleID] = dependencies ++ testDependencies
Expand Down
14 changes: 7 additions & 7 deletions src/main/scala/Boot.scala
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import actors.{Command, Scheduler}
import akka.actor.typed.ActorSystem
import akka.actor.typed.scaladsl.Behaviors
import akka.http.scaladsl.Http
import akka.http.scaladsl.model.*
import akka.http.scaladsl.server.Directives.*
import akka.http.scaladsl.server.Route
import com.github.pjfanning.pekkohttpcirce.FailFastCirceSupport
import org.apache.pekko.actor.typed.ActorSystem
import org.apache.pekko.actor.typed.scaladsl.Behaviors
import org.apache.pekko.http.scaladsl.Http
import org.apache.pekko.http.scaladsl.model.*
import org.apache.pekko.http.scaladsl.server.Directives.*
import org.apache.pekko.http.scaladsl.server.Route
import commons.{Configuration, LocalLogger}
import controllers.{HealthCheckController, NotifyController}
import de.heikoseeberger.akkahttpcirce.FailFastCirceSupport
import di.DependencySetup
import processors.{ExecuteProcessor, ExecutorProcessorImpl, NotifyProcessor}
import services.scheduler.{QuartzService, QuartzServiceImpl}
Expand Down
4 changes: 2 additions & 2 deletions src/main/scala/actors/Scheduler.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package actors

import akka.actor.typed.Behavior
import akka.actor.typed.scaladsl.{AbstractBehavior, ActorContext, Behaviors}
import org.apache.pekko.actor.typed.Behavior
import org.apache.pekko.actor.typed.scaladsl.{AbstractBehavior, ActorContext, Behaviors}
import commons.LocalLogger
import processors.{HealthCheckProcessor, NotifyProcessor}

Expand Down
11 changes: 5 additions & 6 deletions src/main/scala/commons/HttpClient.scala
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
package commons

import akka.actor.typed.ActorSystem
import org.apache.pekko.actor.typed.ActorSystem
import io.circe.*
import retry.Success.*
import sttp.*
import sttp.capabilities.akka.AkkaStreams
import sttp.capabilities.pekko.PekkoStreams
import sttp.client3.*
import sttp.client3.akkahttp.AkkaHttpBackend
import sttp.client3.circe.asJson
import sttp.client3.pekkohttp.PekkoHttpBackend
import sttp.model.StatusCode

import scala.concurrent.duration.DurationInt
Expand Down Expand Up @@ -38,8 +37,8 @@ class HttpClientImpl(using
system: ActorSystem[Nothing],
ec: ExecutionContext
) extends HttpClient {
val backend: SttpBackend[Future, AkkaStreams with capabilities.WebSockets] =
AkkaHttpBackend.usingActorSystem(system.classicSystem)
val backend: SttpBackend[Future, PekkoStreams with capabilities.WebSockets] =
PekkoHttpBackend.usingActorSystem(system.classicSystem)
override def get[Res](url: String, header: Map[String, String])(using
decoder: Decoder[Res]
): Future[Either[String, Res]] = {
Expand Down
4 changes: 2 additions & 2 deletions src/main/scala/commons/Util.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package commons

import akka.actor.typed.ActorSystem
import akka.http.scaladsl.model.ResponseEntity
import org.apache.pekko.actor.typed.ActorSystem
import org.apache.pekko.http.scaladsl.model.ResponseEntity
import commons.Constant.EncryptionAlgorithm

import java.nio.charset.StandardCharsets
Expand Down
10 changes: 5 additions & 5 deletions src/main/scala/controllers/HealthCheckController.scala
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package controllers

import akka.actor.typed.ActorSystem
import akka.http.scaladsl.model.{ContentTypes, HttpEntity}
import akka.http.scaladsl.server.Directives.{complete, get, path}
import akka.http.scaladsl.server.Route
import de.heikoseeberger.akkahttpcirce.FailFastCirceSupport
import com.github.pjfanning.pekkohttpcirce.FailFastCirceSupport
import org.apache.pekko.actor.typed.ActorSystem
import org.apache.pekko.http.scaladsl.model.{ContentTypes, HttpEntity}
import org.apache.pekko.http.scaladsl.server.Directives.{complete, get, path}
import org.apache.pekko.http.scaladsl.server.Route
import models.mackerel.*
import services.healthcheck.MackerelService

Expand Down
16 changes: 11 additions & 5 deletions src/main/scala/controllers/NotifyController.scala
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
package controllers

import akka.actor.typed.ActorSystem
import akka.http.scaladsl.model.StatusCodes.{InternalServerError, OK}
import akka.http.scaladsl.server.Directives.{complete, get, headerValueByName, onComplete, path}
import akka.http.scaladsl.server.Route
import com.github.pjfanning.pekkohttpcirce.FailFastCirceSupport
import org.apache.pekko.actor.typed.ActorSystem
import org.apache.pekko.http.scaladsl.model.StatusCodes.{InternalServerError, OK}
import org.apache.pekko.http.scaladsl.server.Directives.{
complete,
get,
headerValueByName,
onComplete,
path
}
import org.apache.pekko.http.scaladsl.server.Route
import commons.Configuration
import de.heikoseeberger.akkahttpcirce.FailFastCirceSupport
import models.controller.NotifyResponse
import processors.NotifyProcessor
import validators.controllers.ApiKeyValidator
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/di/DependencySetup.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package di

import akka.actor.typed.ActorSystem
import org.apache.pekko.actor.typed.ActorSystem
import commons.*
import helpers.{TerraHelper, TerraHelperImpl}
import processors.{
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/processors/BaseProcessor.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package processors

import actors.Command
import akka.actor.typed.ActorSystem
import org.apache.pekko.actor.typed.ActorSystem

import scala.concurrent.{ExecutionContext, Future}

Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/processors/ExecuteProcessor.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package processors

import actors.*
import akka.actor.typed.*
import org.apache.pekko.actor.typed.*
import commons.{Configuration, LocalLogger}
import services.*
import services.scheduler.{QuartzService, SchedulerName}
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/processors/HealthCheckProcessor.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package processors

import akka.actor.typed.ActorSystem
import org.apache.pekko.actor.typed.ActorSystem
import commons.{Configuration, HttpClient}
import models.mackerel.MackerelRequest
import services.healthcheck.MackerelService
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/processors/NotifyProcessor.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package processors

import akka.actor.typed.ActorSystem
import org.apache.pekko.actor.typed.ActorSystem
import commons.CommonUtil.getFormattedNowDate
import commons.{Configuration, Logger}
import services.notification.NotificationService
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/services/crypto/BinanceService.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package services.crypto

import akka.actor.typed.ActorSystem
import org.apache.pekko.actor.typed.ActorSystem
import commons.Constant.EncryptionAlgorithm
import commons.*
import models.CryptoBalance
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/services/crypto/BitcoinService.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package services.crypto

import akka.actor.typed.ActorSystem
import org.apache.pekko.actor.typed.ActorSystem
import commons.{Configuration, Constant, HttpClient, Logger}
import helpers.BitcoinHelper
import models.bitcoin.Utxo
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/services/crypto/EtherScanService.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package services.crypto

import akka.actor.typed.ActorSystem
import org.apache.pekko.actor.typed.ActorSystem
import commons.{Configuration, Constant, HttpClient, Logger}
import models.etherScan.EtherScanResponse

Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/services/crypto/SatangService.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package services.crypto

import akka.actor.typed.ActorSystem
import org.apache.pekko.actor.typed.ActorSystem
import com.typesafe.scalalogging.LazyLogging
import commons.Constant.EncryptionAlgorithm
import commons.*
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/services/crypto/TerraService.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package services.crypto

import akka.actor.typed.ActorSystem
import org.apache.pekko.actor.typed.ActorSystem
import com.typesafe.scalalogging.LazyLogging
import commons.*
import helpers.TerraHelper
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package services.crypto.contracts

import akka.actor.typed.ActorSystem
import org.apache.pekko.actor.typed.ActorSystem
import commons.{Configuration, Constant, Logger}
import contracts.pancake.{CakePool, VeCakePool}
import org.web3j.crypto.Credentials
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/services/healthcheck/MackerelService.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package services.healthcheck

import akka.actor.typed.ActorSystem
import org.apache.pekko.actor.typed.ActorSystem
import com.typesafe.scalalogging.LazyLogging
import commons.{Configuration, Constant, HttpClient, Logger}
import io.circe.syntax.*
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/services/notification/TelegramService.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package services.notification

import akka.actor.typed.ActorSystem
import org.apache.pekko.actor.typed.ActorSystem
import com.typesafe.scalalogging.LazyLogging
import commons.Constant.MessageProvider.Telegram
import commons.{Configuration, Constant, HttpClient, LocalLogger}
Expand Down
4 changes: 2 additions & 2 deletions src/main/scala/services/scheduler/QuartzService.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package services.scheduler

import akka.actor.typed.{ActorRef, ActorSystem}
import com.typesafe.akka.extension.quartz.QuartzSchedulerTypedExtension
import org.apache.pekko.actor.typed.{ActorRef, ActorSystem}
import org.apache.pekko.extension.quartz.QuartzSchedulerTypedExtension
import com.typesafe.scalalogging.LazyLogging
import commons.LocalLogger
import services.scheduler.QuartzService
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/services/user/UserService.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package services.user

import akka.actor.typed.ActorSystem
import org.apache.pekko.actor.typed.ActorSystem
import commons.Constant
import commons.Constant.MessageProvider
import models.CryptoBalance
Expand Down
6 changes: 3 additions & 3 deletions src/main/scala/validators/controllers/ApiKeyValidator.scala
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package validators.controllers

import akka.http.scaladsl.model.StatusCodes
import akka.http.scaladsl.server.Directives.headerValueByName
import akka.http.scaladsl.server.{
import org.apache.pekko.http.scaladsl.model.StatusCodes
import org.apache.pekko.http.scaladsl.server.Directives.headerValueByName
import org.apache.pekko.http.scaladsl.server.{
AuthenticationFailedRejection,
Directive0,
Directives,
Expand Down