From 8139b546801c4330f7a40580afd7ab09dfea1183 Mon Sep 17 00:00:00 2001 From: Alex Sokol Date: Fri, 29 Apr 2022 20:32:29 +0300 Subject: [PATCH] feat: Updated to JS SDK networks + Boba Rinkeby + Boba Mainnet + Eth Mainnet + Bsc Mainnet + Polygon Mainnet + Avalanche Mainnet + ~30 crosschains added/updated --- .../com/symbiosis/sdk/ClientsManager.kt | 32 +++- .../com/symbiosis/sdk/currency/Token.kt | 2 +- .../com/symbiosis/sdk/network/Network.kt | 1 + .../symbiosis/sdk/network/NetworkClient.kt | 27 +-- .../metaRouter/MetaRouterV2Contract.kt | 5 +- .../symbiosis/sdk/stuck/ClientsManagerExt.kt | 10 + .../kotlin/com/symbiosis/sdk/SymbiosisSdk.kt | 178 ++++++------------ .../com/symbiosis/sdk/SymbiosisSdkMainnet.kt | 136 +++++++++++++ .../com/symbiosis/sdk/SymbiosisSdkTestnet.kt | 135 +++++++++++++ .../sdk/crosschain/DefaultCrossChain.kt | 1 + .../sdk/crosschain/EthRinkebyHecoTestnet.kt | 19 -- .../sdk/crosschain/HecoTestnetEthRinkeby.kt | 19 -- .../symbiosis/sdk/crosschain/StablePools.kt | 148 ++++++++++----- .../mainnet/AvalancheMainnetBscMainnet.kt | 21 +++ .../mainnet/AvalancheMainnetEthMainnet.kt | 20 ++ .../mainnet/AvalancheMainnetPolygonMainnet.kt | 21 +++ .../mainnet/BobaMainnetBscMainnet.kt | 21 +++ .../mainnet/BobaMainnetEthMainnet.kt | 21 +++ .../mainnet/BscMainnetAvalancheMainnet.kt | 21 +++ .../mainnet/BscMainnetBobaMainnet.kt | 21 +++ .../mainnet/BscMainnetEthMainnet.kt | 21 +++ .../mainnet/BscMainnetPolygonMainnet.kt | 21 +++ .../mainnet/EthMainnetAvalancheMainnet.kt | 20 ++ .../mainnet/EthMainnetBobaMainnet.kt | 21 +++ .../mainnet/EthMainnetBscMainnet.kt | 21 +++ .../mainnet/EthMainnetPolygonMainnet.kt | 21 +++ .../mainnet/PolygonMainnetAvalancheMainnet.kt | 21 +++ .../mainnet/PolygonMainnetBscMainnet.kt | 21 +++ .../mainnet/PolygonMainnetEthMainnet.kt | 22 +++ .../{ => testnet}/AvalancheFujiBscTestnet.kt | 7 +- .../{ => testnet}/AvalancheFujiEthRinkeby.kt | 7 +- .../testnet/BobaRinkebyBscTestnet.kt | 22 +++ .../testnet/BobaRinkebyEthRinkeby.kt | 22 +++ .../{ => testnet}/BscTestnetAvalancheFuji.kt | 7 +- .../testnet/BscTestnetBobaRinkeby.kt | 22 +++ .../{ => testnet}/BscTestnetEthRinkeby.kt | 7 +- .../{ => testnet}/BscTestnetPolygonMumbai.kt | 7 +- .../{ => testnet}/EthRinkebyAvalancheFuji.kt | 7 +- .../testnet/EthRinkebyBobaRinkeby.kt | 22 +++ .../{ => testnet}/EthRinkebyBscTestnet.kt | 7 +- .../{ => testnet}/EthRinkebyPolygonMumbai.kt | 7 +- .../{ => testnet}/PolygonMumbaiBscTestnet.kt | 7 +- .../{ => testnet}/PolygonMumbaiEthRinkeby.kt | 7 +- .../symbiosis/sdk/networks/AvalancheFuji.kt | 18 +- .../sdk/networks/AvalancheMainnet.kt | 57 ++++++ .../com/symbiosis/sdk/networks/BobaMainnet.kt | 57 ++++++ .../com/symbiosis/sdk/networks/BobaRinkeby.kt | 57 ++++++ .../com/symbiosis/sdk/networks/BscMainnet.kt | 61 ++++++ .../com/symbiosis/sdk/networks/BscTestnet.kt | 12 +- .../symbiosis/sdk/networks/DefaultNetwork.kt | 2 + .../com/symbiosis/sdk/networks/EthMainnet.kt | 60 ++++++ .../com/symbiosis/sdk/networks/EthRinkeby.kt | 13 +- .../com/symbiosis/sdk/networks/HecoTestnet.kt | 58 ------ .../symbiosis/sdk/networks/PolygonMainnet.kt | 57 ++++++ .../symbiosis/sdk/networks/PolygonMumbai.kt | 19 +- .../kotlin/com/symbiosis/sdk/MetaSwapTest.kt | 4 +- ...SdkTest.kt => SymbiosisSdkTestnetsTest.kt} | 2 +- .../kotlin/com/symbiosis/sdk/TestNetworks.kt | 2 +- 58 files changed, 1340 insertions(+), 345 deletions(-) create mode 100644 core/src/commonMain/kotlin/com/symbiosis/sdk/stuck/ClientsManagerExt.kt create mode 100644 sdk/src/commonMain/kotlin/com/symbiosis/sdk/SymbiosisSdkMainnet.kt create mode 100644 sdk/src/commonMain/kotlin/com/symbiosis/sdk/SymbiosisSdkTestnet.kt delete mode 100644 sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/EthRinkebyHecoTestnet.kt delete mode 100644 sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/HecoTestnetEthRinkeby.kt create mode 100644 sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/mainnet/AvalancheMainnetBscMainnet.kt create mode 100644 sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/mainnet/AvalancheMainnetEthMainnet.kt create mode 100644 sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/mainnet/AvalancheMainnetPolygonMainnet.kt create mode 100644 sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/mainnet/BobaMainnetBscMainnet.kt create mode 100644 sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/mainnet/BobaMainnetEthMainnet.kt create mode 100644 sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/mainnet/BscMainnetAvalancheMainnet.kt create mode 100644 sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/mainnet/BscMainnetBobaMainnet.kt create mode 100644 sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/mainnet/BscMainnetEthMainnet.kt create mode 100644 sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/mainnet/BscMainnetPolygonMainnet.kt create mode 100644 sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/mainnet/EthMainnetAvalancheMainnet.kt create mode 100644 sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/mainnet/EthMainnetBobaMainnet.kt create mode 100644 sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/mainnet/EthMainnetBscMainnet.kt create mode 100644 sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/mainnet/EthMainnetPolygonMainnet.kt create mode 100644 sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/mainnet/PolygonMainnetAvalancheMainnet.kt create mode 100644 sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/mainnet/PolygonMainnetBscMainnet.kt create mode 100644 sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/mainnet/PolygonMainnetEthMainnet.kt rename sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/{ => testnet}/AvalancheFujiBscTestnet.kt (68%) rename sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/{ => testnet}/AvalancheFujiEthRinkeby.kt (68%) create mode 100644 sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/testnet/BobaRinkebyBscTestnet.kt create mode 100644 sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/testnet/BobaRinkebyEthRinkeby.kt rename sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/{ => testnet}/BscTestnetAvalancheFuji.kt (68%) create mode 100644 sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/testnet/BscTestnetBobaRinkeby.kt rename sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/{ => testnet}/BscTestnetEthRinkeby.kt (68%) rename sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/{ => testnet}/BscTestnetPolygonMumbai.kt (68%) rename sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/{ => testnet}/EthRinkebyAvalancheFuji.kt (68%) create mode 100644 sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/testnet/EthRinkebyBobaRinkeby.kt rename sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/{ => testnet}/EthRinkebyBscTestnet.kt (68%) rename sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/{ => testnet}/EthRinkebyPolygonMumbai.kt (68%) rename sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/{ => testnet}/PolygonMumbaiBscTestnet.kt (68%) rename sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/{ => testnet}/PolygonMumbaiEthRinkeby.kt (68%) create mode 100644 sdk/src/commonMain/kotlin/com/symbiosis/sdk/networks/AvalancheMainnet.kt create mode 100644 sdk/src/commonMain/kotlin/com/symbiosis/sdk/networks/BobaMainnet.kt create mode 100644 sdk/src/commonMain/kotlin/com/symbiosis/sdk/networks/BobaRinkeby.kt create mode 100644 sdk/src/commonMain/kotlin/com/symbiosis/sdk/networks/BscMainnet.kt create mode 100644 sdk/src/commonMain/kotlin/com/symbiosis/sdk/networks/EthMainnet.kt delete mode 100644 sdk/src/commonMain/kotlin/com/symbiosis/sdk/networks/HecoTestnet.kt create mode 100644 sdk/src/commonMain/kotlin/com/symbiosis/sdk/networks/PolygonMainnet.kt rename sdk/src/jvmTest/kotlin/com/symbiosis/sdk/{SymbiosisSdkTest.kt => SymbiosisSdkTestnetsTest.kt} (99%) diff --git a/core/src/commonMain/kotlin/com/symbiosis/sdk/ClientsManager.kt b/core/src/commonMain/kotlin/com/symbiosis/sdk/ClientsManager.kt index b083415..991446c 100644 --- a/core/src/commonMain/kotlin/com/symbiosis/sdk/ClientsManager.kt +++ b/core/src/commonMain/kotlin/com/symbiosis/sdk/ClientsManager.kt @@ -1,8 +1,10 @@ package com.symbiosis.sdk +import com.soywiz.kbignum.BigInt import com.symbiosis.sdk.crosschain.CrossChain import com.symbiosis.sdk.crosschain.CrossChainClient import com.symbiosis.sdk.crosschain.RawUsageOfCrossChainConstructor +import com.symbiosis.sdk.currency.Token import com.symbiosis.sdk.network.Network import com.symbiosis.sdk.network.NetworkClient import com.symbiosis.sdk.network.RawUsageOfNetworkConstructor @@ -16,9 +18,31 @@ import com.symbiosis.sdk.network.RawUsageOfNetworkConstructor * @see NetworkClient */ @OptIn(RawUsageOfNetworkConstructor::class, RawUsageOfCrossChainConstructor::class) -open class ClientsManager { - fun getNetworkClient(network: Network) = NetworkClient(network) - fun getCrossChainClient(crossChain: CrossChain) = CrossChainClient(crossChain) +interface ClientsManager { + val allNetworks: List + val allTokens: List + val allClients: List + val allCrossChainClients: List - companion object : ClientsManager() + fun getCrossChainClient(firstNetwork: Network, secondNetwork: Network) = + getCrossChainClient(firstNetwork.chainId, secondNetwork.chainId) + + fun getCrossChainClient(firstNetworkChainId: BigInt, secondNetworkChainId: BigInt) = allCrossChainClients + .find { it.crossChain.fromNetwork.chainId == firstNetworkChainId && + it.crossChain.toNetwork.chainId == secondNetworkChainId } + + fun getNetworkClient(network: Network) = Companion.getNetworkClient(network) + fun getCrossChainClient(crossChain: CrossChain) = Companion.getCrossChainClient(crossChain) + + companion object { + fun getNetworkClient(network: Network) = NetworkClient(network) + fun getCrossChainClient(crossChain: CrossChain) = CrossChainClient(crossChain) + } +} + +fun ClientsManager() = object : ClientsManager { + override val allNetworks: List = listOf() + override val allTokens: List = listOf() + override val allClients: List = listOf() + override val allCrossChainClients: List = listOf() } diff --git a/core/src/commonMain/kotlin/com/symbiosis/sdk/currency/Token.kt b/core/src/commonMain/kotlin/com/symbiosis/sdk/currency/Token.kt index 87db793..babd67f 100644 --- a/core/src/commonMain/kotlin/com/symbiosis/sdk/currency/Token.kt +++ b/core/src/commonMain/kotlin/com/symbiosis/sdk/currency/Token.kt @@ -42,7 +42,7 @@ fun DecimalsErc20Token(network: Network, tokenAddress: ContractAddress, decimals } interface DecimalsNativeToken : DecimalsToken, NativeToken -fun DecimalsNativeToken(network: Network, wrapped: Erc20Token, decimals: Int = 18) = object : DecimalsNativeToken { +fun DecimalsNativeToken(wrapped: Erc20Token, network: Network = wrapped.network, decimals: Int = 18) = object : DecimalsNativeToken { override val network: Network = network override val wrapped: Erc20Token = wrapped override val decimals: Int = decimals diff --git a/core/src/commonMain/kotlin/com/symbiosis/sdk/network/Network.kt b/core/src/commonMain/kotlin/com/symbiosis/sdk/network/Network.kt index 0268275..c94dd94 100644 --- a/core/src/commonMain/kotlin/com/symbiosis/sdk/network/Network.kt +++ b/core/src/commonMain/kotlin/com/symbiosis/sdk/network/Network.kt @@ -27,6 +27,7 @@ interface Network { val bridgeAddress: ContractAddress val routerAddress: ContractAddress val metaRouterAddress: ContractAddress + val metaRouterGatewayAddress: ContractAddress val nativeCurrency: DecimalsNativeToken val swapBases: List diff --git a/core/src/commonMain/kotlin/com/symbiosis/sdk/network/NetworkClient.kt b/core/src/commonMain/kotlin/com/symbiosis/sdk/network/NetworkClient.kt index 300ae69..bd65569 100644 --- a/core/src/commonMain/kotlin/com/symbiosis/sdk/network/NetworkClient.kt +++ b/core/src/commonMain/kotlin/com/symbiosis/sdk/network/NetworkClient.kt @@ -10,23 +10,8 @@ import com.symbiosis.sdk.currency.NetworkTokenPair import com.symbiosis.sdk.currency.thisOrWrapped import com.symbiosis.sdk.dex.DexEndpoint import com.symbiosis.sdk.gas.GasConfiguration -import com.symbiosis.sdk.network.contract.NerveContract -import com.symbiosis.sdk.network.contract.OutboundRequest -import com.symbiosis.sdk.network.contract.PoolContract -import com.symbiosis.sdk.network.contract.PortalContract -import com.symbiosis.sdk.network.contract.RouterContract -import com.symbiosis.sdk.network.contract.SynthFabricContract -import com.symbiosis.sdk.network.contract.SynthesizeContract -import com.symbiosis.sdk.network.contract.TokenContract -import com.symbiosis.sdk.network.contract.WrappedContract -import com.symbiosis.sdk.network.contract.abi.createPoolContractAbi -import com.symbiosis.sdk.network.contract.abi.createWrappedContractAbi -import com.symbiosis.sdk.network.contract.abi.fabricContractAbi -import com.symbiosis.sdk.network.contract.abi.metaRouterV2Contract -import com.symbiosis.sdk.network.contract.abi.nerveContract -import com.symbiosis.sdk.network.contract.abi.portalContractAbi -import com.symbiosis.sdk.network.contract.abi.routerContractAbi -import com.symbiosis.sdk.network.contract.abi.synthesizeContractAbi +import com.symbiosis.sdk.network.contract.* +import com.symbiosis.sdk.network.contract.abi.* import com.symbiosis.sdk.network.contract.metaRouter.MetaRouterV2Contract import com.symbiosis.sdk.network.wrapper.SwapWrapper import com.symbiosis.sdk.stuck.StuckRequest @@ -35,12 +20,7 @@ import com.symbiosis.sdk.swap.generate import com.symbiosis.sdk.swap.meta.NerveStablePool import com.symbiosis.sdk.transaction.SignedTransaction import com.symbiosis.sdk.wallet.Credentials -import dev.icerock.moko.web3.BlockState -import dev.icerock.moko.web3.ContractAddress -import dev.icerock.moko.web3.EthereumAddress -import dev.icerock.moko.web3.WalletAddress -import dev.icerock.moko.web3.Web3Executor -import dev.icerock.moko.web3.Web3RpcRequest +import dev.icerock.moko.web3.* import dev.icerock.moko.web3.contract.ABIDecoder import dev.icerock.moko.web3.contract.SmartContract import dev.icerock.moko.web3.contract.createErc20TokenAbi @@ -135,6 +115,7 @@ class NetworkClient @RawUsageOfNetworkConstructor constructor(val network: Netwo ) val metaRouterV2: MetaRouterV2Contract = MetaRouterV2Contract( metaRouterV2SmartContract = metaRouterV2SmartContract, + metaRouterGatewayAddress = network.metaRouterGatewayAddress, nonceController = network.nonceController, executor = network.executor, defaultGasProvider = network.gasProvider, diff --git a/core/src/commonMain/kotlin/com/symbiosis/sdk/network/contract/metaRouter/MetaRouterV2Contract.kt b/core/src/commonMain/kotlin/com/symbiosis/sdk/network/contract/metaRouter/MetaRouterV2Contract.kt index ed01f68..b3eccfc 100644 --- a/core/src/commonMain/kotlin/com/symbiosis/sdk/network/contract/metaRouter/MetaRouterV2Contract.kt +++ b/core/src/commonMain/kotlin/com/symbiosis/sdk/network/contract/metaRouter/MetaRouterV2Contract.kt @@ -10,7 +10,6 @@ import com.symbiosis.sdk.network.contract.approveMaxIfNeed import com.symbiosis.sdk.wallet.Credentials import dev.icerock.moko.web3.ContractAddress import dev.icerock.moko.web3.TransactionHash -import dev.icerock.moko.web3.Web3Executor import dev.icerock.moko.web3.contract.SmartContract import dev.icerock.moko.web3.hex.HexString @@ -19,8 +18,8 @@ import dev.icerock.moko.web3.hex.HexString */ class MetaRouterV2Contract( private val metaRouterV2SmartContract: SmartContract, + private val metaRouterGatewayAddress: ContractAddress, private val nonceController: NonceController, - private val executor: Web3Executor, private val defaultGasProvider: GasProvider, private val tokenContractProvider: (ContractAddress) -> TokenContract ) { @@ -59,7 +58,7 @@ class MetaRouterV2Contract( if (firstToken is FirstToken.Erc20) { tokenContractProvider(firstToken.address).approveMaxIfNeed( credentials = credentials, - spender = metaRouterV2SmartContract.contractAddress, + spender = metaRouterGatewayAddress, amount = amount, gasProvider = gasProvider ) diff --git a/core/src/commonMain/kotlin/com/symbiosis/sdk/stuck/ClientsManagerExt.kt b/core/src/commonMain/kotlin/com/symbiosis/sdk/stuck/ClientsManagerExt.kt new file mode 100644 index 0000000..56755dd --- /dev/null +++ b/core/src/commonMain/kotlin/com/symbiosis/sdk/stuck/ClientsManagerExt.kt @@ -0,0 +1,10 @@ +package com.symbiosis.sdk.stuck + +import com.symbiosis.sdk.ClientsManager +import com.symbiosis.sdk.network.NetworkClient +import dev.icerock.moko.web3.WalletAddress + +suspend fun ClientsManager.getStuckTransactions( + address: WalletAddress, + clients: List = allClients +): List = clients.flatMap { it.getStuckTransactions(address, clients) } diff --git a/sdk/src/commonMain/kotlin/com/symbiosis/sdk/SymbiosisSdk.kt b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/SymbiosisSdk.kt index 40b65f1..f6064a6 100644 --- a/sdk/src/commonMain/kotlin/com/symbiosis/sdk/SymbiosisSdk.kt +++ b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/SymbiosisSdk.kt @@ -1,133 +1,79 @@ -@file:Suppress("MemberVisibilityCanBePrivate") - package com.symbiosis.sdk import com.soywiz.kbignum.BigInt -import com.symbiosis.sdk.crosschain.AvalancheFujiBscTestnet -import com.symbiosis.sdk.crosschain.AvalancheFujiEthRinkeby -import com.symbiosis.sdk.crosschain.BscTestnetAvalancheFuji -import com.symbiosis.sdk.crosschain.BscTestnetEthRinkeby -import com.symbiosis.sdk.crosschain.BscTestnetPolygonMumbai +import com.symbiosis.sdk.crosschain.CrossChain import com.symbiosis.sdk.crosschain.CrossChainClient -import com.symbiosis.sdk.crosschain.EthRinkebyAvalancheFuji -import com.symbiosis.sdk.crosschain.EthRinkebyBscTestnet -import com.symbiosis.sdk.crosschain.EthRinkebyHecoTestnet -import com.symbiosis.sdk.crosschain.EthRinkebyPolygonMumbai -import com.symbiosis.sdk.crosschain.HecoTestnetEthRinkeby -import com.symbiosis.sdk.crosschain.PolygonMumbaiBscTestnet -import com.symbiosis.sdk.crosschain.PolygonMumbaiEthRinkeby -import com.symbiosis.sdk.currency.Token import com.symbiosis.sdk.network.Network import com.symbiosis.sdk.network.NetworkClient -import com.symbiosis.sdk.networks.AvalancheFuji -import com.symbiosis.sdk.networks.BscTestnet -import com.symbiosis.sdk.networks.DefaultNetwork -import com.symbiosis.sdk.networks.EthRinkeby -import com.symbiosis.sdk.networks.HecoTestnet -import com.symbiosis.sdk.networks.PolygonMumbai -import com.symbiosis.sdk.stuck.StuckRequest -import dev.icerock.moko.web3.WalletAddress import dev.icerock.moko.web3.Web3 import dev.icerock.moko.web3.Web3Executor -open class SymbiosisSdk( +interface SymbiosisSdk : SymbiosisSdkMainnet, SymbiosisSdkTestnet + +fun SymbiosisSdk( + bscMainnetUrl: String, + ethMainnetUrl: String, + polygonMainnetUrl: String, + bscTestnetUrl: String, + ethRinkebyUrl: String, + polygonMumbaiUrl: String, + avalancheMainnetUrl: String = "https://api.avax.network/ext/bc/C/rpc", + bobaMainnetUrl: String = "https://mainnet.boba.network/", + avalancheFujiUrl: String = "https://api.avax-test.network/ext/bc/C/rpc", + bobaRinkebyUrl: String = "https://rinkeby.boba.network/" +) = SymbiosisSdk( + avalancheMainnetExecutor = Web3(avalancheMainnetUrl), + bscMainnetExecutor = Web3(bscMainnetUrl), + ethMainnetExecutor = Web3(ethMainnetUrl), + polygonMainnetExecutor = Web3(polygonMainnetUrl), + bobaMainnetExecutor = Web3(bobaMainnetUrl), + avalancheFujiExecutor = Web3(avalancheFujiUrl), + bscTestnetExecutor = Web3(bscTestnetUrl), + ethRinkebyExecutor = Web3(ethRinkebyUrl), + polygonMumbaiExecutor = Web3(polygonMumbaiUrl), + bobaRinkebyExecutor = Web3(bobaRinkebyUrl) +) + +fun SymbiosisSdk( + avalancheMainnetExecutor: Web3Executor, + bscMainnetExecutor: Web3Executor, + ethMainnetExecutor: Web3Executor, + polygonMainnetExecutor: Web3Executor, + bobaMainnetExecutor: Web3Executor, avalancheFujiExecutor: Web3Executor, bscTestnetExecutor: Web3Executor, ethRinkebyExecutor: Web3Executor, - hecoTestnetExecutor: Web3Executor, - polygonMumbaiExecutor: Web3Executor -) : ClientsManager() { - constructor( - bscTestnetUrl: String, - ethRinkebyUrl: String, - polygonMumbaiUrl: String, - avalancheFujiUrl: String = "https://api.avax-test.network/ext/bc/C/rpc", - hecoTestnetUrl: String = "https://http-testnet.hecochain.com" - ) : this( - avalancheFujiExecutor = Web3(avalancheFujiUrl), - bscTestnetExecutor = Web3(bscTestnetUrl), - ethRinkebyExecutor = Web3(ethRinkebyUrl), - hecoTestnetExecutor = Web3(hecoTestnetUrl), - polygonMumbaiExecutor = Web3(polygonMumbaiUrl) - ) - - val avalancheFuji = AvalancheFuji(avalancheFujiExecutor) - val bscTestnet = BscTestnet(bscTestnetExecutor) - val ethRinkeby = EthRinkeby(ethRinkebyExecutor) - val hecoTestnet = HecoTestnet(hecoTestnetExecutor) - val polygonMumbai = PolygonMumbai(polygonMumbaiExecutor) - - val allNetworks: List = listOf( - avalancheFuji, bscTestnet, ethRinkeby, - hecoTestnet, polygonMumbai - ) - val allTokens: List = allNetworks.flatMap(DefaultNetwork::tokens) - - val avalancheFujiClient = getNetworkClient(avalancheFuji) - val bscTestnetClient = getNetworkClient(bscTestnet) - val ethRinkebyClient = getNetworkClient(ethRinkeby) - val hecoTestnetClient = getNetworkClient(hecoTestnet) - val polygonMumbaiClient = getNetworkClient(polygonMumbai) + polygonMumbaiExecutor: Web3Executor, + bobaRinkebyExecutor: Web3Executor +): SymbiosisSdk = createSymbiosisSdk( + mainnet = SymbiosisSdkMainnet( + avalancheMainnetExecutor, bscMainnetExecutor, + ethMainnetExecutor, polygonMainnetExecutor, bobaMainnetExecutor + ), + testnet = SymbiosisSdkTestnet( + avalancheFujiExecutor, bscTestnetExecutor, + ethRinkebyExecutor, polygonMumbaiExecutor, bobaRinkebyExecutor + ) +) - val allClients: List = listOf( - avalancheFujiClient, bscTestnetClient, ethRinkebyClient, - hecoTestnetClient, polygonMumbaiClient - ) +private fun createSymbiosisSdk(mainnet: SymbiosisSdkMainnet, testnet: SymbiosisSdkTestnet): SymbiosisSdk = + object : SymbiosisSdk, SymbiosisSdkMainnet by mainnet, SymbiosisSdkTestnet by testnet { + override val allNetworks = mainnet.allNetworks + testnet.allNetworks + override val allTokens = mainnet.allTokens + testnet.allTokens + override val allClients = mainnet.allClients + testnet.allClients + override val allCrossChainClients = mainnet.allCrossChainClients + testnet.allCrossChainClients - val avalancheFujiBscTestnetClient = getCrossChainClient( - AvalancheFujiBscTestnet(avalancheFujiExecutor, bscTestnetExecutor) - ) - val avalancheFujiEthRinkebyClient = getCrossChainClient( - AvalancheFujiEthRinkeby(avalancheFujiExecutor, ethRinkebyExecutor) - ) - val bscTestnetAvalancheFujiClient = getCrossChainClient( - BscTestnetAvalancheFuji(bscTestnetExecutor, avalancheFujiExecutor) - ) - val bscTestnetEthRinkebyClient = getCrossChainClient( - BscTestnetEthRinkeby(bscTestnetExecutor, ethRinkebyExecutor) - ) - val bscTestnetPolygonMumbaiClient = getCrossChainClient( - BscTestnetPolygonMumbai(bscTestnetExecutor, polygonMumbaiExecutor) - ) - val ethRinkebyAvalancheFujiClient = getCrossChainClient( - EthRinkebyAvalancheFuji(ethRinkebyExecutor, avalancheFujiExecutor) - ) - val ethRinkebyBscTestnetClient = getCrossChainClient( - EthRinkebyBscTestnet(ethRinkebyExecutor, bscTestnetExecutor) - ) - val ethRinkebyHecoTestnetClient = getCrossChainClient( - EthRinkebyHecoTestnet(ethRinkebyExecutor, hecoTestnetExecutor) - ) - val ethRinkebyPolygonMumbaiClient = getCrossChainClient( - EthRinkebyPolygonMumbai(ethRinkebyExecutor, polygonMumbaiExecutor) - ) - val hecoTestnetEthRinkebyClient = getCrossChainClient( - HecoTestnetEthRinkeby(hecoTestnetExecutor, ethRinkebyExecutor) - ) - val polygonMumbaiBscTestnetClient = getCrossChainClient( - PolygonMumbaiBscTestnet(polygonMumbaiExecutor, bscTestnetExecutor) - ) - val polygonMumbaiEthRinkebyClient = getCrossChainClient( - PolygonMumbaiEthRinkeby(polygonMumbaiExecutor, ethRinkebyExecutor) - ) - - val allCrossChainClients: List = listOf( - avalancheFujiBscTestnetClient, avalancheFujiEthRinkebyClient, - bscTestnetAvalancheFujiClient, bscTestnetEthRinkebyClient, bscTestnetPolygonMumbaiClient, - ethRinkebyAvalancheFujiClient, ethRinkebyBscTestnetClient, ethRinkebyHecoTestnetClient, - ethRinkebyPolygonMumbaiClient, hecoTestnetEthRinkebyClient, - polygonMumbaiBscTestnetClient, polygonMumbaiEthRinkebyClient - ) + // default implementation is always used when calling this function, so + // ClientsManager.* methods will have the default implementation + override fun getCrossChainClient(crossChain: CrossChain): CrossChainClient = + mainnet.getCrossChainClient(crossChain) - fun getCrossChainClient(firstNetwork: Network, secondNetwork: Network) = - getCrossChainClient(firstNetwork.chainId, secondNetwork.chainId) + override fun getCrossChainClient(firstNetwork: Network, secondNetwork: Network): CrossChainClient? = + mainnet.getCrossChainClient(firstNetwork, secondNetwork) - fun getCrossChainClient(firstNetworkChainId: BigInt, secondNetworkChainId: BigInt) = allCrossChainClients - .find { it.crossChain.fromNetwork.chainId == firstNetworkChainId && - it.crossChain.toNetwork.chainId == secondNetworkChainId } + override fun getCrossChainClient(firstNetworkChainId: BigInt, secondNetworkChainId: BigInt): CrossChainClient? = + mainnet.getCrossChainClient(firstNetworkChainId, secondNetworkChainId) - suspend fun getStuckTransactions( - address: WalletAddress, - clients: List = allClients - ): List = clients.flatMap { it.getStuckTransactions(address, clients) } -} + override fun getNetworkClient(network: Network): NetworkClient = + mainnet.getNetworkClient(network) + } diff --git a/sdk/src/commonMain/kotlin/com/symbiosis/sdk/SymbiosisSdkMainnet.kt b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/SymbiosisSdkMainnet.kt new file mode 100644 index 0000000..9e71d09 --- /dev/null +++ b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/SymbiosisSdkMainnet.kt @@ -0,0 +1,136 @@ +package com.symbiosis.sdk + +import com.symbiosis.sdk.crosschain.CrossChainClient +import com.symbiosis.sdk.crosschain.mainnet.* +import com.symbiosis.sdk.currency.Token +import com.symbiosis.sdk.network.Network +import com.symbiosis.sdk.network.NetworkClient +import com.symbiosis.sdk.networks.* +import dev.icerock.moko.web3.Web3 +import dev.icerock.moko.web3.Web3Executor + +interface SymbiosisSdkMainnet : ClientsManager { + val avalancheMainnet: AvalancheMainnet + val bscMainnet: BscMainnet + val ethMainnet: EthMainnet + val polygonMainnet: PolygonMainnet + val bobaMainnet: BobaMainnet + + override val allNetworks: List + override val allTokens: List + + val avalancheMainnetClient: NetworkClient + val bscMainnetClient: NetworkClient + val ethMainnetClient: NetworkClient + val polygonMainnetClient: NetworkClient + val bobaMainnetClient: NetworkClient + + override val allClients: List + + val avalancheMainnetEthMainnetClient: CrossChainClient + val avalancheMainnetBscMainnetClient: CrossChainClient + val avalancheMainnetPolygonMainnetClient: CrossChainClient + val ethMainnetAvalancheMainnetClient: CrossChainClient + val ethMainnetBscMainnetClient: CrossChainClient + val ethMainnetBobaMainnetClient: CrossChainClient + val ethMainnetPolygonMainnetClient: CrossChainClient + val bscMainnetAvalancheMainnetClient: CrossChainClient + val bscMainnetPolygonMainnetClient: CrossChainClient + val bscMainnetBobaMainnetClient: CrossChainClient + val bscMainnetEthMainnetClient: CrossChainClient + val bobaMainnetBscMainnetClient: CrossChainClient + val bobaMainnetEthMainnetClient: CrossChainClient + val polygonMainnetAvalancheMainnetClient: CrossChainClient + val polygonMainnetEthMainnetClient: CrossChainClient + val polygonMainnetBscMainnetClient: CrossChainClient + + override val allCrossChainClients: List +} + +fun SymbiosisSdkMainnet( + bscMainnetUrl: String, + ethMainnetUrl: String, + polygonMainnetUrl: String, + avalancheMainnetUrl: String = "https://api.avax.network/ext/bc/C/rpc", + bobaMainnetUrl: String = "https://mainnet.boba.network/" +) = SymbiosisSdkMainnet( + avalancheMainnetExecutor = Web3(avalancheMainnetUrl), + bscMainnetExecutor = Web3(bscMainnetUrl), + ethMainnetExecutor = Web3(ethMainnetUrl), + polygonMainnetExecutor = Web3(polygonMainnetUrl), + bobaMainnetExecutor = Web3(bobaMainnetUrl) +) + +fun SymbiosisSdkMainnet( + avalancheMainnetExecutor: Web3Executor, + bscMainnetExecutor: Web3Executor, + ethMainnetExecutor: Web3Executor, + polygonMainnetExecutor: Web3Executor, + bobaMainnetExecutor: Web3Executor +): SymbiosisSdkMainnet = object : SymbiosisSdkMainnet { + override val avalancheMainnet: AvalancheMainnet = AvalancheMainnet(avalancheMainnetExecutor) + override val bscMainnet: BscMainnet = BscMainnet(bscMainnetExecutor) + override val ethMainnet: EthMainnet = EthMainnet(ethMainnetExecutor) + override val polygonMainnet: PolygonMainnet = PolygonMainnet(polygonMainnetExecutor) + override val bobaMainnet: BobaMainnet = BobaMainnet(bobaMainnetExecutor) + + override val allNetworks: List = + listOf(avalancheMainnet, bscMainnet, ethMainnet, polygonMainnet, bobaMainnet) + override val allTokens: List = allNetworks.flatMap(DefaultNetwork::tokens) + + override val avalancheMainnetClient: NetworkClient = getNetworkClient(avalancheMainnet) + override val bscMainnetClient: NetworkClient = getNetworkClient(bscMainnet) + override val ethMainnetClient: NetworkClient = getNetworkClient(ethMainnet) + override val polygonMainnetClient: NetworkClient = getNetworkClient(polygonMainnet) + override val bobaMainnetClient: NetworkClient = getNetworkClient(bobaMainnet) + + override val allClients: List = listOf( + avalancheMainnetClient, bscMainnetClient, + ethMainnetClient, polygonMainnetClient, + bobaMainnetClient + ) + + override val avalancheMainnetEthMainnetClient = + getCrossChainClient(AvalancheMainnetEthMainnet(avalancheMainnetExecutor, ethMainnetExecutor)) + override val avalancheMainnetBscMainnetClient = + getCrossChainClient(AvalancheMainnetBscMainnet(avalancheMainnetExecutor, bscMainnetExecutor)) + override val avalancheMainnetPolygonMainnetClient = + getCrossChainClient(AvalancheMainnetPolygonMainnet(avalancheMainnetExecutor, polygonMainnetExecutor)) + override val ethMainnetAvalancheMainnetClient = + getCrossChainClient(EthMainnetAvalancheMainnet(ethMainnetExecutor, avalancheMainnetExecutor)) + override val ethMainnetBscMainnetClient = + getCrossChainClient(EthMainnetBscMainnet(ethMainnetExecutor, bscMainnetExecutor)) + override val ethMainnetBobaMainnetClient = + getCrossChainClient(EthMainnetBobaMainnet(ethMainnetExecutor, bobaMainnetExecutor)) + override val ethMainnetPolygonMainnetClient = + getCrossChainClient(EthMainnetPolygonMainnet(ethMainnetExecutor, polygonMainnetExecutor)) + override val bscMainnetAvalancheMainnetClient = + getCrossChainClient(BscMainnetAvalancheMainnet(bscMainnetExecutor, avalancheMainnetExecutor)) + override val bscMainnetPolygonMainnetClient = + getCrossChainClient(BscMainnetPolygonMainnet(bscMainnetExecutor, polygonMainnetExecutor)) + override val bscMainnetBobaMainnetClient = + getCrossChainClient(BscMainnetBobaMainnet(bscMainnetExecutor, bobaMainnetExecutor)) + override val bscMainnetEthMainnetClient = + getCrossChainClient(BscMainnetEthMainnet(bscMainnetExecutor, ethMainnetExecutor)) + override val bobaMainnetBscMainnetClient = + getCrossChainClient(BobaMainnetBscMainnet(bobaMainnetExecutor, bscMainnetExecutor)) + override val bobaMainnetEthMainnetClient = + getCrossChainClient(BobaMainnetEthMainnet(bobaMainnetExecutor, ethMainnetExecutor)) + override val polygonMainnetAvalancheMainnetClient = + getCrossChainClient(PolygonMainnetAvalancheMainnet(polygonMainnetExecutor, avalancheMainnetExecutor)) + override val polygonMainnetEthMainnetClient = + getCrossChainClient(PolygonMainnetEthMainnet(polygonMainnetExecutor, ethMainnetExecutor)) + override val polygonMainnetBscMainnetClient = + getCrossChainClient(PolygonMainnetBscMainnet(polygonMainnetExecutor, bscMainnetExecutor)) + + override val allCrossChainClients: List = listOf( + avalancheMainnetBscMainnetClient, avalancheMainnetEthMainnetClient, + avalancheMainnetPolygonMainnetClient, ethMainnetAvalancheMainnetClient, + ethMainnetBscMainnetClient, ethMainnetBobaMainnetClient, + ethMainnetPolygonMainnetClient, bscMainnetAvalancheMainnetClient, + bscMainnetPolygonMainnetClient, bscMainnetBobaMainnetClient, + bscMainnetEthMainnetClient, bobaMainnetBscMainnetClient, + bobaMainnetEthMainnetClient, polygonMainnetAvalancheMainnetClient, + polygonMainnetEthMainnetClient, polygonMainnetBscMainnetClient + ) +} diff --git a/sdk/src/commonMain/kotlin/com/symbiosis/sdk/SymbiosisSdkTestnet.kt b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/SymbiosisSdkTestnet.kt new file mode 100644 index 0000000..7b6c07e --- /dev/null +++ b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/SymbiosisSdkTestnet.kt @@ -0,0 +1,135 @@ +@file:Suppress("MemberVisibilityCanBePrivate") + +package com.symbiosis.sdk + +import com.symbiosis.sdk.crosschain.CrossChainClient +import com.symbiosis.sdk.crosschain.testnet.* +import com.symbiosis.sdk.currency.Token +import com.symbiosis.sdk.network.Network +import com.symbiosis.sdk.network.NetworkClient +import com.symbiosis.sdk.networks.* +import dev.icerock.moko.web3.Web3 +import dev.icerock.moko.web3.Web3Executor + +interface SymbiosisSdkTestnet : ClientsManager { + val avalancheFuji: AvalancheFuji + val bscTestnet: BscTestnet + val ethRinkeby: EthRinkeby + val polygonMumbai: PolygonMumbai + val bobaRinkeby: BobaRinkeby + + override val allNetworks: List + override val allTokens: List + + val avalancheFujiClient: NetworkClient + val bscTestnetClient: NetworkClient + val ethRinkebyClient: NetworkClient + val polygonMumbaiClient: NetworkClient + val bobaRinkebyClient: NetworkClient + + override val allClients: List + + val avalancheFujiBscTestnetClient: CrossChainClient + val avalancheFujiEthRinkebyClient: CrossChainClient + val bscTestnetAvalancheFujiClient: CrossChainClient + val bscTestnetEthRinkebyClient: CrossChainClient + val bscTestnetPolygonMumbaiClient: CrossChainClient + val bscTestnetBobaRinkebyClient: CrossChainClient + val ethRinkebyAvalancheFujiClient: CrossChainClient + val ethRinkebyBscTestnetClient: CrossChainClient + val ethRinkebyPolygonMumbaiClient: CrossChainClient + val ethRinkebyBobaRinkebyClient: CrossChainClient + val polygonMumbaiBscTestnetClient: CrossChainClient + val polygonMumbaiEthRinkebyClient: CrossChainClient + val bobaRinkebyEthRinkebyClient: CrossChainClient + val bobaRinkebyBscTestnetClient: CrossChainClient + + override val allCrossChainClients: List +} + +fun SymbiosisSdkTestnet( + bscTestnetUrl: String, + ethRinkebyUrl: String, + polygonMumbaiUrl: String, + avalancheFujiUrl: String = "https://api.avax-test.network/ext/bc/C/rpc", + bobaRinkebyUrl: String = "https://rinkeby.boba.network/" +) = SymbiosisSdkTestnet( + avalancheFujiExecutor = Web3(avalancheFujiUrl), + bscTestnetExecutor = Web3(bscTestnetUrl), + ethRinkebyExecutor = Web3(ethRinkebyUrl), + polygonMumbaiExecutor = Web3(polygonMumbaiUrl), + bobaRinkebyExecutor = Web3(bobaRinkebyUrl) +) + +fun SymbiosisSdkTestnet( + avalancheFujiExecutor: Web3Executor, + bscTestnetExecutor: Web3Executor, + ethRinkebyExecutor: Web3Executor, + polygonMumbaiExecutor: Web3Executor, + bobaRinkebyExecutor: Web3Executor +): SymbiosisSdkTestnet = object : SymbiosisSdkTestnet { + override val avalancheFuji = AvalancheFuji(avalancheFujiExecutor) + override val bscTestnet = BscTestnet(bscTestnetExecutor) + override val ethRinkeby = EthRinkeby(ethRinkebyExecutor) + override val polygonMumbai = PolygonMumbai(polygonMumbaiExecutor) + override val bobaRinkeby = BobaRinkeby(bobaRinkebyExecutor) + + override val allNetworks: List = listOf( + avalancheFuji, bscTestnet, + ethRinkeby, polygonMumbai, + bobaRinkeby + ) + override val allTokens: List = allNetworks.flatMap(DefaultNetwork::tokens) + + override val avalancheFujiClient = getNetworkClient(avalancheFuji) + override val bscTestnetClient = getNetworkClient(bscTestnet) + override val ethRinkebyClient = getNetworkClient(ethRinkeby) + override val polygonMumbaiClient = getNetworkClient(polygonMumbai) + override val bobaRinkebyClient = getNetworkClient(bobaRinkeby) + + override val allClients: List = listOf( + avalancheFujiClient, bscTestnetClient, + ethRinkebyClient, polygonMumbaiClient, + bobaRinkebyClient + ) + + override val avalancheFujiBscTestnetClient = + getCrossChainClient(AvalancheFujiBscTestnet(avalancheFujiExecutor, bscTestnetExecutor)) + override val avalancheFujiEthRinkebyClient = + getCrossChainClient(AvalancheFujiEthRinkeby(avalancheFujiExecutor, ethRinkebyExecutor)) + override val bscTestnetAvalancheFujiClient = + getCrossChainClient(BscTestnetAvalancheFuji(bscTestnetExecutor, avalancheFujiExecutor)) + override val bscTestnetEthRinkebyClient = + getCrossChainClient(BscTestnetEthRinkeby(bscTestnetExecutor, ethRinkebyExecutor)) + override val bscTestnetPolygonMumbaiClient = + getCrossChainClient(BscTestnetPolygonMumbai(bscTestnetExecutor, polygonMumbaiExecutor)) + override val bscTestnetBobaRinkebyClient = + getCrossChainClient(BscTestnetBobaRinkeby(bscTestnetExecutor, bobaRinkebyExecutor)) + override val ethRinkebyAvalancheFujiClient = + getCrossChainClient(EthRinkebyAvalancheFuji(ethRinkebyExecutor, avalancheFujiExecutor)) + override val ethRinkebyBscTestnetClient = + getCrossChainClient(EthRinkebyBscTestnet(ethRinkebyExecutor, bscTestnetExecutor)) + override val ethRinkebyPolygonMumbaiClient = + getCrossChainClient(EthRinkebyPolygonMumbai(ethRinkebyExecutor, polygonMumbaiExecutor)) + override val ethRinkebyBobaRinkebyClient = + getCrossChainClient(EthRinkebyBobaRinkeby(ethRinkebyExecutor, bobaRinkebyExecutor)) + override val polygonMumbaiBscTestnetClient = + getCrossChainClient(PolygonMumbaiBscTestnet(polygonMumbaiExecutor, bscTestnetExecutor)) + override val polygonMumbaiEthRinkebyClient = + getCrossChainClient(PolygonMumbaiEthRinkeby(polygonMumbaiExecutor, ethRinkebyExecutor)) + override val bobaRinkebyEthRinkebyClient = + getCrossChainClient(BobaRinkebyEthRinkeby(bobaRinkebyExecutor, ethRinkebyExecutor)) + override val bobaRinkebyBscTestnetClient = + getCrossChainClient(BobaRinkebyBscTestnet(bobaRinkebyExecutor, bscTestnetExecutor)) + + override val allCrossChainClients: List = listOf( + avalancheFujiBscTestnetClient, avalancheFujiEthRinkebyClient, + bscTestnetAvalancheFujiClient, bscTestnetEthRinkebyClient, + bscTestnetPolygonMumbaiClient, ethRinkebyAvalancheFujiClient, + ethRinkebyBscTestnetClient, ethRinkebyPolygonMumbaiClient, + polygonMumbaiBscTestnetClient, polygonMumbaiEthRinkebyClient, + bscTestnetBobaRinkebyClient, ethRinkebyBobaRinkebyClient, + bobaRinkebyEthRinkebyClient, bobaRinkebyBscTestnetClient + ) +} + diff --git a/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/DefaultCrossChain.kt b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/DefaultCrossChain.kt index e3e4ec8..dc18584 100644 --- a/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/DefaultCrossChain.kt +++ b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/DefaultCrossChain.kt @@ -4,6 +4,7 @@ import com.soywiz.kbignum.BigNum import com.soywiz.kbignum.bn import com.symbiosis.sdk.configuration.BridgingFeeProvider import com.symbiosis.sdk.configuration.SwapTTLProvider +import com.symbiosis.sdk.crosschain.CrossChain import com.symbiosis.sdk.providers.DefaultBridgingFeeProvider import com.symbiosis.sdk.providers.DefaultTTLProvider diff --git a/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/EthRinkebyHecoTestnet.kt b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/EthRinkebyHecoTestnet.kt deleted file mode 100644 index ee8c1bd..0000000 --- a/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/EthRinkebyHecoTestnet.kt +++ /dev/null @@ -1,19 +0,0 @@ -package com.symbiosis.sdk.crosschain - -import com.symbiosis.sdk.networks.EthRinkeby -import com.symbiosis.sdk.networks.HecoTestnet -import com.symbiosis.sdk.swap.meta.NerveStablePool -import dev.icerock.moko.web3.Web3 -import dev.icerock.moko.web3.Web3Executor - -class EthRinkebyHecoTestnet( - ethRinkebyExecutor: Web3Executor, - hecoTestnetExecutor: Web3Executor -) : DefaultCrossChain() { - constructor(ethRinkebyUrl: String, hecoTestnetUrl: String) : - this(Web3(ethRinkebyUrl), Web3(hecoTestnetUrl)) - - override val fromNetwork = EthRinkeby(ethRinkebyExecutor) - override val toNetwork = HecoTestnet(hecoTestnetExecutor) - override val stablePool: NerveStablePool = StablePools.HUOBI_HUSD_sUSDC_POOL(toNetwork, fromNetwork) -} diff --git a/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/HecoTestnetEthRinkeby.kt b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/HecoTestnetEthRinkeby.kt deleted file mode 100644 index cb47b53..0000000 --- a/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/HecoTestnetEthRinkeby.kt +++ /dev/null @@ -1,19 +0,0 @@ -package com.symbiosis.sdk.crosschain - -import com.symbiosis.sdk.networks.EthRinkeby -import com.symbiosis.sdk.networks.HecoTestnet -import com.symbiosis.sdk.swap.meta.NerveStablePool -import dev.icerock.moko.web3.Web3 -import dev.icerock.moko.web3.Web3Executor - -class HecoTestnetEthRinkeby( - hecoTestnetExecutor: Web3Executor, - ethRinkebyExecutor: Web3Executor -) : DefaultCrossChain() { - constructor(hecoTestnetUrl: String, ethRinkebyUrl: String) : - this(Web3(hecoTestnetUrl), Web3(ethRinkebyUrl)) - - override val fromNetwork = HecoTestnet(hecoTestnetExecutor) - override val toNetwork = EthRinkeby(ethRinkebyExecutor) - override val stablePool: NerveStablePool = StablePools.HUOBI_HUSD_sUSDC_POOL(fromNetwork, toNetwork) -} diff --git a/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/StablePools.kt b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/StablePools.kt index 68af813..2240b50 100644 --- a/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/StablePools.kt +++ b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/StablePools.kt @@ -1,54 +1,116 @@ +@file:Suppress("FunctionName") + package com.symbiosis.sdk.crosschain -import com.symbiosis.sdk.networks.AvalancheFuji -import com.symbiosis.sdk.networks.BscTestnet -import com.symbiosis.sdk.networks.EthRinkeby -import com.symbiosis.sdk.networks.HecoTestnet -import com.symbiosis.sdk.networks.PolygonMumbai +import com.symbiosis.sdk.networks.* import com.symbiosis.sdk.swap.meta.NerveStablePool import dev.icerock.moko.web3.ContractAddress object StablePools { - fun BUSD_sUSDC_POOL(bscTestnet: BscTestnet, ethRinkeby: EthRinkeby) = NerveStablePool( - address = ContractAddress(value = "0x1c07E3Ef949C197576e4875798211Ef1d9AD4c4A"), - fromToken = bscTestnet.token.BUSD, - targetToken = ethRinkeby.token.USDC - ) - - // fixme: there is an old address - // MUMBAI USDT -> sUSDC - fun MUMBAI_USDT_sUSDC_POOL(polygonMumbai: PolygonMumbai, ethRinkeby: EthRinkeby) = NerveStablePool( - address = ContractAddress(value = "0xEBfcF756A87C352195eA326Cd20afbc79aBecc9E"), - fromToken = polygonMumbai.token.USDT, - targetToken = ethRinkeby.token.USDC - ) - - // fixme: there is an old address - // MUMBAI USDT -> sBUSD - fun MUMBAI_USDT_sBUSD_POOL(polygonMumbai: PolygonMumbai, bscTestnet: BscTestnet) = NerveStablePool( - address = ContractAddress(value = "0x919e11b43aAC4EeC39108F9931BAb0551C57E2B6"), - fromToken = polygonMumbai.token.USDT, - targetToken = bscTestnet.token.BUSD - ) + fun BSC_TESTNET_BUSD_ETH_RINKEBY_sUSDC_POOL(bscTestnet: BscTestnet, ethRinkeby: EthRinkeby) = + NerveStablePool( + address = ContractAddress(value = "0x1c07E3Ef949C197576e4875798211Ef1d9AD4c4A"), + fromToken = bscTestnet.token.BUSD, + targetToken = ethRinkeby.token.USDC + ) + + fun POLYGON_MUMBAI_USDT_ETH_RINKEBY_sUSDC_POOL(polygonMumbai: PolygonMumbai, ethRinkeby: EthRinkeby) = + NerveStablePool( + address = ContractAddress(value = "0xEBfcF756A87C352195eA326Cd20afbc79aBecc9E"), + fromToken = polygonMumbai.token.USDT, + targetToken = ethRinkeby.token.USDC + ) + + fun POLYGON_MUMBAI_USDT_BSC_TESTNET_sBUSD_POOL(polygonMumbai: PolygonMumbai, bscTestnet: BscTestnet) = + NerveStablePool( + address = ContractAddress(value = "0x919e11b43aAC4EeC39108F9931BAb0551C57E2B6"), + fromToken = polygonMumbai.token.USDT, + targetToken = bscTestnet.token.BUSD + ) // FUJI USDT -> sUSDC - fun FUJI_USDT_sUSDC_POOL(avalancheFuji: AvalancheFuji, ethRinkeby: EthRinkeby) = NerveStablePool( - address = ContractAddress(value = "0x23f5e7756A46e8744f653da9a476705216eb5FF8"), - fromToken = avalancheFuji.token.USDT, - targetToken = ethRinkeby.token.USDC - ) + fun AVALANCHE_FUJI_USDT_ETH_RINKEBY_sUSDC_POOL(avalancheFuji: AvalancheFuji, ethRinkeby: EthRinkeby) = + NerveStablePool( + address = ContractAddress(value = "0x23f5e7756A46e8744f653da9a476705216eb5FF8"), + fromToken = avalancheFuji.token.USDT, + targetToken = ethRinkeby.token.USDC + ) // FUJI USDT -> sBUSD - fun FUJI_USDT_sBUSD_POOL(avalancheFuji: AvalancheFuji, bscTestnet: BscTestnet) = NerveStablePool( - address = ContractAddress(value = "0x080B2e8E9EE50031D9EbcDEE4Cf920572B038419"), - fromToken = avalancheFuji.token.USDT, - targetToken = bscTestnet.token.BUSD - ) - - // HUOBI USDT -> sUSDC - fun HUOBI_HUSD_sUSDC_POOL(hecoTestnet: HecoTestnet, ethRinkeby: EthRinkeby) = NerveStablePool( - address = ContractAddress(value = "0x881E6e8b362f8eF20488bF7BD87cB8459A2dbCdD"), - fromToken = hecoTestnet.token.HUSD, - targetToken = ethRinkeby.token.USDC - ) + fun AVALANCHE_FUJI_USDT_BSC_TESTNET_sBUSD_POOL(avalancheFuji: AvalancheFuji, bscTestnet: BscTestnet) = + NerveStablePool( + address = ContractAddress(value = "0x080B2e8E9EE50031D9EbcDEE4Cf920572B038419"), + fromToken = avalancheFuji.token.USDT, + targetToken = bscTestnet.token.BUSD + ) + + fun BOBA_RINKEBY_USDC_ETH_RINKEBY_sUSDC_POOL(bobaRinkeby: BobaRinkeby, ethRinkeby: EthRinkeby) = + NerveStablePool( + address = ContractAddress("0xE3b9A85633cBc51eA96637A8606Eed0071f61627"), + fromToken = bobaRinkeby.token.USDC, + targetToken = ethRinkeby.token.USDC + ) + + fun BOBA_RINKEBY_USDC_BSC_TESTNET_sBUSD_POOL(bobaRinkeby: BobaRinkeby, bscTestnet: BscTestnet) = + NerveStablePool( + address = ContractAddress("0x04928B7bC6a946f998aD458016B8dA7280506376"), + fromToken = bobaRinkeby.token.USDC, + targetToken = bscTestnet.token.BUSD + ) + + fun AVALANCHE_MAINNET_USDC_ETH_MAINNET_sUSDC(avalancheMainnet: AvalancheMainnet, ethMainnet: EthMainnet) = + NerveStablePool( + address = ContractAddress("0xab0738320A21741f12797Ee921461C691673E276"), + fromToken = avalancheMainnet.token.USDC, + targetToken = ethMainnet.token.USDC + ) + + fun AVALANCHE_MAINNET_USDC_BSC_MAINNET_sBUSD(avalancheMainnet: AvalancheMainnet, bscMainnet: BscMainnet) = + NerveStablePool( + address = ContractAddress("0xF4BFF06E02cdF55918e0ec98082bDE1DA85d33Db"), + fromToken = avalancheMainnet.token.USDC, + targetToken = bscMainnet.token.BUSD + ) + + fun POLYGON_MAINNET_USDC_ETH_MAINNET_sUSDC(polygonMainnet: PolygonMainnet, ethMainnet: EthMainnet) = + NerveStablePool( + address = ContractAddress("0xab0738320A21741f12797Ee921461C691673E276"), + fromToken = polygonMainnet.token.USDC, + targetToken = ethMainnet.token.USDC + ) + + fun POLYGON_MAINNET_USDC_BSC_MAINNET_sBUSD(polygonMainnet: PolygonMainnet, bscMainnet: BscMainnet) = + NerveStablePool( + address = ContractAddress("0xF4BFF06E02cdF55918e0ec98082bDE1DA85d33Db"), + fromToken = polygonMainnet.token.USDC, + targetToken = bscMainnet.token.BUSD + ) + + fun POLYGON_MAINNET_USDC_AVALANCHE_MAINNET_sUSDC(polygonMainnet: PolygonMainnet, avalancheMainnet: AvalancheMainnet) = + NerveStablePool( + address = ContractAddress("0x3F1bfa6FA3B6D03202538Bf0cdE92BbE551104ac"), + fromToken = polygonMainnet.token.USDC, + targetToken = avalancheMainnet.token.USDC + ) + + fun BSC_MAINNET_BUSD_ETH_MAINNET_sUSDC(bscMainnet: BscMainnet, ethMainnet: EthMainnet) = + NerveStablePool( + address = ContractAddress("0xab0738320A21741f12797Ee921461C691673E276"), + fromToken = bscMainnet.token.BUSD, + targetToken = ethMainnet.token.USDC + ) + + fun BOBA_MAINNET_USDC_ETH_MAINNET_sUSDC(bobaMainnet: BobaMainnet, ethMainnet: EthMainnet) = + NerveStablePool( + address = ContractAddress("0xab0738320A21741f12797Ee921461C691673E276"), + fromToken = bobaMainnet.token.USDC, + targetToken = ethMainnet.token.USDC + ) + + fun BOBA_MAINNET_USDC_BSC_MAINNET_sBUSD(bobaMainnet: BobaMainnet, bscMainnet: BscMainnet) = + NerveStablePool( + address = ContractAddress("0xe0ddd7afC724BD4B320472B5C954c0abF8192344"), + fromToken = bobaMainnet.token.USDC, + targetToken = bscMainnet.token.BUSD + ) } diff --git a/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/mainnet/AvalancheMainnetBscMainnet.kt b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/mainnet/AvalancheMainnetBscMainnet.kt new file mode 100644 index 0000000..fa0b334 --- /dev/null +++ b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/mainnet/AvalancheMainnetBscMainnet.kt @@ -0,0 +1,21 @@ +package com.symbiosis.sdk.crosschain.mainnet + +import com.symbiosis.sdk.crosschain.DefaultCrossChain +import com.symbiosis.sdk.crosschain.StablePools +import com.symbiosis.sdk.networks.AvalancheMainnet +import com.symbiosis.sdk.networks.BscMainnet +import com.symbiosis.sdk.swap.meta.NerveStablePool +import dev.icerock.moko.web3.Web3 +import dev.icerock.moko.web3.Web3Executor + +class AvalancheMainnetBscMainnet( + avalancheMainnetExecutor: Web3Executor, + bscMainnetExecutor: Web3Executor +) : DefaultCrossChain() { + constructor(avalancheMainnetUrl: String, bscMainnetUrl: String) : + this(Web3(avalancheMainnetUrl), Web3(bscMainnetUrl)) + + override val fromNetwork = AvalancheMainnet(avalancheMainnetExecutor) + override val toNetwork = BscMainnet(bscMainnetExecutor) + override val stablePool: NerveStablePool = StablePools.AVALANCHE_MAINNET_USDC_BSC_MAINNET_sBUSD(fromNetwork, toNetwork) +} diff --git a/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/mainnet/AvalancheMainnetEthMainnet.kt b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/mainnet/AvalancheMainnetEthMainnet.kt new file mode 100644 index 0000000..e1f0929 --- /dev/null +++ b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/mainnet/AvalancheMainnetEthMainnet.kt @@ -0,0 +1,20 @@ +package com.symbiosis.sdk.crosschain.mainnet + +import com.symbiosis.sdk.crosschain.DefaultCrossChain +import com.symbiosis.sdk.crosschain.StablePools +import com.symbiosis.sdk.networks.AvalancheMainnet +import com.symbiosis.sdk.networks.EthMainnet +import dev.icerock.moko.web3.Web3 +import dev.icerock.moko.web3.Web3Executor + +class AvalancheMainnetEthMainnet( + avalancheMainnetExecutor: Web3Executor, + ethMainnetExecutor: Web3Executor +) : DefaultCrossChain() { + constructor(avalancheMainnetUrl: String, ethMainnetUrl: String) : + this(Web3(avalancheMainnetUrl), Web3(ethMainnetUrl)) + + override val fromNetwork = AvalancheMainnet(avalancheMainnetExecutor) + override val toNetwork = EthMainnet(ethMainnetExecutor) + override val stablePool = StablePools.AVALANCHE_MAINNET_USDC_ETH_MAINNET_sUSDC(fromNetwork, toNetwork) +} diff --git a/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/mainnet/AvalancheMainnetPolygonMainnet.kt b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/mainnet/AvalancheMainnetPolygonMainnet.kt new file mode 100644 index 0000000..ea68286 --- /dev/null +++ b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/mainnet/AvalancheMainnetPolygonMainnet.kt @@ -0,0 +1,21 @@ +package com.symbiosis.sdk.crosschain.mainnet + +import com.symbiosis.sdk.crosschain.DefaultCrossChain +import com.symbiosis.sdk.crosschain.StablePools +import com.symbiosis.sdk.networks.AvalancheMainnet +import com.symbiosis.sdk.networks.PolygonMainnet +import com.symbiosis.sdk.swap.meta.NerveStablePool +import dev.icerock.moko.web3.Web3 +import dev.icerock.moko.web3.Web3Executor + +class AvalancheMainnetPolygonMainnet( + avalancheMainnetExecutor: Web3Executor, + polygonMainnetExecutor: Web3Executor +) : DefaultCrossChain() { + constructor(avalancheMainnetUrl: String, polygonMainnetUrl: String) : + this(Web3(avalancheMainnetUrl), Web3(polygonMainnetUrl)) + + override val fromNetwork = AvalancheMainnet(avalancheMainnetExecutor) + override val toNetwork = PolygonMainnet(polygonMainnetExecutor) + override val stablePool: NerveStablePool = StablePools.POLYGON_MAINNET_USDC_AVALANCHE_MAINNET_sUSDC(toNetwork, fromNetwork) +} diff --git a/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/mainnet/BobaMainnetBscMainnet.kt b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/mainnet/BobaMainnetBscMainnet.kt new file mode 100644 index 0000000..ae7f495 --- /dev/null +++ b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/mainnet/BobaMainnetBscMainnet.kt @@ -0,0 +1,21 @@ +package com.symbiosis.sdk.crosschain.mainnet + +import com.symbiosis.sdk.crosschain.DefaultCrossChain +import com.symbiosis.sdk.crosschain.StablePools +import com.symbiosis.sdk.networks.BobaMainnet +import com.symbiosis.sdk.networks.BscMainnet +import com.symbiosis.sdk.swap.meta.NerveStablePool +import dev.icerock.moko.web3.Web3 +import dev.icerock.moko.web3.Web3Executor + +class BobaMainnetBscMainnet( + bobaMainnetExecutor: Web3Executor, + bscMainnetExecutor: Web3Executor +) : DefaultCrossChain() { + constructor(bobaMainnetUrl: String, bscMainnetUrl: String) : + this(Web3(bobaMainnetUrl), Web3(bscMainnetUrl)) + + override val fromNetwork = BobaMainnet(bobaMainnetExecutor) + override val toNetwork = BscMainnet(bscMainnetExecutor) + override val stablePool: NerveStablePool = StablePools.BOBA_MAINNET_USDC_BSC_MAINNET_sBUSD(fromNetwork, toNetwork) +} diff --git a/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/mainnet/BobaMainnetEthMainnet.kt b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/mainnet/BobaMainnetEthMainnet.kt new file mode 100644 index 0000000..bceb86f --- /dev/null +++ b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/mainnet/BobaMainnetEthMainnet.kt @@ -0,0 +1,21 @@ +package com.symbiosis.sdk.crosschain.mainnet + +import com.symbiosis.sdk.crosschain.DefaultCrossChain +import com.symbiosis.sdk.crosschain.StablePools +import com.symbiosis.sdk.networks.BobaMainnet +import com.symbiosis.sdk.networks.EthMainnet +import com.symbiosis.sdk.swap.meta.NerveStablePool +import dev.icerock.moko.web3.Web3 +import dev.icerock.moko.web3.Web3Executor + +class BobaMainnetEthMainnet( + bobaMainnetExecutor: Web3Executor, + ethMainnetExecutor: Web3Executor +) : DefaultCrossChain() { + constructor(bobaMainnetUrl: String, ethMainnetUrl: String) : + this(Web3(bobaMainnetUrl), Web3(ethMainnetUrl)) + + override val fromNetwork = BobaMainnet(bobaMainnetExecutor) + override val toNetwork = EthMainnet(ethMainnetExecutor) + override val stablePool: NerveStablePool = StablePools.BOBA_MAINNET_USDC_ETH_MAINNET_sUSDC(fromNetwork, toNetwork) +} diff --git a/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/mainnet/BscMainnetAvalancheMainnet.kt b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/mainnet/BscMainnetAvalancheMainnet.kt new file mode 100644 index 0000000..85c1dbc --- /dev/null +++ b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/mainnet/BscMainnetAvalancheMainnet.kt @@ -0,0 +1,21 @@ +package com.symbiosis.sdk.crosschain.mainnet + +import com.symbiosis.sdk.crosschain.DefaultCrossChain +import com.symbiosis.sdk.crosschain.StablePools +import com.symbiosis.sdk.networks.AvalancheMainnet +import com.symbiosis.sdk.networks.BscMainnet +import com.symbiosis.sdk.swap.meta.NerveStablePool +import dev.icerock.moko.web3.Web3 +import dev.icerock.moko.web3.Web3Executor + +class BscMainnetAvalancheMainnet( + bscMainnetExecutor: Web3Executor, + avalancheMainnetExecutor: Web3Executor +) : DefaultCrossChain() { + constructor(bscMainnetUrl: String, avalancheMainnetUrl: String) : + this(Web3(bscMainnetUrl), Web3(avalancheMainnetUrl)) + + override val fromNetwork = BscMainnet(bscMainnetExecutor) + override val toNetwork = AvalancheMainnet(avalancheMainnetExecutor) + override val stablePool: NerveStablePool = StablePools.AVALANCHE_MAINNET_USDC_BSC_MAINNET_sBUSD(toNetwork, fromNetwork) +} diff --git a/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/mainnet/BscMainnetBobaMainnet.kt b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/mainnet/BscMainnetBobaMainnet.kt new file mode 100644 index 0000000..7056e6e --- /dev/null +++ b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/mainnet/BscMainnetBobaMainnet.kt @@ -0,0 +1,21 @@ +package com.symbiosis.sdk.crosschain.mainnet + +import com.symbiosis.sdk.crosschain.DefaultCrossChain +import com.symbiosis.sdk.crosschain.StablePools +import com.symbiosis.sdk.networks.BobaMainnet +import com.symbiosis.sdk.networks.BscMainnet +import com.symbiosis.sdk.swap.meta.NerveStablePool +import dev.icerock.moko.web3.Web3 +import dev.icerock.moko.web3.Web3Executor + +class BscMainnetBobaMainnet( + bscMainnetExecutor: Web3Executor, + bobaMainnetExecutor: Web3Executor +) : DefaultCrossChain() { + constructor(bscMainnetUrl: String, bobaMainnetUrl: String) : + this(Web3(bscMainnetUrl), Web3(bobaMainnetUrl)) + + override val fromNetwork = BscMainnet(bscMainnetExecutor) + override val toNetwork = BobaMainnet(bobaMainnetExecutor) + override val stablePool: NerveStablePool = StablePools.BOBA_MAINNET_USDC_BSC_MAINNET_sBUSD(toNetwork, fromNetwork) +} diff --git a/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/mainnet/BscMainnetEthMainnet.kt b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/mainnet/BscMainnetEthMainnet.kt new file mode 100644 index 0000000..d7605b0 --- /dev/null +++ b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/mainnet/BscMainnetEthMainnet.kt @@ -0,0 +1,21 @@ +package com.symbiosis.sdk.crosschain.mainnet + +import com.symbiosis.sdk.crosschain.DefaultCrossChain +import com.symbiosis.sdk.crosschain.StablePools +import com.symbiosis.sdk.networks.BscMainnet +import com.symbiosis.sdk.networks.EthMainnet +import com.symbiosis.sdk.swap.meta.NerveStablePool +import dev.icerock.moko.web3.Web3 +import dev.icerock.moko.web3.Web3Executor + +class BscMainnetEthMainnet( + bscMainnetExecutor: Web3Executor, + ethMainnetExecutor: Web3Executor +) : DefaultCrossChain() { + constructor(bscMainnetUrl: String, ethMainnetUrl: String) : + this(Web3(bscMainnetUrl), Web3(ethMainnetUrl)) + + override val fromNetwork = BscMainnet(bscMainnetExecutor) + override val toNetwork = EthMainnet(ethMainnetExecutor) + override val stablePool: NerveStablePool = StablePools.BSC_MAINNET_BUSD_ETH_MAINNET_sUSDC(fromNetwork, toNetwork) +} diff --git a/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/mainnet/BscMainnetPolygonMainnet.kt b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/mainnet/BscMainnetPolygonMainnet.kt new file mode 100644 index 0000000..25564d7 --- /dev/null +++ b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/mainnet/BscMainnetPolygonMainnet.kt @@ -0,0 +1,21 @@ +package com.symbiosis.sdk.crosschain.mainnet + +import com.symbiosis.sdk.crosschain.DefaultCrossChain +import com.symbiosis.sdk.crosschain.StablePools +import com.symbiosis.sdk.networks.BscMainnet +import com.symbiosis.sdk.networks.PolygonMainnet +import com.symbiosis.sdk.swap.meta.NerveStablePool +import dev.icerock.moko.web3.Web3 +import dev.icerock.moko.web3.Web3Executor + +class BscMainnetPolygonMainnet( + bscMainnetExecutor: Web3Executor, + polygonMainnetExecutor: Web3Executor +) : DefaultCrossChain() { + constructor(bscMainnetUrl: String, polygonMainnetUrl: String) : + this(Web3(bscMainnetUrl), Web3(polygonMainnetUrl)) + + override val fromNetwork = BscMainnet(bscMainnetExecutor) + override val toNetwork = PolygonMainnet(polygonMainnetExecutor) + override val stablePool: NerveStablePool = StablePools.POLYGON_MAINNET_USDC_BSC_MAINNET_sBUSD(toNetwork, fromNetwork) +} diff --git a/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/mainnet/EthMainnetAvalancheMainnet.kt b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/mainnet/EthMainnetAvalancheMainnet.kt new file mode 100644 index 0000000..b5f9ddb --- /dev/null +++ b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/mainnet/EthMainnetAvalancheMainnet.kt @@ -0,0 +1,20 @@ +package com.symbiosis.sdk.crosschain.mainnet + +import com.symbiosis.sdk.crosschain.DefaultCrossChain +import com.symbiosis.sdk.crosschain.StablePools +import com.symbiosis.sdk.networks.AvalancheMainnet +import com.symbiosis.sdk.networks.EthMainnet +import dev.icerock.moko.web3.Web3 +import dev.icerock.moko.web3.Web3Executor + +class EthMainnetAvalancheMainnet( + ethMainnetExecutor: Web3Executor, + avalancheMainnetExecutor: Web3Executor +) : DefaultCrossChain() { + constructor(ethMainnetUrl: String, avalancheMainnetUrl: String) : + this(Web3(ethMainnetUrl), Web3(avalancheMainnetUrl)) + + override val fromNetwork = EthMainnet(ethMainnetExecutor) + override val toNetwork = AvalancheMainnet(avalancheMainnetExecutor) + override val stablePool = StablePools.AVALANCHE_MAINNET_USDC_ETH_MAINNET_sUSDC(toNetwork, fromNetwork) +} diff --git a/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/mainnet/EthMainnetBobaMainnet.kt b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/mainnet/EthMainnetBobaMainnet.kt new file mode 100644 index 0000000..8b48464 --- /dev/null +++ b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/mainnet/EthMainnetBobaMainnet.kt @@ -0,0 +1,21 @@ +package com.symbiosis.sdk.crosschain.mainnet + +import com.symbiosis.sdk.crosschain.DefaultCrossChain +import com.symbiosis.sdk.crosschain.StablePools +import com.symbiosis.sdk.networks.BobaMainnet +import com.symbiosis.sdk.networks.EthMainnet +import com.symbiosis.sdk.swap.meta.NerveStablePool +import dev.icerock.moko.web3.Web3 +import dev.icerock.moko.web3.Web3Executor + +class EthMainnetBobaMainnet( + ethMainnetExecutor: Web3Executor, + bobaMainnetExecutor: Web3Executor +) : DefaultCrossChain() { + constructor(ethMainnetUrl: String, bobaMainnetUrl: String) : + this(Web3(ethMainnetUrl), Web3(bobaMainnetUrl)) + + override val fromNetwork = EthMainnet(ethMainnetExecutor) + override val toNetwork = BobaMainnet(bobaMainnetExecutor) + override val stablePool: NerveStablePool = StablePools.BOBA_MAINNET_USDC_ETH_MAINNET_sUSDC(toNetwork, fromNetwork) +} diff --git a/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/mainnet/EthMainnetBscMainnet.kt b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/mainnet/EthMainnetBscMainnet.kt new file mode 100644 index 0000000..4d67fbc --- /dev/null +++ b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/mainnet/EthMainnetBscMainnet.kt @@ -0,0 +1,21 @@ +package com.symbiosis.sdk.crosschain.mainnet + +import com.symbiosis.sdk.crosschain.DefaultCrossChain +import com.symbiosis.sdk.crosschain.StablePools +import com.symbiosis.sdk.networks.BscMainnet +import com.symbiosis.sdk.networks.EthMainnet +import com.symbiosis.sdk.swap.meta.NerveStablePool +import dev.icerock.moko.web3.Web3 +import dev.icerock.moko.web3.Web3Executor + +class EthMainnetBscMainnet( + ethMainnetExecutor: Web3Executor, + bscMainnetExecutor: Web3Executor +) : DefaultCrossChain() { + constructor(ethMainnetUrl: String, bscMainnetUrl: String) : + this(Web3(ethMainnetUrl), Web3(bscMainnetUrl)) + + override val fromNetwork = EthMainnet(ethMainnetExecutor) + override val toNetwork = BscMainnet(bscMainnetExecutor) + override val stablePool: NerveStablePool = StablePools.BSC_MAINNET_BUSD_ETH_MAINNET_sUSDC(toNetwork, fromNetwork) +} diff --git a/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/mainnet/EthMainnetPolygonMainnet.kt b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/mainnet/EthMainnetPolygonMainnet.kt new file mode 100644 index 0000000..50652f0 --- /dev/null +++ b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/mainnet/EthMainnetPolygonMainnet.kt @@ -0,0 +1,21 @@ +package com.symbiosis.sdk.crosschain.mainnet + +import com.symbiosis.sdk.crosschain.DefaultCrossChain +import com.symbiosis.sdk.crosschain.StablePools +import com.symbiosis.sdk.networks.EthMainnet +import com.symbiosis.sdk.networks.PolygonMainnet +import com.symbiosis.sdk.swap.meta.NerveStablePool +import dev.icerock.moko.web3.Web3 +import dev.icerock.moko.web3.Web3Executor + +class EthMainnetPolygonMainnet( + ethMainnetExecutor: Web3Executor, + polygonMainnetExecutor: Web3Executor +) : DefaultCrossChain() { + constructor(ethMainnetUrl: String, polygonMainnetUrl: String) : + this(Web3(ethMainnetUrl), Web3(polygonMainnetUrl)) + + override val fromNetwork = EthMainnet(ethMainnetExecutor) + override val toNetwork = PolygonMainnet(polygonMainnetExecutor) + override val stablePool: NerveStablePool = StablePools.POLYGON_MAINNET_USDC_ETH_MAINNET_sUSDC(toNetwork, fromNetwork) +} diff --git a/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/mainnet/PolygonMainnetAvalancheMainnet.kt b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/mainnet/PolygonMainnetAvalancheMainnet.kt new file mode 100644 index 0000000..412a22c --- /dev/null +++ b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/mainnet/PolygonMainnetAvalancheMainnet.kt @@ -0,0 +1,21 @@ +package com.symbiosis.sdk.crosschain.mainnet + +import com.symbiosis.sdk.crosschain.DefaultCrossChain +import com.symbiosis.sdk.crosschain.StablePools +import com.symbiosis.sdk.networks.AvalancheMainnet +import com.symbiosis.sdk.networks.PolygonMainnet +import com.symbiosis.sdk.swap.meta.NerveStablePool +import dev.icerock.moko.web3.Web3 +import dev.icerock.moko.web3.Web3Executor + +class PolygonMainnetAvalancheMainnet( + polygonMainnetExecutor: Web3Executor, + avalancheMainnetExecutor: Web3Executor +) : DefaultCrossChain() { + constructor(polygonMainnetUrl: String, avalancheMainnetUrl: String) : + this(Web3(polygonMainnetUrl), Web3(avalancheMainnetUrl)) + + override val fromNetwork = PolygonMainnet(polygonMainnetExecutor) + override val toNetwork = AvalancheMainnet(avalancheMainnetExecutor) + override val stablePool: NerveStablePool = StablePools.POLYGON_MAINNET_USDC_AVALANCHE_MAINNET_sUSDC(fromNetwork, toNetwork) +} diff --git a/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/mainnet/PolygonMainnetBscMainnet.kt b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/mainnet/PolygonMainnetBscMainnet.kt new file mode 100644 index 0000000..d9a515f --- /dev/null +++ b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/mainnet/PolygonMainnetBscMainnet.kt @@ -0,0 +1,21 @@ +package com.symbiosis.sdk.crosschain.mainnet + +import com.symbiosis.sdk.crosschain.DefaultCrossChain +import com.symbiosis.sdk.crosschain.StablePools +import com.symbiosis.sdk.networks.BscMainnet +import com.symbiosis.sdk.networks.PolygonMainnet +import com.symbiosis.sdk.swap.meta.NerveStablePool +import dev.icerock.moko.web3.Web3 +import dev.icerock.moko.web3.Web3Executor + +class PolygonMainnetBscMainnet( + polygonMainnetExecutor: Web3Executor, + bscMainnetExecutor: Web3Executor +) : DefaultCrossChain() { + constructor(polygonMainnetUrl: String, bscMainnetUrl: String) : + this(Web3(polygonMainnetUrl), Web3(bscMainnetUrl)) + + override val fromNetwork = PolygonMainnet(polygonMainnetExecutor) + override val toNetwork = BscMainnet(bscMainnetExecutor) + override val stablePool: NerveStablePool = StablePools.POLYGON_MAINNET_USDC_BSC_MAINNET_sBUSD(fromNetwork, toNetwork) +} diff --git a/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/mainnet/PolygonMainnetEthMainnet.kt b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/mainnet/PolygonMainnetEthMainnet.kt new file mode 100644 index 0000000..701ce27 --- /dev/null +++ b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/mainnet/PolygonMainnetEthMainnet.kt @@ -0,0 +1,22 @@ +package com.symbiosis.sdk.crosschain.mainnet + +import com.symbiosis.sdk.crosschain.DefaultCrossChain +import com.symbiosis.sdk.crosschain.StablePools +import com.symbiosis.sdk.networks.EthMainnet +import com.symbiosis.sdk.networks.PolygonMainnet +import com.symbiosis.sdk.swap.meta.NerveStablePool +import dev.icerock.moko.web3.Web3 +import dev.icerock.moko.web3.Web3Executor + +class PolygonMainnetEthMainnet( + polygonMainnetExecutor: Web3Executor, + ethMainnetExecutor: Web3Executor +) : DefaultCrossChain() { + constructor(polygonMainnetUrl: String, ethMainnetUrl: String) : + this(Web3(polygonMainnetUrl), Web3(ethMainnetUrl)) + + override val fromNetwork = PolygonMainnet(polygonMainnetExecutor) + override val toNetwork = EthMainnet(ethMainnetExecutor) + override val stablePool: NerveStablePool = StablePools.POLYGON_MAINNET_USDC_ETH_MAINNET_sUSDC(fromNetwork, toNetwork) +} + diff --git a/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/AvalancheFujiBscTestnet.kt b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/testnet/AvalancheFujiBscTestnet.kt similarity index 68% rename from sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/AvalancheFujiBscTestnet.kt rename to sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/testnet/AvalancheFujiBscTestnet.kt index e286fa2..a992fbe 100644 --- a/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/AvalancheFujiBscTestnet.kt +++ b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/testnet/AvalancheFujiBscTestnet.kt @@ -1,5 +1,7 @@ -package com.symbiosis.sdk.crosschain +package com.symbiosis.sdk.crosschain.testnet +import com.symbiosis.sdk.crosschain.DefaultCrossChain +import com.symbiosis.sdk.crosschain.StablePools import com.symbiosis.sdk.networks.AvalancheFuji import com.symbiosis.sdk.networks.BscTestnet import com.symbiosis.sdk.swap.meta.NerveStablePool @@ -15,5 +17,6 @@ class AvalancheFujiBscTestnet( override val fromNetwork = AvalancheFuji(avalancheFujiExecutor) override val toNetwork = BscTestnet(bscTestnetExecutor) - override val stablePool: NerveStablePool = StablePools.FUJI_USDT_sBUSD_POOL(fromNetwork, toNetwork) + override val stablePool: NerveStablePool = + StablePools.AVALANCHE_FUJI_USDT_BSC_TESTNET_sBUSD_POOL(fromNetwork, toNetwork) } diff --git a/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/AvalancheFujiEthRinkeby.kt b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/testnet/AvalancheFujiEthRinkeby.kt similarity index 68% rename from sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/AvalancheFujiEthRinkeby.kt rename to sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/testnet/AvalancheFujiEthRinkeby.kt index eef4959..97cf106 100644 --- a/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/AvalancheFujiEthRinkeby.kt +++ b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/testnet/AvalancheFujiEthRinkeby.kt @@ -1,5 +1,7 @@ -package com.symbiosis.sdk.crosschain +package com.symbiosis.sdk.crosschain.testnet +import com.symbiosis.sdk.crosschain.DefaultCrossChain +import com.symbiosis.sdk.crosschain.StablePools import com.symbiosis.sdk.networks.AvalancheFuji import com.symbiosis.sdk.networks.EthRinkeby import com.symbiosis.sdk.swap.meta.NerveStablePool @@ -15,5 +17,6 @@ class AvalancheFujiEthRinkeby( override val fromNetwork = AvalancheFuji(avalancheFujiExecutor) override val toNetwork = EthRinkeby(ethRinkebyExecutor) - override val stablePool: NerveStablePool = StablePools.FUJI_USDT_sUSDC_POOL(fromNetwork, toNetwork) + override val stablePool: NerveStablePool = + StablePools.AVALANCHE_FUJI_USDT_ETH_RINKEBY_sUSDC_POOL(fromNetwork, toNetwork) } diff --git a/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/testnet/BobaRinkebyBscTestnet.kt b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/testnet/BobaRinkebyBscTestnet.kt new file mode 100644 index 0000000..42e9b1a --- /dev/null +++ b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/testnet/BobaRinkebyBscTestnet.kt @@ -0,0 +1,22 @@ +package com.symbiosis.sdk.crosschain.testnet + +import com.symbiosis.sdk.crosschain.DefaultCrossChain +import com.symbiosis.sdk.crosschain.StablePools +import com.symbiosis.sdk.networks.BobaRinkeby +import com.symbiosis.sdk.networks.BscTestnet +import com.symbiosis.sdk.swap.meta.NerveStablePool +import dev.icerock.moko.web3.Web3 +import dev.icerock.moko.web3.Web3Executor + +class BobaRinkebyBscTestnet( + bobaRinkebyExecutor: Web3Executor, + bscTestnetExecutor: Web3Executor +) : DefaultCrossChain() { + constructor(bobaRinkebyUrl: String, bscTestnetUrl: String) : + this(Web3(bobaRinkebyUrl), Web3(bscTestnetUrl)) + + override val fromNetwork = BobaRinkeby(bobaRinkebyExecutor) + override val toNetwork = BscTestnet(bscTestnetExecutor) + override val stablePool: NerveStablePool = + StablePools.BOBA_RINKEBY_USDC_BSC_TESTNET_sBUSD_POOL(fromNetwork, toNetwork) +} diff --git a/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/testnet/BobaRinkebyEthRinkeby.kt b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/testnet/BobaRinkebyEthRinkeby.kt new file mode 100644 index 0000000..db8c249 --- /dev/null +++ b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/testnet/BobaRinkebyEthRinkeby.kt @@ -0,0 +1,22 @@ +package com.symbiosis.sdk.crosschain.testnet + +import com.symbiosis.sdk.crosschain.DefaultCrossChain +import com.symbiosis.sdk.crosschain.StablePools +import com.symbiosis.sdk.networks.BobaRinkeby +import com.symbiosis.sdk.networks.EthRinkeby +import com.symbiosis.sdk.swap.meta.NerveStablePool +import dev.icerock.moko.web3.Web3 +import dev.icerock.moko.web3.Web3Executor + +class BobaRinkebyEthRinkeby( + bobaRinkebyExecutor: Web3Executor, + ethRinkebyExecutor: Web3Executor +) : DefaultCrossChain() { + constructor(bobaRinkebyUrl: String, ethRinkebyUrl: String) : + this(Web3(bobaRinkebyUrl), Web3(ethRinkebyUrl)) + + override val fromNetwork = BobaRinkeby(bobaRinkebyExecutor) + override val toNetwork = EthRinkeby(ethRinkebyExecutor) + override val stablePool: NerveStablePool = + StablePools.BOBA_RINKEBY_USDC_ETH_RINKEBY_sUSDC_POOL(fromNetwork, toNetwork) +} diff --git a/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/BscTestnetAvalancheFuji.kt b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/testnet/BscTestnetAvalancheFuji.kt similarity index 68% rename from sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/BscTestnetAvalancheFuji.kt rename to sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/testnet/BscTestnetAvalancheFuji.kt index b64d472..a7a3907 100644 --- a/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/BscTestnetAvalancheFuji.kt +++ b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/testnet/BscTestnetAvalancheFuji.kt @@ -1,5 +1,7 @@ -package com.symbiosis.sdk.crosschain +package com.symbiosis.sdk.crosschain.testnet +import com.symbiosis.sdk.crosschain.DefaultCrossChain +import com.symbiosis.sdk.crosschain.StablePools import com.symbiosis.sdk.networks.AvalancheFuji import com.symbiosis.sdk.networks.BscTestnet import com.symbiosis.sdk.swap.meta.NerveStablePool @@ -15,5 +17,6 @@ class BscTestnetAvalancheFuji( override val fromNetwork = BscTestnet(bscTestnetExecutor) override val toNetwork = AvalancheFuji(avalancheFujiExecutor) - override val stablePool: NerveStablePool = StablePools.FUJI_USDT_sBUSD_POOL(toNetwork, fromNetwork) + override val stablePool: NerveStablePool = + StablePools.AVALANCHE_FUJI_USDT_BSC_TESTNET_sBUSD_POOL(toNetwork, fromNetwork) } diff --git a/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/testnet/BscTestnetBobaRinkeby.kt b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/testnet/BscTestnetBobaRinkeby.kt new file mode 100644 index 0000000..7dcf6ba --- /dev/null +++ b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/testnet/BscTestnetBobaRinkeby.kt @@ -0,0 +1,22 @@ +package com.symbiosis.sdk.crosschain.testnet + +import com.symbiosis.sdk.crosschain.DefaultCrossChain +import com.symbiosis.sdk.crosschain.StablePools +import com.symbiosis.sdk.networks.BobaRinkeby +import com.symbiosis.sdk.networks.BscTestnet +import com.symbiosis.sdk.swap.meta.NerveStablePool +import dev.icerock.moko.web3.Web3 +import dev.icerock.moko.web3.Web3Executor + +class BscTestnetBobaRinkeby( + bscTestnetExecutor: Web3Executor, + bobaRinkebyExecutor: Web3Executor +) : DefaultCrossChain() { + constructor(bscTestnetUrl: String, bobaRinkebyUrl: String) : + this(Web3(bscTestnetUrl), Web3(bobaRinkebyUrl)) + + override val fromNetwork = BscTestnet(bscTestnetExecutor) + override val toNetwork = BobaRinkeby(bobaRinkebyExecutor) + override val stablePool: NerveStablePool = + StablePools.BOBA_RINKEBY_USDC_BSC_TESTNET_sBUSD_POOL(toNetwork, fromNetwork) +} diff --git a/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/BscTestnetEthRinkeby.kt b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/testnet/BscTestnetEthRinkeby.kt similarity index 68% rename from sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/BscTestnetEthRinkeby.kt rename to sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/testnet/BscTestnetEthRinkeby.kt index f9db581..6dc72da 100644 --- a/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/BscTestnetEthRinkeby.kt +++ b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/testnet/BscTestnetEthRinkeby.kt @@ -1,5 +1,7 @@ -package com.symbiosis.sdk.crosschain +package com.symbiosis.sdk.crosschain.testnet +import com.symbiosis.sdk.crosschain.DefaultCrossChain +import com.symbiosis.sdk.crosschain.StablePools import com.symbiosis.sdk.networks.BscTestnet import com.symbiosis.sdk.networks.EthRinkeby import com.symbiosis.sdk.swap.meta.NerveStablePool @@ -15,5 +17,6 @@ class BscTestnetEthRinkeby( override val fromNetwork = BscTestnet(bscTestnetExecutor) override val toNetwork = EthRinkeby(ethRinkebyExecutor) - override val stablePool: NerveStablePool = StablePools.BUSD_sUSDC_POOL(fromNetwork, toNetwork) + override val stablePool: NerveStablePool = + StablePools.BSC_TESTNET_BUSD_ETH_RINKEBY_sUSDC_POOL(fromNetwork, toNetwork) } diff --git a/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/BscTestnetPolygonMumbai.kt b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/testnet/BscTestnetPolygonMumbai.kt similarity index 68% rename from sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/BscTestnetPolygonMumbai.kt rename to sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/testnet/BscTestnetPolygonMumbai.kt index 79e0ca1..06ecf1d 100644 --- a/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/BscTestnetPolygonMumbai.kt +++ b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/testnet/BscTestnetPolygonMumbai.kt @@ -1,5 +1,7 @@ -package com.symbiosis.sdk.crosschain +package com.symbiosis.sdk.crosschain.testnet +import com.symbiosis.sdk.crosschain.DefaultCrossChain +import com.symbiosis.sdk.crosschain.StablePools import com.symbiosis.sdk.networks.BscTestnet import com.symbiosis.sdk.networks.PolygonMumbai import com.symbiosis.sdk.swap.meta.NerveStablePool @@ -15,5 +17,6 @@ class BscTestnetPolygonMumbai( override val fromNetwork = BscTestnet(bscTestnetExecutor) override val toNetwork = PolygonMumbai(polygonMumbaiExecutor) - override val stablePool: NerveStablePool = StablePools.MUMBAI_USDT_sBUSD_POOL(toNetwork, fromNetwork) + override val stablePool: NerveStablePool = + StablePools.POLYGON_MUMBAI_USDT_BSC_TESTNET_sBUSD_POOL(toNetwork, fromNetwork) } diff --git a/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/EthRinkebyAvalancheFuji.kt b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/testnet/EthRinkebyAvalancheFuji.kt similarity index 68% rename from sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/EthRinkebyAvalancheFuji.kt rename to sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/testnet/EthRinkebyAvalancheFuji.kt index de95e71..456ad79 100644 --- a/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/EthRinkebyAvalancheFuji.kt +++ b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/testnet/EthRinkebyAvalancheFuji.kt @@ -1,5 +1,7 @@ -package com.symbiosis.sdk.crosschain +package com.symbiosis.sdk.crosschain.testnet +import com.symbiosis.sdk.crosschain.DefaultCrossChain +import com.symbiosis.sdk.crosschain.StablePools import com.symbiosis.sdk.networks.AvalancheFuji import com.symbiosis.sdk.networks.EthRinkeby import com.symbiosis.sdk.swap.meta.NerveStablePool @@ -15,5 +17,6 @@ class EthRinkebyAvalancheFuji( override val fromNetwork = EthRinkeby(ethRinkebyExecutor) override val toNetwork = AvalancheFuji(avalancheFujiExecutor) - override val stablePool: NerveStablePool = StablePools.FUJI_USDT_sUSDC_POOL(toNetwork, fromNetwork) + override val stablePool: NerveStablePool = + StablePools.AVALANCHE_FUJI_USDT_ETH_RINKEBY_sUSDC_POOL(toNetwork, fromNetwork) } diff --git a/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/testnet/EthRinkebyBobaRinkeby.kt b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/testnet/EthRinkebyBobaRinkeby.kt new file mode 100644 index 0000000..79ba36f --- /dev/null +++ b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/testnet/EthRinkebyBobaRinkeby.kt @@ -0,0 +1,22 @@ +package com.symbiosis.sdk.crosschain.testnet + +import com.symbiosis.sdk.crosschain.DefaultCrossChain +import com.symbiosis.sdk.crosschain.StablePools +import com.symbiosis.sdk.networks.BobaRinkeby +import com.symbiosis.sdk.networks.EthRinkeby +import com.symbiosis.sdk.swap.meta.NerveStablePool +import dev.icerock.moko.web3.Web3 +import dev.icerock.moko.web3.Web3Executor + +class EthRinkebyBobaRinkeby( + ethRinkebyExecutor: Web3Executor, + bobaRinkebyExecutor: Web3Executor +) : DefaultCrossChain() { + constructor(ethRinkebyUrl: String, bobaRinkebyUrl: String) : + this(Web3(ethRinkebyUrl), Web3(bobaRinkebyUrl)) + + override val fromNetwork = EthRinkeby(ethRinkebyExecutor) + override val toNetwork = BobaRinkeby(bobaRinkebyExecutor) + override val stablePool: NerveStablePool = + StablePools.BOBA_RINKEBY_USDC_ETH_RINKEBY_sUSDC_POOL(toNetwork, fromNetwork) +} diff --git a/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/EthRinkebyBscTestnet.kt b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/testnet/EthRinkebyBscTestnet.kt similarity index 68% rename from sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/EthRinkebyBscTestnet.kt rename to sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/testnet/EthRinkebyBscTestnet.kt index 61c7529..7d2c206 100644 --- a/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/EthRinkebyBscTestnet.kt +++ b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/testnet/EthRinkebyBscTestnet.kt @@ -1,5 +1,7 @@ -package com.symbiosis.sdk.crosschain +package com.symbiosis.sdk.crosschain.testnet +import com.symbiosis.sdk.crosschain.DefaultCrossChain +import com.symbiosis.sdk.crosschain.StablePools import com.symbiosis.sdk.networks.BscTestnet import com.symbiosis.sdk.networks.EthRinkeby import com.symbiosis.sdk.swap.meta.NerveStablePool @@ -15,5 +17,6 @@ class EthRinkebyBscTestnet( override val fromNetwork = EthRinkeby(ethRinkebyExecutor) override val toNetwork = BscTestnet(bscTestnetExecutor) - override val stablePool: NerveStablePool = StablePools.BUSD_sUSDC_POOL(toNetwork, fromNetwork) + override val stablePool: NerveStablePool = + StablePools.BSC_TESTNET_BUSD_ETH_RINKEBY_sUSDC_POOL(toNetwork, fromNetwork) } diff --git a/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/EthRinkebyPolygonMumbai.kt b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/testnet/EthRinkebyPolygonMumbai.kt similarity index 68% rename from sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/EthRinkebyPolygonMumbai.kt rename to sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/testnet/EthRinkebyPolygonMumbai.kt index fe91950..235f0cf 100644 --- a/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/EthRinkebyPolygonMumbai.kt +++ b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/testnet/EthRinkebyPolygonMumbai.kt @@ -1,5 +1,7 @@ -package com.symbiosis.sdk.crosschain +package com.symbiosis.sdk.crosschain.testnet +import com.symbiosis.sdk.crosschain.DefaultCrossChain +import com.symbiosis.sdk.crosschain.StablePools import com.symbiosis.sdk.networks.EthRinkeby import com.symbiosis.sdk.networks.PolygonMumbai import com.symbiosis.sdk.swap.meta.NerveStablePool @@ -15,5 +17,6 @@ class EthRinkebyPolygonMumbai( override val fromNetwork = EthRinkeby(ethRinkebyExecutor) override val toNetwork = PolygonMumbai(polygonMumbaiExecutor) - override val stablePool: NerveStablePool = StablePools.MUMBAI_USDT_sUSDC_POOL(toNetwork, fromNetwork) + override val stablePool: NerveStablePool = + StablePools.POLYGON_MUMBAI_USDT_ETH_RINKEBY_sUSDC_POOL(toNetwork, fromNetwork) } diff --git a/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/PolygonMumbaiBscTestnet.kt b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/testnet/PolygonMumbaiBscTestnet.kt similarity index 68% rename from sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/PolygonMumbaiBscTestnet.kt rename to sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/testnet/PolygonMumbaiBscTestnet.kt index 7db6c89..e46161d 100644 --- a/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/PolygonMumbaiBscTestnet.kt +++ b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/testnet/PolygonMumbaiBscTestnet.kt @@ -1,5 +1,7 @@ -package com.symbiosis.sdk.crosschain +package com.symbiosis.sdk.crosschain.testnet +import com.symbiosis.sdk.crosschain.DefaultCrossChain +import com.symbiosis.sdk.crosschain.StablePools import com.symbiosis.sdk.networks.BscTestnet import com.symbiosis.sdk.networks.PolygonMumbai import com.symbiosis.sdk.swap.meta.NerveStablePool @@ -15,5 +17,6 @@ class PolygonMumbaiBscTestnet( override val fromNetwork = PolygonMumbai(polygonMumbaiExecutor) override val toNetwork = BscTestnet(bscTestnetExecutor) - override val stablePool: NerveStablePool = StablePools.MUMBAI_USDT_sBUSD_POOL(fromNetwork, toNetwork) + override val stablePool: NerveStablePool = + StablePools.POLYGON_MUMBAI_USDT_BSC_TESTNET_sBUSD_POOL(fromNetwork, toNetwork) } diff --git a/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/PolygonMumbaiEthRinkeby.kt b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/testnet/PolygonMumbaiEthRinkeby.kt similarity index 68% rename from sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/PolygonMumbaiEthRinkeby.kt rename to sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/testnet/PolygonMumbaiEthRinkeby.kt index d37b77b..8eee001 100644 --- a/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/PolygonMumbaiEthRinkeby.kt +++ b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/crosschain/testnet/PolygonMumbaiEthRinkeby.kt @@ -1,5 +1,7 @@ -package com.symbiosis.sdk.crosschain +package com.symbiosis.sdk.crosschain.testnet +import com.symbiosis.sdk.crosschain.DefaultCrossChain +import com.symbiosis.sdk.crosschain.StablePools import com.symbiosis.sdk.networks.EthRinkeby import com.symbiosis.sdk.networks.PolygonMumbai import com.symbiosis.sdk.swap.meta.NerveStablePool @@ -15,5 +17,6 @@ class PolygonMumbaiEthRinkeby( override val fromNetwork = PolygonMumbai(polygonMumbaiExecutor) override val toNetwork = EthRinkeby(ethRinkebyExecutor) - override val stablePool: NerveStablePool = StablePools.MUMBAI_USDT_sUSDC_POOL(fromNetwork, toNetwork) + override val stablePool: NerveStablePool = + StablePools.POLYGON_MUMBAI_USDT_ETH_RINKEBY_sUSDC_POOL(fromNetwork, toNetwork) } diff --git a/sdk/src/commonMain/kotlin/com/symbiosis/sdk/networks/AvalancheFuji.kt b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/networks/AvalancheFuji.kt index 3d46259..80ba17b 100644 --- a/sdk/src/commonMain/kotlin/com/symbiosis/sdk/networks/AvalancheFuji.kt +++ b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/networks/AvalancheFuji.kt @@ -24,35 +24,33 @@ open class AvalancheFuji(override val executor: Web3Executor) : DefaultNetwork() override val bridgeAddressString = "0xc9Fd2AF244FEfb31A62A5A33B9D6261Cec2cb7aA" override val routerAddressString = "0x4F86a87985a2eD1E843c0b93755Ac06A3DbCc55E" override val metaRouterAddressString = "0x9666642b7B68281F912A0b4bee1d00b15ce7B28a" + override val metaRouterGatewayAddressString = "0xef4694BD32884A565D50c476B0D78F06dEBcFE27" val token = Tokens() override val tokens: List = listOf(token.AWAX, token.WAWAX, token.USDT) override val nativeCurrency: DecimalsNativeToken = token.AWAX - override val swapBases: List = listOf(token.WAWAX) + override val swapBases: List = listOf(token.WAWAX, token.USDT) override val dexEndpoints: List = listOf( DexEndpoint.hardcoded( factoryContractAddress = "0xb278D63e2E2a4aeb5A398eB87a91FF909B72C8D5", initCodeHash = "0x85f8ad645fe62917d6939782650649d3d7c4b5f25d81415a9fac4a9f341793ca", - liquidityProviderFee = 0.002 + liquidityProviderFee = 0.003 ) ) - inner class Tokens internal constructor(){ - val WAWAX = DecimalsErc20Token( - network = this@AvalancheFuji, - tokenAddress = "0xd00ae08403B9bbb9124bB305C09058E32C39A48c", - decimals = 18 - ) + inner class Tokens internal constructor() { val USDT = DecimalsErc20Token( network = this@AvalancheFuji, tokenAddress = "0x9a01bf917477dd9f5d715d188618fc8b7350cd22", decimals = 6 ) - val AWAX = DecimalsNativeToken( + val WAWAX = DecimalsErc20Token( network = this@AvalancheFuji, - wrapped = WAWAX + tokenAddress = "0xd00ae08403B9bbb9124bB305C09058E32C39A48c", + decimals = 18 ) + val AWAX = DecimalsNativeToken(WAWAX) private fun DecimalsErc20Token(network: Network, tokenAddress: String, decimals: Int) = DecimalsErc20Token(network, ContractAddress(tokenAddress), decimals) diff --git a/sdk/src/commonMain/kotlin/com/symbiosis/sdk/networks/AvalancheMainnet.kt b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/networks/AvalancheMainnet.kt new file mode 100644 index 0000000..5ef9315 --- /dev/null +++ b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/networks/AvalancheMainnet.kt @@ -0,0 +1,57 @@ +package com.symbiosis.sdk.networks + +import com.symbiosis.sdk.currency.DecimalsErc20Token +import com.symbiosis.sdk.currency.DecimalsNativeToken +import com.symbiosis.sdk.currency.Erc20Token +import com.symbiosis.sdk.currency.Token +import com.symbiosis.sdk.dex.DexEndpoint +import com.symbiosis.sdk.network.Network +import dev.icerock.moko.web3.ContractAddress +import dev.icerock.moko.web3.Web3 +import dev.icerock.moko.web3.Web3Executor + +class AvalancheMainnet(override val executor: Web3Executor) : DefaultNetwork() { + constructor(endpointUrl: String) : this(Web3(endpointUrl)) + + override val networkName: String = "AvalancheMainnet" + + override val chainIdInt = 0xA86A + override val synthFabricAddressString = "0x947a0d452b40013190295a4151A090E1638Fb848" + override val portalAddressString = "0xD7F9989bE0d15319d13d6FA5d468211C89F0b147" + override val synthesizeAddressString = "0xb80fDAA74dDA763a8A158ba85798d373A5E84d84" + override val bridgeAddressString = "0xd5F0f8dB993D26F5df89E70a83d32b369DcCdaa0" + override val routerAddressString = "0xE54Ca86531e17Ef3616d22Ca28b0D458b6C89106" + override val metaRouterAddressString = "0x49d3Fc00f3ACf80FABCb42D7681667B20F60889A" + override val metaRouterGatewayAddressString = "0x8A3B5FD29E7172D13B71c3a939B8901e8400b78F" + + val token = Tokens() + override val tokens: List = listOf(token.AVAX, token.WAVAX, token.USDC) + + override val nativeCurrency = token.AVAX + override val swapBases: List = listOf(token.USDC, token.WAVAX) + + override val dexEndpoints: List = listOf( + DexEndpoint.hardcoded( + factoryContractAddress = "0xefa94DE7a4656D787667C749f7E1223D71E9FD88", + initCodeHash = "0x40231f6b438bce0797c9ada29b718a87ea0a5cea3fe9a771abdd76bd41a3e545", + liquidityProviderFee = 0.003 + ) + ) + + inner class Tokens internal constructor() { + val USDC = DecimalsErc20Token( + network = this@AvalancheMainnet, + tokenAddress = "0xA7D7079b0FEaD91F3e65f86E8915Cb59c1a4C664", + decimals = 6 + ) + val WAVAX = DecimalsErc20Token( + network = this@AvalancheMainnet, + tokenAddress = "0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7", + decimals = 18 + ) + val AVAX = DecimalsNativeToken(WAVAX) + + private fun DecimalsErc20Token(network: Network, tokenAddress: String, decimals: Int) = + DecimalsErc20Token(network, ContractAddress(tokenAddress), decimals) + } +} diff --git a/sdk/src/commonMain/kotlin/com/symbiosis/sdk/networks/BobaMainnet.kt b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/networks/BobaMainnet.kt new file mode 100644 index 0000000..93ca7bf --- /dev/null +++ b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/networks/BobaMainnet.kt @@ -0,0 +1,57 @@ +package com.symbiosis.sdk.networks + +import com.symbiosis.sdk.currency.DecimalsErc20Token +import com.symbiosis.sdk.currency.DecimalsNativeToken +import com.symbiosis.sdk.currency.Erc20Token +import com.symbiosis.sdk.currency.Token +import com.symbiosis.sdk.dex.DexEndpoint +import com.symbiosis.sdk.network.Network +import dev.icerock.moko.web3.ContractAddress +import dev.icerock.moko.web3.Web3 +import dev.icerock.moko.web3.Web3Executor +import com.symbiosis.sdk.dex.DexEndpoint.Companion.hardcoded as DexEndpoint + +open class BobaMainnet(override val executor: Web3Executor) : DefaultNetwork() { + constructor(endpointUrl: String) : this(Web3(endpointUrl)) + + override val networkName: String = "BobaMainnet-EthLayerV2" + + override val chainIdInt: Int = 0x120 + override val synthFabricAddressString = "0x947a0d452b40013190295a4151A090E1638Fb848" + override val portalAddressString = "0xD7F9989bE0d15319d13d6FA5d468211C89F0b147" + override val synthesizeAddressString = "0xb80fDAA74dDA763a8A158ba85798d373A5E84d84" + override val bridgeAddressString = "0xd5F0f8dB993D26F5df89E70a83d32b369DcCdaa0" + override val routerAddressString = "0x17C83E2B96ACfb5190d63F5E46d93c107eC0b514" + override val metaRouterAddressString = "0xc2299c4a45b7e44fFC23e6ba7aAC4AeFF0DDbccC" + override val metaRouterGatewayAddressString = "0xcB9ec7Bfa69c400F97fD667Bf3D8C61359cf50c2" + + val token = Tokens() + override val tokens: List = listOf(token.USDC, token.ETH, token.WETH) + + override val nativeCurrency: DecimalsNativeToken = token.ETH + override val swapBases: List = listOf(token.WETH, token.USDC) + override val dexEndpoints: List = listOf( + DexEndpoint( + factoryContractAddress = "0x7DDaF116889D655D1c486bEB95017a8211265d29", + initCodeHash = "0x1db9efb13a1398e31bb71895c392fa1217130f78dc65080174491adcec5da9b9", + liquidityProviderFee = 0.003 + ) + ) + + inner class Tokens internal constructor() { + val USDC = DecimalsErc20Token( + network = this@BobaMainnet, + tokenAddress = "0x66a2A913e447d6b4BF33EFbec43aAeF87890FBbc", + decimals = 6 + ) + val WETH = DecimalsErc20Token( + network = this@BobaMainnet, + tokenAddress = "0xDeadDeAddeAddEAddeadDEaDDEAdDeaDDeAD0000", + decimals = 18 + ) + val ETH = DecimalsNativeToken(WETH) + + private fun DecimalsErc20Token(network: Network, tokenAddress: String, decimals: Int) = + DecimalsErc20Token(network, ContractAddress(tokenAddress), decimals) + } +} \ No newline at end of file diff --git a/sdk/src/commonMain/kotlin/com/symbiosis/sdk/networks/BobaRinkeby.kt b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/networks/BobaRinkeby.kt new file mode 100644 index 0000000..0e2a129 --- /dev/null +++ b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/networks/BobaRinkeby.kt @@ -0,0 +1,57 @@ +package com.symbiosis.sdk.networks + +import com.symbiosis.sdk.currency.DecimalsErc20Token +import com.symbiosis.sdk.currency.DecimalsNativeToken +import com.symbiosis.sdk.currency.Erc20Token +import com.symbiosis.sdk.currency.Token +import com.symbiosis.sdk.dex.DexEndpoint +import com.symbiosis.sdk.network.Network +import dev.icerock.moko.web3.ContractAddress +import dev.icerock.moko.web3.Web3 +import dev.icerock.moko.web3.Web3Executor +import com.symbiosis.sdk.dex.DexEndpoint.Companion.hardcoded as DexEndpoint + +open class BobaRinkeby(override val executor: Web3Executor) : DefaultNetwork() { + constructor(endpointUrl: String) : this(Web3(endpointUrl)) + + override val networkName = "BobaRinkeby-EthRinkebyLayerV2" + + override val chainIdInt = 0x1C + override val synthFabricAddressString = "0x042cF6a0690C9B8607c5B19Cb18807F1D66c9339" + override val portalAddressString = "0x97A5B271421b443b3F53F3DF485B2716Db85fA4b" + override val synthesizeAddressString = "0x97E82de1102C8Bd7687FFce4C51303D985fcc26e" + override val bridgeAddressString = "0x9F7804105549F31098dCa61A22Bcb0671B78224C" + override val routerAddressString = "0x4df04E20cCd9a8B82634754fcB041e86c5FF085A" + override val metaRouterAddressString = "0x12a957e285c9D678E72CB529510008D9f1daf3d3" + override val metaRouterGatewayAddressString = "0xA7Cf8A05F87D3654DeC089cD9542a6d28a3BC149" + + val token = Tokens() + + override val tokens: List = listOf(token.ETH, token.WETH, token.USDC) + override val nativeCurrency: DecimalsNativeToken = token.ETH + override val swapBases: List = listOf(token.USDC, token.WETH) + override val dexEndpoints: List = listOf( + DexEndpoint( + factoryContractAddress = "0xab740666e226cb5b6b451eb943b0257a7cb3ce0a", + initCodeHash = "0x1db9efb13a1398e31bb71895c392fa1217130f78dc65080174491adcec5da9b9", + liquidityProviderFee = 0.003 + ) + ) + + inner class Tokens internal constructor() { + val USDC = DecimalsErc20Token( + network = this@BobaRinkeby, + tokenAddress = "0xB24898De59C8E259F9742bCF2C16Fd613DCeA8F7", + decimals = 6 + ) + val WETH = DecimalsErc20Token( + network = this@BobaRinkeby, + tokenAddress = "0xDeadDeAddeAddEAddeadDEaDDEAdDeaDDeAD0000", + decimals = 18 + ) + val ETH = DecimalsNativeToken(WETH) + + private fun DecimalsErc20Token(network: Network, tokenAddress: String, decimals: Int) = + DecimalsErc20Token(network, ContractAddress(tokenAddress), decimals) + } +} diff --git a/sdk/src/commonMain/kotlin/com/symbiosis/sdk/networks/BscMainnet.kt b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/networks/BscMainnet.kt new file mode 100644 index 0000000..81a2307 --- /dev/null +++ b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/networks/BscMainnet.kt @@ -0,0 +1,61 @@ +package com.symbiosis.sdk.networks + +import com.symbiosis.sdk.currency.DecimalsErc20Token +import com.symbiosis.sdk.currency.DecimalsNativeToken +import com.symbiosis.sdk.currency.Erc20Token +import com.symbiosis.sdk.currency.Token +import com.symbiosis.sdk.dex.DexEndpoint +import com.symbiosis.sdk.network.Network +import dev.icerock.moko.web3.ContractAddress +import dev.icerock.moko.web3.Web3 +import dev.icerock.moko.web3.Web3Executor + +class BscMainnet(override val executor: Web3Executor) : DefaultNetwork() { + constructor(endpointUrl: String) : this(Web3(endpointUrl)) + + override val networkName = "BscMainnet" + + override val chainIdInt = 0x36 + override val synthFabricAddressString = "0x947a0d452b40013190295a4151A090E1638Fb848" + override val portalAddressString = "0xD7F9989bE0d15319d13d6FA5d468211C89F0b147" + override val synthesizeAddressString = "0xb80fDAA74dDA763a8A158ba85798d373A5E84d84" + override val bridgeAddressString = "0xd5F0f8dB993D26F5df89E70a83d32b369DcCdaa0" + override val routerAddressString = "0x10ED43C718714eb63d5aA57B78B54704E256024E" + override val metaRouterAddressString = "0x8fF99ec3175Edce6b1b809765EDeDECD7e54637e" + override val metaRouterGatewayAddressString = "0x6326bce6f1Bed3fE9cBd64081C786122a4c4286E" + + val token = Tokens() + override val tokens: List = listOf(token.BNB, token.WBNB, token.BUSD, token.CAKE) + + override val nativeCurrency = token.BNB + override val swapBases: List = listOf(token.WBNB, token.CAKE, token.BUSD) + override val dexEndpoints: List = listOf( + DexEndpoint.hardcoded( + factoryContractAddress = "0xBCfCcbde45cE874adCB698cC183deBcF17952812", + initCodeHash = "0xd0d4c4cd0848c93cb4fd1f498d7013ee6bfb25783ea21593d5834f5d250ece66", + liquidityProviderFee = 0.002 + ) + ) + + inner class Tokens internal constructor() { + val CAKE = DecimalsErc20Token( + network = this@BscMainnet, + tokenAddress = "0x0e09fabb73bd3ade0a17ecc321fd13a19e81ce82", + decimals = 18 + ) + val BUSD = DecimalsErc20Token( + network = this@BscMainnet, + tokenAddress = "0x4fabb145d64652a948d72533023f6e7a623c7c53", + decimals = 18 + ) + val WBNB = DecimalsErc20Token( + network = this@BscMainnet, + tokenAddress = "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c", + decimals = 18 + ) + val BNB = DecimalsNativeToken(WBNB) + + private fun DecimalsErc20Token(network: Network, tokenAddress: String, decimals: Int) = + DecimalsErc20Token(network, ContractAddress(tokenAddress), decimals) + } +} \ No newline at end of file diff --git a/sdk/src/commonMain/kotlin/com/symbiosis/sdk/networks/BscTestnet.kt b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/networks/BscTestnet.kt index 19e07a0..ca0e115 100644 --- a/sdk/src/commonMain/kotlin/com/symbiosis/sdk/networks/BscTestnet.kt +++ b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/networks/BscTestnet.kt @@ -24,12 +24,13 @@ class BscTestnet(override val executor: Web3Executor) : DefaultNetwork() { override val bridgeAddressString = "0xBA7c80bb5d316c4eE55F96F47d1a1477fFD1aFb6" override val routerAddressString = "0xD99D1c33F9fC3444f8101754aBC46c52416550D1" override val metaRouterAddressString = "0x51bCcf889989af8afd98C9e386C935A3C0Ff43f0" + override val metaRouterGatewayAddressString = "0xE9EF3E03cd8E4641B867F8A58d4311da8dAd49c8" val token = Tokens() override val tokens: List = listOf(token.BNB, token.WBNB, token.BUSD, token.CAKE) - override val nativeCurrency: DecimalsNativeToken get() = token.BNB - override val swapBases: List = listOf(token.WBNB) + override val nativeCurrency = token.BNB + override val swapBases: List = listOf(token.WBNB, token.CAKE, token.BUSD) override val dexEndpoints: List = listOf( // Pancake DexEndpoint.hardcoded( @@ -39,7 +40,7 @@ class BscTestnet(override val executor: Web3Executor) : DefaultNetwork() { ) ) - inner class Tokens internal constructor(){ + inner class Tokens internal constructor() { val CAKE = DecimalsErc20Token( network = this@BscTestnet, tokenAddress = "0x41b5984f45afb2560a0ed72bb69a98e8b32b3cca", @@ -55,10 +56,7 @@ class BscTestnet(override val executor: Web3Executor) : DefaultNetwork() { tokenAddress = "0xae13d989dac2f0debff460ac112a837c89baa7cd", decimals = 18 ) - val BNB = DecimalsNativeToken( - network = this@BscTestnet, - wrapped = WBNB - ) + val BNB = DecimalsNativeToken(WBNB) private fun DecimalsErc20Token(network: Network, tokenAddress: String, decimals: Int) = DecimalsErc20Token(network, ContractAddress(tokenAddress), decimals) diff --git a/sdk/src/commonMain/kotlin/com/symbiosis/sdk/networks/DefaultNetwork.kt b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/networks/DefaultNetwork.kt index 6e9a15a..634d1e2 100644 --- a/sdk/src/commonMain/kotlin/com/symbiosis/sdk/networks/DefaultNetwork.kt +++ b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/networks/DefaultNetwork.kt @@ -35,6 +35,8 @@ abstract class DefaultNetwork : Network { final override val routerAddress: ContractAddress get() = ContractAddress(routerAddressString) abstract val metaRouterAddressString: String override val metaRouterAddress: ContractAddress get() = ContractAddress(metaRouterAddressString) + abstract val metaRouterGatewayAddressString: String + final override val metaRouterGatewayAddress: ContractAddress get() = ContractAddress(metaRouterGatewayAddressString) override val nonceController: NonceController by lazy { NonceController(executor) diff --git a/sdk/src/commonMain/kotlin/com/symbiosis/sdk/networks/EthMainnet.kt b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/networks/EthMainnet.kt new file mode 100644 index 0000000..fa7b3e2 --- /dev/null +++ b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/networks/EthMainnet.kt @@ -0,0 +1,60 @@ +package com.symbiosis.sdk.networks + +import com.symbiosis.sdk.currency.DecimalsErc20Token +import com.symbiosis.sdk.currency.DecimalsNativeToken +import com.symbiosis.sdk.currency.Token +import com.symbiosis.sdk.dex.DexEndpoint +import com.symbiosis.sdk.network.Network +import dev.icerock.moko.web3.ContractAddress +import dev.icerock.moko.web3.Web3 +import dev.icerock.moko.web3.Web3Executor + +class EthMainnet(override val executor: Web3Executor) : DefaultNetwork() { + constructor(endpointUrl: String) : this(Web3(endpointUrl)) + + override val networkName = "EthMainnet" + + override val chainIdInt = 0x1 + override val synthFabricAddressString = "0x0000000000000000000000000000000000000000" + override val portalAddressString = "0xb80fDAA74dDA763a8A158ba85798d373A5E84d84" + override val synthesizeAddressString = "0x0000000000000000000000000000000000000000" + override val bridgeAddressString = "0xd5F0f8dB993D26F5df89E70a83d32b369DcCdaa0" + override val routerAddressString = "0xb80fDAA74dDA763a8A158ba85798d373A5E84d84" + override val metaRouterAddressString = "0x92C5b5B66988E6B8931a8CD3faa418b42003DF2F" + override val metaRouterGatewayAddressString = "0x23bcd8398A2BC9aa8d606E47D5Ae0d2f014bEA2e" + + val token = Tokens() + override val tokens: List = listOf(token.ETH, token.WETH, token.USDC, token.UNI) + + override val nativeCurrency = token.ETH + override val swapBases = listOf(token.WETH, token.UNI, token.USDC) + override val dexEndpoints = listOf( + DexEndpoint.hardcoded( + factoryContractAddress = "0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f", + initCodeHash = "0x96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f", + liquidityProviderFee = 0.003 + ) + ) + + inner class Tokens internal constructor() { + val UNI = DecimalsErc20Token( + network = this@EthMainnet, + tokenAddress = "0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984", + decimals = 18 + ) + val USDC = DecimalsErc20Token( + network = this@EthMainnet, + tokenAddress = "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", + decimals = 6 + ) + val WETH = DecimalsErc20Token( + network = this@EthMainnet, + tokenAddress = "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", + decimals = 18 + ) + val ETH = DecimalsNativeToken(WETH) + + private fun DecimalsErc20Token(network: Network, tokenAddress: String, decimals: Int) = + DecimalsErc20Token(network, ContractAddress(tokenAddress), decimals) + } +} diff --git a/sdk/src/commonMain/kotlin/com/symbiosis/sdk/networks/EthRinkeby.kt b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/networks/EthRinkeby.kt index 9c5e371..5d39dc1 100644 --- a/sdk/src/commonMain/kotlin/com/symbiosis/sdk/networks/EthRinkeby.kt +++ b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/networks/EthRinkeby.kt @@ -4,7 +4,6 @@ package com.symbiosis.sdk.networks import com.symbiosis.sdk.currency.DecimalsErc20Token import com.symbiosis.sdk.currency.DecimalsNativeToken -import com.symbiosis.sdk.currency.Erc20Token import com.symbiosis.sdk.currency.Token import com.symbiosis.sdk.dex.DexEndpoint import com.symbiosis.sdk.network.Network @@ -24,13 +23,14 @@ open class EthRinkeby(override val executor: Web3Executor) : DefaultNetwork() { override val bridgeAddressString = "0x09256eCAdb6ca96D1d7Fd96280cfA38D5F4E0c4C" override val routerAddressString = "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D" override val metaRouterAddressString = "0xaEF8DEfDBca28A3dADb510fc861aa105e51160Eb" + override val metaRouterGatewayAddressString = "0x94358460e21C69599B7a207885f91443B3794C7b" val token = Tokens() override val tokens: List = listOf(token.ETH, token.WETH, token.USDC, token.UNI) - override val nativeCurrency: DecimalsNativeToken = token.ETH - override val swapBases: List = listOf(token.WETH) - override val dexEndpoints: List = listOf( + override val nativeCurrency = token.ETH + override val swapBases = listOf(token.WETH) + override val dexEndpoints = listOf( // UNI DexEndpoint.hardcoded( factoryContractAddress = "0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f", @@ -55,10 +55,7 @@ open class EthRinkeby(override val executor: Web3Executor) : DefaultNetwork() { tokenAddress = "0xc778417e063141139fce010982780140aa0cd5ab", decimals = 18 ) - val ETH = DecimalsNativeToken( - network = this@EthRinkeby, - wrapped = WETH - ) + val ETH = DecimalsNativeToken(WETH) private fun DecimalsErc20Token(network: Network, tokenAddress: String, decimals: Int) = DecimalsErc20Token(network, ContractAddress(tokenAddress), decimals) diff --git a/sdk/src/commonMain/kotlin/com/symbiosis/sdk/networks/HecoTestnet.kt b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/networks/HecoTestnet.kt deleted file mode 100644 index 9e1cc7b..0000000 --- a/sdk/src/commonMain/kotlin/com/symbiosis/sdk/networks/HecoTestnet.kt +++ /dev/null @@ -1,58 +0,0 @@ -package com.symbiosis.sdk.networks - -import com.symbiosis.sdk.currency.DecimalsErc20Token -import com.symbiosis.sdk.currency.DecimalsNativeToken -import com.symbiosis.sdk.currency.Erc20Token -import com.symbiosis.sdk.currency.Token -import com.symbiosis.sdk.dex.DexEndpoint -import com.symbiosis.sdk.network.Network -import dev.icerock.moko.web3.ContractAddress -import dev.icerock.moko.web3.Web3 -import dev.icerock.moko.web3.Web3Executor - -open class HecoTestnet(override val executor: Web3Executor) : DefaultNetwork() { - constructor(endpointUrl: String = "https://http-testnet.hecochain.com") : this(Web3(endpointUrl)) - - override val networkName: String = "HecoTestnet" - - override val chainIdInt = 0x100 - override val synthFabricAddressString = "0xd655C2c9D558Bf8E3382f98eDADb84e866665139" - override val portalAddressString = "0x5302358dCFbF2881e5b5E537316786d8Ea242008" - override val synthesizeAddressString = "0x3A54a6Ab296726691c06e325eEAa1F123c469531" - override val bridgeAddressString = "0xcC9DBA9AF9ce104e150654B21436584b8e74b236" - override val routerAddressString = "0x30a84231DC64848969da4aF755864382923a40f0" - override val metaRouterAddressString = "0x81d80bEcFD9a6A64bB0602d79E8Bd45844083626" - - val token = Tokens() - override val tokens: List = listOf(token.HT, token.WHT, token.HUSD) - - override val nativeCurrency: DecimalsNativeToken get() = token.HT - override val swapBases: List = listOf(token.WHT) - override val dexEndpoints: List = listOf( - DexEndpoint.hardcoded( - factoryContractAddress = "0xca33f6D096BDD7FcB28d708f631cD76E73Ecfc2d", - initCodeHash = "0x85f8ad645fe62917d6939782650649d3d7c4b5f25d81415a9fac4a9f341793ca", - liquidityProviderFee = 0.002 - ) - ) - - inner class Tokens internal constructor() { - val WHT = DecimalsErc20Token( - network = this@HecoTestnet, - tokenAddress = "0x7aF326B6351C8A9b8fb8CD205CBe11d4Ac5FA836", - decimals = 18 - ) - val HUSD = DecimalsErc20Token( - network = this@HecoTestnet, - tokenAddress = "0x41b5984f45AfB2560a0ED72bB69A98E8b32B3cCA", - decimals = 18 - ) - val HT = DecimalsNativeToken( - network = this@HecoTestnet, - wrapped = WHT - ) - - private fun DecimalsErc20Token(network: Network, tokenAddress: String, decimals: Int) = - DecimalsErc20Token(network, ContractAddress(tokenAddress), decimals) - } -} diff --git a/sdk/src/commonMain/kotlin/com/symbiosis/sdk/networks/PolygonMainnet.kt b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/networks/PolygonMainnet.kt new file mode 100644 index 0000000..2ffa4f3 --- /dev/null +++ b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/networks/PolygonMainnet.kt @@ -0,0 +1,57 @@ +package com.symbiosis.sdk.networks + +import com.symbiosis.sdk.currency.DecimalsErc20Token +import com.symbiosis.sdk.currency.DecimalsNativeToken +import com.symbiosis.sdk.currency.Erc20Token +import com.symbiosis.sdk.currency.Token +import com.symbiosis.sdk.dex.DexEndpoint +import com.symbiosis.sdk.network.Network +import dev.icerock.moko.web3.ContractAddress +import dev.icerock.moko.web3.Web3 +import dev.icerock.moko.web3.Web3Executor + +class PolygonMainnet(override val executor: Web3Executor) : DefaultNetwork() { + constructor(endpointUrl: String) : this(Web3(endpointUrl)) + + override val networkName = "PolygonMainnet" + + override val chainIdInt = 0x89 + override val synthFabricAddressString = "0x947a0d452b40013190295a4151A090E1638Fb848" + override val portalAddressString = "0xD7F9989bE0d15319d13d6FA5d468211C89F0b147" + override val synthesizeAddressString = "0xb80fDAA74dDA763a8A158ba85798d373A5E84d84" + override val bridgeAddressString = "0xd5F0f8dB993D26F5df89E70a83d32b369DcCdaa0" + override val routerAddressString = "0xa5E0829CaCEd8fFDD4De3c43696c57F7D7A678ff" + override val metaRouterAddressString = "0xd2B5945829D8254C40f63f476C9F02CF5762F8DF" + override val metaRouterGatewayAddressString = "0x5ee04643fe2D63f364F77B38C41F15A54930f5C1" + + val token = Tokens() + override val tokens: List = listOf(token.MATIC, token.WMATIC, token.USDC) + + override val nativeCurrency = token.MATIC + override val swapBases: List = listOf(token.WMATIC, token.USDC) + override val dexEndpoints: List = listOf( + DexEndpoint.hardcoded( + factoryContractAddress = "0x5757371414417b8C6CAad45bAeF941aBc7d3Ab32", + initCodeHash = "0x96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f", + liquidityProviderFee = 0.003 + ) + ) + + inner class Tokens internal constructor() { + val USDC = DecimalsErc20Token( + network = this@PolygonMainnet, + tokenAddress = "0x66a2A913e447d6b4BF33EFbec43aAeF87890FBbc", + decimals = 6 + ) + val WMATIC = DecimalsErc20Token( + network = this@PolygonMainnet, + tokenAddress = "0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270", + decimals = 18 + ) + val MATIC = DecimalsNativeToken(WMATIC) + + private fun DecimalsErc20Token(network: Network, tokenAddress: String, decimals: Int) = + DecimalsErc20Token(network, ContractAddress(tokenAddress), decimals) + + } +} \ No newline at end of file diff --git a/sdk/src/commonMain/kotlin/com/symbiosis/sdk/networks/PolygonMumbai.kt b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/networks/PolygonMumbai.kt index db0e73d..6ab0f37 100644 --- a/sdk/src/commonMain/kotlin/com/symbiosis/sdk/networks/PolygonMumbai.kt +++ b/sdk/src/commonMain/kotlin/com/symbiosis/sdk/networks/PolygonMumbai.kt @@ -1,5 +1,6 @@ package com.symbiosis.sdk.networks +import com.symbiosis.sdk.currency.DecimalsErc20Token import com.symbiosis.sdk.currency.DecimalsNativeToken import com.symbiosis.sdk.currency.Erc20Token import com.symbiosis.sdk.currency.Token @@ -21,6 +22,7 @@ class PolygonMumbai(override val executor: Web3Executor) : DefaultNetwork() { override val bridgeAddressString = "0x823389FfdF5F1BAD10eB52089E7195772A54ccBa" override val routerAddressString = "0xca33f6D096BDD7FcB28d708f631cD76E73Ecfc2d" override val metaRouterAddressString = "0xd70077A7e64473F2B606fDeE43014d63d3F8dFB2" + override val metaRouterGatewayAddressString = "0xF7Bc9b805d94F47b5A7BacF9fb847b1d2D830f60" val token = Tokens() override val tokens: List = listOf(token.MATIC, token.WMATIC, token.USDT) @@ -31,27 +33,24 @@ class PolygonMumbai(override val executor: Web3Executor) : DefaultNetwork() { DexEndpoint.hardcoded( factoryContractAddress = "0x8a628F00710993c1cebbaa02338d2264ee7056C6", initCodeHash = "0x85f8ad645fe62917d6939782650649d3d7c4b5f25d81415a9fac4a9f341793ca", - liquidityProviderFee = 0.002 + liquidityProviderFee = 0.003 ) ) - inner class Tokens internal constructor(){ - val WMATIC = DecimalsErc20Token( - network = this@PolygonMumbai, - tokenAddress = "0x9c3C9283D3e44854697Cd22D3Faa240Cfb032889", - decimals = 18 - ) + inner class Tokens internal constructor() { val USDT = DecimalsErc20Token( network = this@PolygonMumbai, tokenAddress = "0x9a01bf917477dd9f5d715d188618fc8b7350cd22", decimals = 6 ) - val MATIC = DecimalsNativeToken( + val WMATIC = DecimalsErc20Token( network = this@PolygonMumbai, - wrapped = WMATIC + tokenAddress = "0x9c3C9283D3e44854697Cd22D3Faa240Cfb032889", + decimals = 18 ) + val MATIC = DecimalsNativeToken(WMATIC) private fun DecimalsErc20Token(network: Network, tokenAddress: String, decimals: Int) = - com.symbiosis.sdk.currency.DecimalsErc20Token(network, ContractAddress(tokenAddress), decimals) + DecimalsErc20Token(network, ContractAddress(tokenAddress), decimals) } } diff --git a/sdk/src/jvmTest/kotlin/com/symbiosis/sdk/MetaSwapTest.kt b/sdk/src/jvmTest/kotlin/com/symbiosis/sdk/MetaSwapTest.kt index aa6c2a1..1fed614 100644 --- a/sdk/src/jvmTest/kotlin/com/symbiosis/sdk/MetaSwapTest.kt +++ b/sdk/src/jvmTest/kotlin/com/symbiosis/sdk/MetaSwapTest.kt @@ -2,8 +2,8 @@ package com.symbiosis.sdk import com.soywiz.kbignum.bi import com.soywiz.kbignum.bn -import com.symbiosis.sdk.crosschain.AvalancheFujiBscTestnet -import com.symbiosis.sdk.crosschain.BscTestnetEthRinkeby +import com.symbiosis.sdk.crosschain.testnet.AvalancheFujiBscTestnet +import com.symbiosis.sdk.crosschain.testnet.BscTestnetEthRinkeby import com.symbiosis.sdk.currency.Erc20Token import com.symbiosis.sdk.currency.convertIntegerToReal import com.symbiosis.sdk.currency.convertRealToInteger diff --git a/sdk/src/jvmTest/kotlin/com/symbiosis/sdk/SymbiosisSdkTest.kt b/sdk/src/jvmTest/kotlin/com/symbiosis/sdk/SymbiosisSdkTestnetsTest.kt similarity index 99% rename from sdk/src/jvmTest/kotlin/com/symbiosis/sdk/SymbiosisSdkTest.kt rename to sdk/src/jvmTest/kotlin/com/symbiosis/sdk/SymbiosisSdkTestnetsTest.kt index d90ac2a..0b93fdb 100644 --- a/sdk/src/jvmTest/kotlin/com/symbiosis/sdk/SymbiosisSdkTest.kt +++ b/sdk/src/jvmTest/kotlin/com/symbiosis/sdk/SymbiosisSdkTestnetsTest.kt @@ -18,7 +18,7 @@ import kotlinx.coroutines.runBlocking import kotlin.test.BeforeTest import kotlin.test.assertEquals -class SymbiosisSdkTest { +class SymbiosisSdkTestnetsTest { private lateinit var sdk: ClientsManager @BeforeTest diff --git a/sdk/src/jvmTest/kotlin/com/symbiosis/sdk/TestNetworks.kt b/sdk/src/jvmTest/kotlin/com/symbiosis/sdk/TestNetworks.kt index 589b61d..a906a39 100644 --- a/sdk/src/jvmTest/kotlin/com/symbiosis/sdk/TestNetworks.kt +++ b/sdk/src/jvmTest/kotlin/com/symbiosis/sdk/TestNetworks.kt @@ -34,7 +34,7 @@ val testMumbai = val testAvalanche = AvalancheFuji(endpointUrl = "https://api.avax-test.network/ext/bc/C/rpc") val testHeco = HecoTestnet(endpointUrl = "https://http-testnet.hecochain.com") -val testSdk = SymbiosisSdk( +val testSdk = SymbiosisSdkTestnet( avalancheFujiExecutor = testAvalanche.executor, bscTestnetExecutor = testBSC.executor, ethRinkebyExecutor = testETH.executor,