-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1390 from novasamatech/rc/7.9.0
Rc/7.9.0
- Loading branch information
Showing
173 changed files
with
5,902 additions
and
498 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
...pp/root/presentation/deepLinks/handlers/walletConnect/WalletConnectPairDeeplinkHandler.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package io.novafoundation.nova.app.root.presentation.deepLinks.handlers.walletConnect | ||
|
||
import android.net.Uri | ||
import io.novafoundation.nova.app.root.presentation.deepLinks.CallbackEvent | ||
import io.novafoundation.nova.app.root.presentation.deepLinks.DeepLinkHandler | ||
import io.novafoundation.nova.common.utils.sequrity.AutomaticInteractionGate | ||
import io.novafoundation.nova.common.utils.sequrity.awaitInteractionAllowed | ||
import io.novafoundation.nova.feature_wallet_connect_api.presentation.WalletConnectService | ||
import kotlinx.coroutines.flow.Flow | ||
import kotlinx.coroutines.flow.emptyFlow | ||
|
||
class WalletConnectPairDeeplinkHandler( | ||
private val walletConnectService: WalletConnectService, | ||
private val automaticInteractionGate: AutomaticInteractionGate | ||
) : DeepLinkHandler { | ||
|
||
override val callbackFlow: Flow<CallbackEvent> = emptyFlow() | ||
|
||
override suspend fun matches(data: Uri): Boolean { | ||
val newLinkMatch = data.scheme == "novawallet" && data.host == "wc" | ||
// Older version of wc send both pair and sign requests through `wc:` deeplink so we additionaly check for `symKey` which is only present in pairing url | ||
val oldLinkMatch = data.scheme == "wc" && "symKey" in data.toString() | ||
|
||
return newLinkMatch || oldLinkMatch | ||
} | ||
|
||
override suspend fun handleDeepLink(data: Uri) { | ||
automaticInteractionGate.awaitInteractionAllowed() | ||
walletConnectService.pair(data.toString()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.