Initialisation of the Youniqx Wallet SDK

The WalletSdkApi is an interface providing an object which has to be configured on first use. This should be done in a central place like a dependency injection configuration to make sure it is not recreated on each use, it should be provided as a singleton to the app.

To initialize and configure the WalletSdk on first use, the configure function has to be called, providing the WALLET_PROVIDER’s URL.

Example usage with metro DI:

private val WALLET_PROVIDER = "your://wallet.provider/url"

@DependencyGraph(AppScope::class)
interface AppGraph {
    @Provides
    @SingleIn(AppScope::class)
    fun provideWalletSdk(): WalletSdkApi =
        WalletSdk.apply {
            configure(WalletSdkConfiguration(walletProviderUrl = WALLET_PROVIDER))
        }
}

See WalletUnit to learn more about the WalletUnit’s states and how to proceed in the app.