diff --git a/src/commonMain/kotlin/exchange.dydx.abacus/di/AbacusComponent.kt b/src/commonMain/kotlin/exchange.dydx.abacus/di/AbacusComponent.kt index a6fe3de2e..685636d02 100644 --- a/src/commonMain/kotlin/exchange.dydx.abacus/di/AbacusComponent.kt +++ b/src/commonMain/kotlin/exchange.dydx.abacus/di/AbacusComponent.kt @@ -34,7 +34,7 @@ object AbacusFactory { stateNotification: StateNotificationProtocol? = null, dataNotification: DataNotificationProtocol? = null, presentationProtocol: PresentationProtocol? = null, - ): AbacusComponent = AbacusComponent::class.create( + ): AbacusComponent = createAbacusComponent( deploymentUri, deployment, appConfigs, @@ -61,3 +61,14 @@ abstract class AbacusComponent( ) { abstract val stateManager: AsyncAbacusStateManagerV2 } + +internal expect fun createAbacusComponent( + deploymentUri: DeploymentUri, + deployment: Deployment, + appConfigs: AppConfigsV2, + ioImplementations: IOImplementations, + uiImplementations: UIImplementations, + stateNotification: StateNotificationProtocol?, + dataNotification: DataNotificationProtocol?, + presentationProtocol: PresentationProtocol?, +): AbacusComponent diff --git a/src/iosArm64Main/kotlin/di/AbacusComponent.ios.kt b/src/iosArm64Main/kotlin/di/AbacusComponent.ios.kt new file mode 100644 index 000000000..7b03d7e4a --- /dev/null +++ b/src/iosArm64Main/kotlin/di/AbacusComponent.ios.kt @@ -0,0 +1,28 @@ +package exchange.dydx.abacus.di + +import exchange.dydx.abacus.protocols.DataNotificationProtocol +import exchange.dydx.abacus.protocols.PresentationProtocol +import exchange.dydx.abacus.protocols.StateNotificationProtocol +import exchange.dydx.abacus.state.v2.supervisor.AppConfigsV2 +import exchange.dydx.abacus.utils.IOImplementations +import exchange.dydx.abacus.utils.UIImplementations + +internal actual fun createAbacusComponent( + deploymentUri: DeploymentUri, + deployment: Deployment, + appConfigs: AppConfigsV2, + ioImplementations: IOImplementations, + uiImplementations: UIImplementations, + stateNotification: StateNotificationProtocol?, + dataNotification: DataNotificationProtocol?, + presentationProtocol: PresentationProtocol?, +): AbacusComponent = AbacusComponent::class.create( + deploymentUri, + deployment, + appConfigs, + ioImplementations, + uiImplementations, + stateNotification, + dataNotification, + presentationProtocol, +) diff --git a/src/iosSimulatorArm64Main/kotlin/di/AbacusComponent.ios.kt b/src/iosSimulatorArm64Main/kotlin/di/AbacusComponent.ios.kt new file mode 100644 index 000000000..7b03d7e4a --- /dev/null +++ b/src/iosSimulatorArm64Main/kotlin/di/AbacusComponent.ios.kt @@ -0,0 +1,28 @@ +package exchange.dydx.abacus.di + +import exchange.dydx.abacus.protocols.DataNotificationProtocol +import exchange.dydx.abacus.protocols.PresentationProtocol +import exchange.dydx.abacus.protocols.StateNotificationProtocol +import exchange.dydx.abacus.state.v2.supervisor.AppConfigsV2 +import exchange.dydx.abacus.utils.IOImplementations +import exchange.dydx.abacus.utils.UIImplementations + +internal actual fun createAbacusComponent( + deploymentUri: DeploymentUri, + deployment: Deployment, + appConfigs: AppConfigsV2, + ioImplementations: IOImplementations, + uiImplementations: UIImplementations, + stateNotification: StateNotificationProtocol?, + dataNotification: DataNotificationProtocol?, + presentationProtocol: PresentationProtocol?, +): AbacusComponent = AbacusComponent::class.create( + deploymentUri, + deployment, + appConfigs, + ioImplementations, + uiImplementations, + stateNotification, + dataNotification, + presentationProtocol, +) diff --git a/src/jsMain/kotlin/exchange.dydx.abacus/di/AbacusComponent.js.kt b/src/jsMain/kotlin/exchange.dydx.abacus/di/AbacusComponent.js.kt new file mode 100644 index 000000000..7b03d7e4a --- /dev/null +++ b/src/jsMain/kotlin/exchange.dydx.abacus/di/AbacusComponent.js.kt @@ -0,0 +1,28 @@ +package exchange.dydx.abacus.di + +import exchange.dydx.abacus.protocols.DataNotificationProtocol +import exchange.dydx.abacus.protocols.PresentationProtocol +import exchange.dydx.abacus.protocols.StateNotificationProtocol +import exchange.dydx.abacus.state.v2.supervisor.AppConfigsV2 +import exchange.dydx.abacus.utils.IOImplementations +import exchange.dydx.abacus.utils.UIImplementations + +internal actual fun createAbacusComponent( + deploymentUri: DeploymentUri, + deployment: Deployment, + appConfigs: AppConfigsV2, + ioImplementations: IOImplementations, + uiImplementations: UIImplementations, + stateNotification: StateNotificationProtocol?, + dataNotification: DataNotificationProtocol?, + presentationProtocol: PresentationProtocol?, +): AbacusComponent = AbacusComponent::class.create( + deploymentUri, + deployment, + appConfigs, + ioImplementations, + uiImplementations, + stateNotification, + dataNotification, + presentationProtocol, +) diff --git a/src/jvmMain/kotlin/di/AbacusComponent.jvm.kt b/src/jvmMain/kotlin/di/AbacusComponent.jvm.kt new file mode 100644 index 000000000..7b03d7e4a --- /dev/null +++ b/src/jvmMain/kotlin/di/AbacusComponent.jvm.kt @@ -0,0 +1,28 @@ +package exchange.dydx.abacus.di + +import exchange.dydx.abacus.protocols.DataNotificationProtocol +import exchange.dydx.abacus.protocols.PresentationProtocol +import exchange.dydx.abacus.protocols.StateNotificationProtocol +import exchange.dydx.abacus.state.v2.supervisor.AppConfigsV2 +import exchange.dydx.abacus.utils.IOImplementations +import exchange.dydx.abacus.utils.UIImplementations + +internal actual fun createAbacusComponent( + deploymentUri: DeploymentUri, + deployment: Deployment, + appConfigs: AppConfigsV2, + ioImplementations: IOImplementations, + uiImplementations: UIImplementations, + stateNotification: StateNotificationProtocol?, + dataNotification: DataNotificationProtocol?, + presentationProtocol: PresentationProtocol?, +): AbacusComponent = AbacusComponent::class.create( + deploymentUri, + deployment, + appConfigs, + ioImplementations, + uiImplementations, + stateNotification, + dataNotification, + presentationProtocol, +)