From 15c0b1ba77c30618bc5e6a682de4f4ade62aa341 Mon Sep 17 00:00:00 2001 From: Jeremy Lee <37092291+yogurtandjam@users.noreply.github.com> Date: Wed, 29 May 2024 17:15:52 -0400 Subject: [PATCH] feat: router interface [OTE-344] (#386) Co-authored-by: mobile-build-bot-git --- build.gradle.kts | 2 +- .../processor/router/IRouterProcessor.kt | 51 +++++++++++++++++++ 2 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 src/commonMain/kotlin/exchange.dydx.abacus/processor/router/IRouterProcessor.kt diff --git a/build.gradle.kts b/build.gradle.kts index 994eaf390..77b9302c4 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -51,7 +51,7 @@ allprojects { } group = "exchange.dydx.abacus" -version = "1.7.39" +version = "1.7.40" repositories { google() diff --git a/src/commonMain/kotlin/exchange.dydx.abacus/processor/router/IRouterProcessor.kt b/src/commonMain/kotlin/exchange.dydx.abacus/processor/router/IRouterProcessor.kt new file mode 100644 index 000000000..a9c7b44b5 --- /dev/null +++ b/src/commonMain/kotlin/exchange.dydx.abacus/processor/router/IRouterProcessor.kt @@ -0,0 +1,51 @@ +package exchange.dydx.abacus.processor.router + +interface IRouterProcessor { + var tokens: List? + var chains: List? + var exchangeDestinationChainId: String? + fun receivedChains( + existing: Map?, + payload: Map + ): Map? + + fun receivedTokens( + existing: Map?, + payload: Map + ): Map? + + fun receivedV2SdkInfo( + existing: Map?, + payload: Map + ): Map? + + fun receivedRoute( + existing: Map?, + payload: Map, + requestId: String?, + ): Map? + + fun receivedRouteV2( + existing: Map?, + payload: Map, + requestId: String? + ): Map? + + fun usdcAmount(data: Map): Double? + fun receivedStatus( + existing: Map?, + payload: Map, + transactionId: String?, + ): Map? + + fun updateTokensDefaults(modified: MutableMap, selectedChainId: String?) + fun defaultChainId(): String? + fun selectedTokenSymbol(tokenAddress: String?): String? + fun selectedTokenDecimals(tokenAddress: String?): String? + fun filteredTokens(chainId: String?): List? + fun defaultTokenAddress(chainId: String?): String? + fun chainResources(chainId: String?): Map? + fun tokenResources(chainId: String?): Map? + fun chainOptions(): List + fun tokenOptions(chainId: String?): List +}