Skip to content

Commit

Permalink
Remove redundant in EvmBlockchainHelper
Browse files Browse the repository at this point in the history
  • Loading branch information
abdrasulov committed Apr 1, 2024
1 parent e7e9650 commit d7c7d02
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,6 @@ import io.horizontalsystems.ethereumkit.models.RpcSource
import io.horizontalsystems.marketkit.models.BlockchainType

class EvmBlockchainHelper(private val blockchainType: BlockchainType) {
val evmKitWrapper = App.evmBlockchainManager
.getEvmKitManager(blockchainType)
.evmKitWrapper

private val evmKit = evmKitWrapper?.evmKit

val baseToken by lazy { App.evmBlockchainManager.getBaseToken(blockchainType) }
val receiveAddress by lazy { evmKit?.receiveAddress }
val chain by lazy { App.evmBlockchainManager.getChain(blockchainType) }

fun getRpcSourceHttp(): RpcSource.Http {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,13 @@ object OneInchProvider : EvmSwapProvider() {

val gasPrice = sendTransactionSettings.gasPriceInfo.gasPrice

val evmKitWrapper = evmBlockchainHelper.evmKitWrapper ?: throw NullPointerException()

val settingRecipient = SwapSettingRecipient(swapSettings, blockchainType)
val settingSlippage = SwapSettingSlippage(swapSettings, BigDecimal("1"))
val slippage = settingSlippage.valueOrDefault()

val swap = oneInchKit.getSwapAsync(
chain = evmBlockchainHelper.chain,
receiveAddress = evmKitWrapper.evmKit.receiveAddress,
receiveAddress = sendTransactionSettings.receiveAddress,
fromToken = getTokenAddress(tokenIn),
toToken = getTokenAddress(tokenOut),
amount = amountIn.scaleUp(tokenIn.decimals),
Expand Down

0 comments on commit d7c7d02

Please sign in to comment.