Skip to content

Commit

Permalink
refactor: move squid to new dir
Browse files Browse the repository at this point in the history
  • Loading branch information
yogurtandjam committed May 28, 2024
1 parent 0061a67 commit 27fcf3d
Show file tree
Hide file tree
Showing 26 changed files with 21 additions and 627 deletions.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package exchange.dydx.abacus.processor.router.Skip
package exchange.dydx.abacus.processor.router.skip

import exchange.dydx.abacus.processor.base.BaseProcessor
import exchange.dydx.abacus.protocols.ParserProtocol
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package exchange.dydx.abacus.processor.router.Skip
package exchange.dydx.abacus.processor.router.skip

import exchange.dydx.abacus.processor.base.BaseProcessor
import exchange.dydx.abacus.protocols.ParserProtocol
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,7 @@ package exchange.dydx.abacus.processor.router.Squid

import exchange.dydx.abacus.processor.base.BaseProcessor
import exchange.dydx.abacus.processor.router.*
import exchange.dydx.abacus.processor.router.Skip.SkipChainProcessor
import exchange.dydx.abacus.processor.router.Skip.SkipChainResourceProcessor
import exchange.dydx.abacus.processor.router.Skip.SkipTokenProcessor
import exchange.dydx.abacus.processor.router.Skip.SkipTokenResourceProcessor
import exchange.dydx.abacus.protocols.ParserProtocol
import exchange.dydx.abacus.state.manager.CctpConfig.cctpChainIds
import exchange.dydx.abacus.utils.Logger
import exchange.dydx.abacus.utils.mutable
import exchange.dydx.abacus.utils.safeSet

internal class SkipProcessor(parser: ParserProtocol) : BaseProcessor(parser), IRouterProcessor {
Expand Down Expand Up @@ -83,7 +76,7 @@ internal class SkipProcessor(parser: ParserProtocol) : BaseProcessor(parser), IR
throw Error("Not Implemented!")
}

override fun selectedTokenDecimals(tokenAddress: String?, selectedChainId: String?): String? {
override fun selectedTokenDecimals(tokenAddress: String?): String? {
throw Error("Not Implemented!")
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package exchange.dydx.abacus.processor.router.Skip
package exchange.dydx.abacus.processor.router.skip

import exchange.dydx.abacus.processor.base.BaseProcessor
import exchange.dydx.abacus.protocols.ParserProtocol
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package exchange.dydx.abacus.processor.router.Skip
package exchange.dydx.abacus.processor.router.skip

import exchange.dydx.abacus.processor.base.BaseProcessor
import exchange.dydx.abacus.protocols.ParserProtocol
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package exchange.dydx.abacus.processor.router.Squid
package exchange.dydx.abacus.processor.router.squid

import exchange.dydx.abacus.processor.base.BaseProcessor
import exchange.dydx.abacus.protocols.ParserProtocol
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package exchange.dydx.abacus.processor.router.Squid
package exchange.dydx.abacus.processor.router.squid

import exchange.dydx.abacus.processor.base.BaseProcessor
import exchange.dydx.abacus.protocols.ParserProtocol
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package exchange.dydx.abacus.processor.router.Squid
package exchange.dydx.abacus.processor.router.squid

import exchange.dydx.abacus.processor.base.BaseProcessor
import exchange.dydx.abacus.processor.router.*
import exchange.dydx.abacus.processor.router.IRouterProcessor
import exchange.dydx.abacus.protocols.ParserProtocol
import exchange.dydx.abacus.state.manager.CctpConfig.cctpChainIds
import exchange.dydx.abacus.utils.Logger
import exchange.dydx.abacus.utils.mutable
import exchange.dydx.abacus.utils.safeSet

Expand Down Expand Up @@ -165,7 +164,7 @@ internal class SquidProcessor(parser: ParserProtocol) : BaseProcessor(parser), I
}

override fun updateTokensDefaults(modified: MutableMap<String, Any>, selectedChainId: String?) {
val tokenOptions = this.tokenOptions(selectedChainId)
val tokenOptions = tokenOptions(selectedChainId)
modified.safeSet("transfer.depositOptions.assets", tokenOptions)
modified.safeSet("transfer.withdrawalOptions.assets", tokenOptions)
modified.safeSet("transfer.token", defaultTokenAddress(selectedChainId))
Expand All @@ -174,7 +173,7 @@ internal class SquidProcessor(parser: ParserProtocol) : BaseProcessor(parser), I

override fun defaultChainId(): String? {
val selectedChain = parser.asNativeMap(this.chains?.firstOrNull())
return parser.asString(selectedChain?.get("chain_id"))
return parser.asString(selectedChain?.get("chainId"))
}

override fun selectedTokenSymbol(tokenAddress: String?): String? {
Expand All @@ -186,7 +185,7 @@ internal class SquidProcessor(parser: ParserProtocol) : BaseProcessor(parser), I
return null
}

override fun selectedTokenDecimals(tokenAddress: String?, selectedChainId: String?): String? {
override fun selectedTokenDecimals(tokenAddress: String?): String? {
this.tokens?.find {
parser.asString(parser.asNativeMap(it)?.get("address")) == tokenAddress
}?.let {
Expand Down Expand Up @@ -282,6 +281,7 @@ internal class SquidProcessor(parser: ParserProtocol) : BaseProcessor(parser), I

val selectedChainId = chainId ?: defaultChainId()
selectedChainId?.let {
selectedChainId
this.tokens?.let {
for (token in it) {
parser.asNativeMap(token)?.let { token ->
Expand All @@ -296,5 +296,4 @@ internal class SquidProcessor(parser: ParserProtocol) : BaseProcessor(parser), I
options.sortBy { parser.asString(parser.asNativeMap(it)?.get("stringKey")) }
return options
}

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package exchange.dydx.abacus.processor.squid
package exchange.dydx.abacus.processor.router.squid

import exchange.dydx.abacus.processor.base.BaseProcessor
import exchange.dydx.abacus.protocols.ParserProtocol
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package exchange.dydx.abacus.processor.router.Squid
package exchange.dydx.abacus.processor.router.squid

import exchange.dydx.abacus.processor.base.BaseProcessor
import exchange.dydx.abacus.protocols.ParserProtocol
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package exchange.dydx.abacus.processor.router.Squid
package exchange.dydx.abacus.processor.router.squid

import exchange.dydx.abacus.processor.base.BaseProcessor
import exchange.dydx.abacus.protocols.ParserProtocol
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package exchange.dydx.abacus.processor.router.Squid
package exchange.dydx.abacus.processor.router.squid

import exchange.dydx.abacus.processor.base.BaseProcessor
import exchange.dydx.abacus.protocols.ParserProtocol
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package exchange.dydx.abacus.processor.squid
package exchange.dydx.abacus.processor.router.squid

import exchange.dydx.abacus.processor.base.BaseProcessor
import exchange.dydx.abacus.protocols.ParserProtocol
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package exchange.dydx.abacus.processor.squid
package exchange.dydx.abacus.processor.router.squid

import exchange.dydx.abacus.processor.base.BaseProcessor
import exchange.dydx.abacus.protocols.ParserProtocol
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package exchange.dydx.abacus.processor.squid
package exchange.dydx.abacus.processor.router.squid

import exchange.dydx.abacus.processor.base.BaseProcessor
import exchange.dydx.abacus.protocols.ParserProtocol
Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit 27fcf3d

Please sign in to comment.