Skip to content

Commit

Permalink
Merge branch 'master' into merge-master-to-dev
Browse files Browse the repository at this point in the history
# Conflicts:
#	app/build.gradle
  • Loading branch information
rafaelekol committed Dec 4, 2024
2 parents 957a62a + 6779bfe commit e2801d9
Show file tree
Hide file tree
Showing 7 changed files with 66 additions and 53 deletions.
32 changes: 16 additions & 16 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ android {
compileSdk compile_sdk_version
minSdkVersion min_sdk_version
targetSdkVersion compile_sdk_version
versionCode 122
versionCode 123
versionName "0.42.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

Expand All @@ -43,6 +43,10 @@ android {
resValue "string", "walletConnectAppMetaDataUrl", "unstoppable.money"
resValue "string", "walletConnectAppMetaDataIcon", "https://raw.githubusercontent.com/horizontalsystems/HS-Design/master/PressKit/UW-AppIcon-on-light.png"
resValue "string", "accountsBackupFileSalt", "unstoppable"

ndk {
abiFilters "armeabi-v7a", "arm64-v8a"
}
}

buildFeatures {
Expand Down Expand Up @@ -77,7 +81,7 @@ android {
resValue "string", "ftmscanApiKey", "57YQ2GIRAZNV6M5HIJYYG3XQGGNIPVV8MF"
resValue "string", "basescanApiKey", "AKEWS351FN9P9E2CFPWRWQVGHYUP7W8SUF"
resValue "string", "is_release", "false"
resValue "string", "guidesUrl", "https://raw.githubusercontent.com/horizontalsystems/Unstoppable-Wallet-Website/master/src/edu.json"
resValue "string", "guidesUrl", "https://raw.githubusercontent.com/horizontalsystems/Unstoppable-Wallet-Website/refs/tags/v1.4/src/edu.json"
resValue "string", "faqUrl", "https://raw.githubusercontent.com/horizontalsystems/Unstoppable-Wallet-Website/master/src/faq.json"
resValue "string", "coinsJsonUrl", "https://raw.githubusercontent.com/horizontalsystems/cryptocurrencies/master/coins.json"
resValue "string", "providerCoinsJsonUrl", "https://raw.githubusercontent.com/horizontalsystems/cryptocurrencies/master/provider.coins.json"
Expand Down Expand Up @@ -116,7 +120,7 @@ android {
resValue "string", "ftmscanApiKey", "JAWRPW27KEMVXMJJ9UKY63CVPH3X5V9SMP"
resValue "string", "basescanApiKey", "QU4RJVJXQCW812J3234EW9EV815TA6XC55"
resValue "string", "is_release", "true"
resValue "string", "guidesUrl", "https://raw.githubusercontent.com/horizontalsystems/Unstoppable-Wallet-Website/master/src/edu.json"
resValue "string", "guidesUrl", "https://raw.githubusercontent.com/horizontalsystems/Unstoppable-Wallet-Website/refs/tags/v1.4/src/edu.json"
resValue "string", "faqUrl", "https://raw.githubusercontent.com/horizontalsystems/Unstoppable-Wallet-Website/v1.3/src/faq.json"
resValue "string", "coinsJsonUrl", "https://raw.githubusercontent.com/horizontalsystems/cryptocurrencies/v0.21/coins.json"
resValue "string", "providerCoinsJsonUrl", "https://raw.githubusercontent.com/horizontalsystems/cryptocurrencies/v0.21/provider.coins.json"
Expand Down Expand Up @@ -171,19 +175,15 @@ android {

configurations.all { c ->
c.resolutionStrategy.dependencySubstitution {
substitute module('org.bouncycastle:bcprov-jdk15on:1.65.01') using module('org.bouncycastle:bcprov-jdk18on:1.77')
substitute module('org.bouncycastle:bcprov-jdk15on:1.70') using module('org.bouncycastle:bcprov-jdk18on:1.77')
substitute module('org.bouncycastle:bcprov-jdk15on:1.66') using module('org.bouncycastle:bcprov-jdk18on:1.77')
substitute module('org.bouncycastle:bcprov-jdk15to18:1.68') using module('org.bouncycastle:bcprov-jdk18on:1.77')
substitute module('org.bouncycastle:bcprov-jdk15to18:1.68') using module('org.bouncycastle:bcprov-jdk15on:1.65')
substitute module('com.google.protobuf:protobuf-java:3.6.1') using module('com.google.protobuf:protobuf-javalite:3.21.1')
substitute module('net.jcip:jcip-annotations:1.0') using module('com.github.stephenc.jcip:jcip-annotations:1.0-1')

substitute module('com.tinder.scarlet:scarlet-core:0.1.12') using module('com.walletconnect.Scarlet:scarlet-core:1.0.1')
substitute module('com.tinder.scarlet:scarlet:0.1.12') using module('com.walletconnect.Scarlet:scarlet:1.0.1')
substitute module('com.tinder.scarlet:websocket-okhttp:0.1.12') using module('com.walletconnect.Scarlet:websocket-okhttp:1.0.1')
substitute module('com.tinder.scarlet:stream-adapter-built-in:0.1.12') using module('com.walletconnect.Scarlet:stream-adapter-built-in:1.0.1')
substitute module('com.tinder.scarlet:message-adapter-built-in:0.1.12') using module('com.walletconnect.Scarlet:message-adapter-built-in:1.0.1')
substitute module('com.tinder.scarlet:lifecycle-android:0.1.12') using module('com.walletconnect.Scarlet:lifecycle-android:1.0.1')
substitute module('com.tinder.scarlet:scarlet:0.1.12') using module('com.github.WalletConnect.Scarlet:scarlet:1.0.0')
substitute module('com.tinder.scarlet:websocket-okhttp:0.1.12') using module('com.github.WalletConnect.Scarlet:websocket-okhttp:1.0.0')
substitute module('com.tinder.scarlet:stream-adapter-rxjava2:0.1.12') using module('com.github.WalletConnect.Scarlet:stream-adapter-rxjava2:1.0.0')
substitute module('com.tinder.scarlet:message-adapter-gson:0.1.12') using module('com.github.WalletConnect.Scarlet:message-adapter-gson:1.0.0')
substitute module('com.tinder.scarlet:lifecycle-android:0.1.12') using module('com.github.WalletConnect.Scarlet:lifecycle-android:1.0.0')
}

resolutionStrategy.eachDependency { details ->
Expand Down Expand Up @@ -283,21 +283,21 @@ dependencies {
// Wallet kits
implementation 'com.github.horizontalsystems:ton-kit-android:969fe77'
implementation 'com.github.horizontalsystems:bitcoin-kit-android:ced5801'
implementation 'com.github.horizontalsystems:ethereum-kit-android:a5eff38'
implementation 'com.github.horizontalsystems:ethereum-kit-android:0c770e3'
implementation 'com.github.horizontalsystems:blockchain-fee-rate-kit-android:1d3bd49'
implementation 'com.github.horizontalsystems:binance-chain-kit-android:c1509a2'
implementation 'com.github.horizontalsystems:market-kit-android:4201f8f'
implementation 'com.github.horizontalsystems:solana-kit-android:ce738d8'
implementation 'com.github.horizontalsystems:tron-kit-android:dc3dca7'
// Zcash SDK
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.4'
implementation "cash.z.ecc.android:zcash-android-sdk:2.1.1"
implementation "cash.z.ecc.android:zcash-android-sdk:2.2.6"
implementation("io.github.binance:binance-connector-java:3.0.0rc2") {
exclude group: "org.bouncycastle", module: "bcprov-jdk18on"
}

// WalletConnect V2
implementation(platform("com.walletconnect:android-bom:1.35.2"))
implementation(platform("com.walletconnect:android-bom:1.15.0"))
implementation 'com.walletconnect:web3wallet'
implementation 'com.walletconnect:android-core'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class ZcashAdapter(
max(network.saplingActivationHeight.value, height)
}
?.let {
BlockHeight.new(network, it)
BlockHeight.new(it)
}
}

Expand Down Expand Up @@ -256,6 +256,7 @@ class ZcashAdapter(
is AddressType.Invalid -> throw ZcashError.InvalidAddress
is AddressType.Transparent -> ZCashAddressType.Transparent
is AddressType.Shielded -> ZCashAddressType.Shielded
is AddressType.Tex -> ZCashAddressType.Shielded
AddressType.Unified -> ZCashAddressType.Unified
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,18 @@ open class EvmCommonGasDataService(
}

return evmKit.estimateGas(stubTransactionData, gasPrice)
.map { estimatedGasLimit ->
val gasLimit = if (surchargeRequired) EvmFeeModule.surcharged(estimatedGasLimit) else estimatedGasLimit
GasData(
gasLimit = gasLimit,
estimatedGasLimit = estimatedGasLimit,
gasPrice = gasPrice
)
}
.onErrorResumeNext {
evmKit.estimateGas(stubTransactionData)
}
.map { estimatedGasLimit ->
val gasLimit =
if (surchargeRequired) EvmFeeModule.surcharged(estimatedGasLimit) else estimatedGasLimit
GasData(
gasLimit = gasLimit,
estimatedGasLimit = estimatedGasLimit,
gasPrice = gasPrice
)
}
}

companion object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,7 @@ class MainFragment : BaseComposeFragment() {
)
} ?: run {
// Back stack entry doesn't exist, restart activity
val intent = requireActivity().intent
intent.data = null
requireActivity().finishAffinity()
startActivity(intent)
requireActivity().recreate()
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,13 @@ class SendEvmConfirmationFragment : BaseComposeFragment() {

@Composable
override fun GetContent(navController: NavController) {
SendEvmConfirmationScreen(navController, navController.requireInput())
val input = try {
navController.requireInput<Input>()
} catch (e: NullPointerException) {
navController.popBackStack()
return
}
SendEvmConfirmationScreen(navController, input)
}

@Parcelize
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package io.horizontalsystems.bankwallet.modules.walletconnect

import android.util.Log
import com.walletconnect.android.Core
import com.walletconnect.android.CoreClient
import com.walletconnect.web3.wallet.client.Wallet
Expand Down Expand Up @@ -130,25 +129,25 @@ object WCDelegate : Web3Wallet.WalletDelegate, CoreClient.CoreDelegate {
}
}

override fun onProposalExpired(proposal: Wallet.Model.ExpiredProposal) {
Log.e("TAG", "onProposalExpired: ", )
}

override fun onRequestExpired(request: Wallet.Model.ExpiredRequest) {
Log.e("TAG", "onRequestExpired: ", )
}

override fun onSessionExtend(session: Wallet.Model.Session) {
Log.e("TAG", "onSessionExtend: ", )
}

override fun onPairingExpired(expiredPairing: Core.Model.ExpiredPairing) {
Log.e("TAG", "onPairingExpired: ", )
}

override fun onPairingState(pairingState: Core.Model.PairingState) {
Log.e("TAG", "onPairingState: $pairingState", )
}
// override fun onProposalExpired(proposal: Wallet.Model.ExpiredProposal) {
// Log.e("TAG", "onProposalExpired: ", )
// }
//
// override fun onRequestExpired(request: Wallet.Model.ExpiredRequest) {
// Log.e("TAG", "onRequestExpired: ", )
// }
//
// override fun onSessionExtend(session: Wallet.Model.Session) {
// Log.e("TAG", "onSessionExtend: ", )
// }
//
// override fun onPairingExpired(expiredPairing: Core.Model.ExpiredPairing) {
// Log.e("TAG", "onPairingExpired: ", )
// }
//
// override fun onPairingState(pairingState: Core.Model.PairingState) {
// Log.e("TAG", "onPairingState: $pairingState", )
// }

// fun deleteAccountAllPairings(currentAccountTopics: List<String>) {
// Web3Wallet.getListOfActiveSessions()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -337,9 +337,15 @@ class WCSessionViewModel(
if (Web3Wallet.getSessionProposals().isNotEmpty()) {
val blockchains = getSupportedBlockchains(accountNonNull)
val namespaces = getSupportedNamespaces(blockchains.map { it.getAccount() })
val sessionProposal: Wallet.Model.SessionProposal = requireNotNull(
Web3Wallet.getSessionProposals()
.find { it.proposerPublicKey == proposalPublicKey })
val sessionProposal: Wallet.Model.SessionProposal = try {
requireNotNull(
Web3Wallet.getSessionProposals()
.find { it.proposerPublicKey == proposalPublicKey })
} catch (e: Exception) {
continuation.resumeWithException(e)
WCDelegate.sessionProposalEvent = null
return@suspendCoroutine
}
val sessionNamespaces = Web3Wallet.generateApprovedNamespaces(
sessionProposal = sessionProposal,
supportedNamespaces = namespaces
Expand Down

0 comments on commit e2801d9

Please sign in to comment.