From 6ff73c3949f8ef844853cec5a8cc223fc4372a26 Mon Sep 17 00:00:00 2001 From: jeremy lee Date: Fri, 14 Jun 2024 07:58:29 -0400 Subject: [PATCH] address comment --- .../v2/supervisor/OnboardingSupervisor.kt | 64 +++++++++---------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/src/commonMain/kotlin/exchange.dydx.abacus/state/v2/supervisor/OnboardingSupervisor.kt b/src/commonMain/kotlin/exchange.dydx.abacus/state/v2/supervisor/OnboardingSupervisor.kt index 2e8f048f0..9231d81c0 100644 --- a/src/commonMain/kotlin/exchange.dydx.abacus/state/v2/supervisor/OnboardingSupervisor.kt +++ b/src/commonMain/kotlin/exchange.dydx.abacus/state/v2/supervisor/OnboardingSupervisor.kt @@ -232,7 +232,7 @@ internal class OnboardingSupervisor( } } val chainId = helper.environment.dydxChainId - val dydxTokenDemon = helper.environment.tokens["usdc"]?.denom + val nativeTokenUSDCDenom = helper.environment.tokens["usdc"]?.denom val fromAmountString = helper.parser.asString(fromAmount) val url = helper.configs.skipV2MsgsDirect() if (fromChain != null && @@ -240,14 +240,14 @@ internal class OnboardingSupervisor( fromAmount != null && fromAmount > 0 && fromAmountString != null && chainId != null && - dydxTokenDemon != null && + nativeTokenUSDCDenom != null && url != null ) { val body: Map = mapOf( "amount_in" to fromAmountString, "source_asset_denom" to fromToken, "source_asset_chain_id" to fromChain, - "dest_asset_denom" to dydxTokenDemon, + "dest_asset_denom" to nativeTokenUSDCDenom, "dest_asset_chain_id" to chainId, "chain_ids_to_addresses" to mapOf( "fromChain" to sourceAddress, @@ -295,7 +295,7 @@ internal class OnboardingSupervisor( } } val chainId = helper.environment.dydxChainId - val dydxTokenDemon = helper.environment.tokens["usdc"]?.denom + val nativeTokenUSDCDenom = helper.environment.tokens["usdc"]?.denom val fromAmountString = helper.parser.asString(fromAmount) val nobleAddress = accountAddress.toNobleAddress() val url = helper.configs.skipV2MsgsDirect() @@ -307,7 +307,7 @@ internal class OnboardingSupervisor( fromAmountString != null && nobleAddress != null && chainId != null && - dydxTokenDemon != null && + nativeTokenUSDCDenom != null && toChain != null && toToken != null ) { @@ -363,7 +363,7 @@ internal class OnboardingSupervisor( } val chainId = helper.environment.dydxChainId val squidIntegratorId = helper.environment.squidIntegratorId - val dydxTokenDemon = helper.environment.tokens["usdc"]?.denom + val nativeTokenUSDCDenom = helper.environment.tokens["usdc"]?.denom val fromAmountString = helper.parser.asString(fromAmount) val url = helper.configs.squidRoute() if (fromChain != null && @@ -371,7 +371,7 @@ internal class OnboardingSupervisor( fromAmount != null && fromAmount > 0 && fromAmountString != null && chainId != null && - dydxTokenDemon != null && + nativeTokenUSDCDenom != null && url != null && squidIntegratorId != null ) { @@ -380,7 +380,7 @@ internal class OnboardingSupervisor( "fromToken" to fromToken, "fromAmount" to fromAmountString, "toChain" to chainId, - "toToken" to dydxTokenDemon, + "toToken" to nativeTokenUSDCDenom, "toAddress" to accountAddress, "slippage" to "1", "enableForecall" to "false", @@ -425,7 +425,7 @@ internal class OnboardingSupervisor( } val chainId = helper.environment.dydxChainId val squidIntegratorId = helper.environment.squidIntegratorId - val dydxTokenDemon = helper.environment.tokens["usdc"]?.denom + val nativeTokenUSDCDenom = helper.environment.tokens["usdc"]?.denom val fromAmountString = helper.parser.asString(fromAmount) val nobleAddress = accountAddress.toNobleAddress() val url = helper.configs.squidV2Route() @@ -437,7 +437,7 @@ internal class OnboardingSupervisor( fromAmountString != null && nobleAddress != null && chainId != null && - dydxTokenDemon != null && + nativeTokenUSDCDenom != null && url != null && squidIntegratorId != null && toChain != null && @@ -763,7 +763,7 @@ internal class OnboardingSupervisor( } val chainId = helper.environment.dydxChainId val squidIntegratorId = helper.environment.squidIntegratorId - val dydxTokenDemon = helper.environment.tokens["usdc"]?.denom + val nativeTokenUSDCDenom = helper.environment.tokens["usdc"]?.denom val fromAmountString = helper.parser.asString(fromAmount) val url = helper.configs.squidRoute() val fromAddress = accountAddress @@ -774,13 +774,13 @@ internal class OnboardingSupervisor( fromAmount > 0 && fromAmountString != null && chainId != null && - dydxTokenDemon != null && + nativeTokenUSDCDenom != null && url != null && squidIntegratorId != null ) { val params: IMap = iMapOf( "fromChain" to chainId, - "fromToken" to dydxTokenDemon, + "fromToken" to nativeTokenUSDCDenom, "fromAmount" to fromAmountString, "fromAddress" to fromAddress, "toChain" to nobleChain, @@ -822,7 +822,7 @@ internal class OnboardingSupervisor( } val chainId = helper.environment.dydxChainId val squidIntegratorId = helper.environment.squidIntegratorId - val dydxTokenDemon = helper.environment.tokens["usdc"]?.denom + val nativeTokenUSDCDenom = helper.environment.tokens["usdc"]?.denom val fromAmountString = helper.parser.asString(fromAmount) val url = helper.configs.squidRoute() val fromAddress = accountAddress @@ -833,13 +833,13 @@ internal class OnboardingSupervisor( fromAmount > 0 && fromAmountString != null && chainId != null && - dydxTokenDemon != null && + nativeTokenUSDCDenom != null && url != null && squidIntegratorId != null ) { val params: IMap = iMapOf( "fromChain" to chainId, - "fromToken" to dydxTokenDemon, + "fromToken" to nativeTokenUSDCDenom, "fromAmount" to fromAmountString, "fromAddress" to fromAddress, "toChain" to toChain, @@ -882,7 +882,7 @@ internal class OnboardingSupervisor( } val chainId = helper.environment.dydxChainId val squidIntegratorId = helper.environment.squidIntegratorId - val dydxTokenDemon = helper.environment.tokens["usdc"]?.denom + val nativeTokenUSDCDenom = helper.environment.tokens["usdc"]?.denom val fromAmountString = helper.parser.asString(fromAmount) val url = helper.configs.squidV2Route() val fromAddress = accountAddress.toNobleAddress() @@ -895,7 +895,7 @@ internal class OnboardingSupervisor( fromAmount > 0 && fromAmountString != null && chainId != null && - dydxTokenDemon != null && + nativeTokenUSDCDenom != null && url != null && fromAddress != null && squidIntegratorId != null && @@ -957,7 +957,7 @@ internal class OnboardingSupervisor( null } val fromChain = helper.environment.dydxChainId - val dydxTokenDemon = helper.environment.tokens["usdc"]?.denom + val nativeTokenUSDCDenom = helper.environment.tokens["usdc"]?.denom val fromAmountString = helper.parser.asString(fromAmount) val url = helper.configs.skipV2MsgsDirect() val fromAddress = accountAddress @@ -968,11 +968,11 @@ internal class OnboardingSupervisor( fromChain != null && toToken != null && toChain != null && - dydxTokenDemon != null + nativeTokenUSDCDenom != null ) { val body: Map = mapOf( "amount_in" to fromAmountString, - "source_asset_denom" to dydxTokenDemon, + "source_asset_denom" to nativeTokenUSDCDenom, "source_asset_chain_id" to fromChain, "dest_asset_denom" to toToken, "dest_asset_chain_id" to toChain, @@ -1073,7 +1073,7 @@ internal class OnboardingSupervisor( null } val chainId = helper.environment.dydxChainId - val dydxTokenDemon = helper.environment.tokens["usdc"]?.denom + val nativeTokenUSDCDenom = helper.environment.tokens["usdc"]?.denom val fromAmountString = helper.parser.asString(fromAmount) val url = helper.configs.skipV2MsgsDirect() val fromAddress = accountAddress.toNobleAddress() @@ -1087,7 +1087,7 @@ internal class OnboardingSupervisor( fromAddress != null && fromAmountString != null && chainId != null && - dydxTokenDemon != null && + nativeTokenUSDCDenom != null && fromChain != null && fromToken != null ) { @@ -1169,13 +1169,13 @@ internal class OnboardingSupervisor( val nobleAddress = accountAddress.toNobleAddress() val chainId = helper.environment.dydxChainId val squidIntegratorId = helper.environment.squidIntegratorId - val dydxTokenDemon = helper.environment.tokens["usdc"]?.denom + val nativeTokenUSDCDenom = helper.environment.tokens["usdc"]?.denom if (url != null && fromChain != null && fromToken != null && nobleAddress != null && chainId != null && - dydxTokenDemon != null && + nativeTokenUSDCDenom != null && squidIntegratorId != null ) { val params: Map = mapOf( @@ -1184,7 +1184,7 @@ internal class OnboardingSupervisor( "fromAddress" to nobleAddress, "fromAmount" to amount.toPlainString(), "toChain" to chainId, - "toToken" to dydxTokenDemon, + "toToken" to nativeTokenUSDCDenom, "toAddress" to accountAddress.toString(), "slippage" to "1", "enableForecall" to "false", @@ -1422,7 +1422,7 @@ internal class OnboardingSupervisor( val nobleAddress = accountAddress.toNobleAddress() val chainId = helper.environment.dydxChainId val squidIntegratorId = helper.environment.squidIntegratorId - val dydxTokenDemon = helper.environment.tokens["usdc"]?.denom + val nativeTokenUSDCDenom = helper.environment.tokens["usdc"]?.denom val usdcSize = helper.parser.asDecimal(state?.input?.transfer?.size?.usdcSize) val fromAmount = if (usdcSize != null && usdcSize > gas) { ((usdcSize - gas) * Numeric.decimal.TEN.pow(decimals)).toBigInteger() @@ -1436,7 +1436,7 @@ internal class OnboardingSupervisor( nobleToken != null && nobleAddress != null && chainId != null && - dydxTokenDemon != null && + nativeTokenUSDCDenom != null && squidIntegratorId != null && fromAmountString != null && fromAmount != null && fromAmount > 0 ) { @@ -1446,7 +1446,7 @@ internal class OnboardingSupervisor( "toAddress" to nobleAddress, "fromAmount" to fromAmountString, "fromChain" to chainId, - "fromToken" to dydxTokenDemon, + "fromToken" to nativeTokenUSDCDenom, "fromAddress" to accountAddress, "slippage" to "1", "enableForecall" to "false", @@ -1528,7 +1528,7 @@ internal class OnboardingSupervisor( val nobleToken = helper.configs.nobleDenom() val nobleAddress = accountAddress.toNobleAddress() val chainId = helper.environment.dydxChainId - val dydxTokenDemon = helper.environment.tokens["usdc"]?.denom + val nativeTokenUSDCDenom = helper.environment.tokens["usdc"]?.denom val usdcSize = helper.parser.asDecimal(state?.input?.transfer?.size?.usdcSize) val fromAmount = if (usdcSize != null && usdcSize > gas) { ((usdcSize - gas) * Numeric.decimal.TEN.pow(decimals)).toBigInteger() @@ -1542,13 +1542,13 @@ internal class OnboardingSupervisor( nobleToken != null && nobleAddress != null && chainId != null && - dydxTokenDemon != null && + nativeTokenUSDCDenom != null && fromAmountString != null && fromAmount != null && fromAmount > 0 ) { val body: Map = mapOf( "amount_in" to fromAmountString, // from dydx denom and chain - "source_asset_denom" to dydxTokenDemon, + "source_asset_denom" to nativeTokenUSDCDenom, "source_asset_chain_id" to chainId, // to noble denom and chain "dest_asset_denom" to nobleToken,