Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/master' into versio…
Browse files Browse the repository at this point in the history
…n/0.40

# Conflicts:
#	app/build.gradle
  • Loading branch information
rafaelekol committed Aug 16, 2024
2 parents 38440cb + 6bd8cca commit 56b1a9b
Show file tree
Hide file tree
Showing 49 changed files with 1,083 additions and 118 deletions.
4 changes: 2 additions & 2 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 111
versionCode 114
versionName "0.40.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

Expand Down Expand Up @@ -275,7 +275,7 @@ dependencies {
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:636ca4d'
implementation 'com.github.horizontalsystems:solana-kit-android:ec238b4'
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'
Expand Down
72 changes: 72 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,14 @@
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="@string/DeeplinkScheme" />
</intent-filter>
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" />
<data android:host="unstoppable.money" />
<data android:pathPrefix="/referral" />
</intent-filter>
</activity-alias>
<activity-alias
android:name="${applicationId}.DarkLauncherAlias"
Expand All @@ -116,6 +124,14 @@
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="@string/DeeplinkScheme" />
</intent-filter>
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" />
<data android:host="unstoppable.money" />
<data android:pathPrefix="/referral" />
</intent-filter>
</activity-alias>
<activity-alias
android:name="${applicationId}.MonoLauncherAlias"
Expand All @@ -140,6 +156,14 @@
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="@string/DeeplinkScheme" />
</intent-filter>
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" />
<data android:host="unstoppable.money" />
<data android:pathPrefix="/referral" />
</intent-filter>
</activity-alias>
<activity-alias
android:name="${applicationId}.LeoLauncherAlias"
Expand All @@ -164,6 +188,14 @@
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="@string/DeeplinkScheme" />
</intent-filter>
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" />
<data android:host="unstoppable.money" />
<data android:pathPrefix="/referral" />
</intent-filter>
</activity-alias>
<activity-alias
android:name="${applicationId}.MustangLauncherAlias"
Expand All @@ -188,6 +220,14 @@
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="@string/DeeplinkScheme" />
</intent-filter>
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" />
<data android:host="unstoppable.money" />
<data android:pathPrefix="/referral" />
</intent-filter>
</activity-alias>
<activity-alias
android:name="${applicationId}.YakLauncherAlias"
Expand All @@ -212,6 +252,14 @@
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="@string/DeeplinkScheme" />
</intent-filter>
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" />
<data android:host="unstoppable.money" />
<data android:pathPrefix="/referral" />
</intent-filter>
</activity-alias>
<activity-alias
android:name="${applicationId}.PunkLauncherAlias"
Expand All @@ -236,6 +284,14 @@
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="@string/DeeplinkScheme" />
</intent-filter>
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" />
<data android:host="unstoppable.money" />
<data android:pathPrefix="/referral" />
</intent-filter>
</activity-alias>
<activity-alias
android:name="${applicationId}.ApeLauncherAlias"
Expand All @@ -260,6 +316,14 @@
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="@string/DeeplinkScheme" />
</intent-filter>
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" />
<data android:host="unstoppable.money" />
<data android:pathPrefix="/referral" />
</intent-filter>
</activity-alias>
<activity-alias
android:name="${applicationId}.Ball8LauncherAlias"
Expand All @@ -284,6 +348,14 @@
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="@string/DeeplinkScheme" />
</intent-filter>
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" />
<data android:host="unstoppable.money" />
<data android:pathPrefix="/referral" />
</intent-filter>
</activity-alias>
</application>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package io.horizontalsystems.bankwallet.core

import android.app.Activity
import android.content.Context
import android.content.ContextWrapper
import android.content.Intent
import android.os.Parcelable
import android.widget.ImageView
Expand Down Expand Up @@ -224,4 +227,10 @@ suspend fun <T> retryWhen(
delay(1000)
}
return block()
}

fun Context.findActivity(): Activity? = when (this) {
is Activity -> this
is ContextWrapper -> baseContext.findActivity()
else -> null
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import io.horizontalsystems.bankwallet.core.adapters.zcash.ZcashAdapter
import io.horizontalsystems.bankwallet.core.managers.ActiveAccountState
import io.horizontalsystems.bankwallet.core.managers.Bep2TokenInfoService
import io.horizontalsystems.bankwallet.core.managers.EvmKitWrapper
import io.horizontalsystems.bankwallet.core.managers.MiniAppRegisterService.RegisterAppResponse
import io.horizontalsystems.bankwallet.core.providers.FeeRates
import io.horizontalsystems.bankwallet.core.utils.AddressUriResult
import io.horizontalsystems.bankwallet.entities.Account
Expand Down Expand Up @@ -214,6 +215,7 @@ interface INetworkManager {
fun ping(host: String, url: String, isSafeCall: Boolean): Flowable<Any>
fun getEvmInfo(host: String, path: String): Single<JsonObject>
suspend fun getBep2Tokens(): List<Bep2TokenInfoService.Bep2Token>
suspend fun registerApp(userId: String, referralCode: String): RegisterAppResponse
}

interface IClipboardManager {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ class NetworkManager : INetworkManager {
override suspend fun getBep2Tokens(): List<Bep2TokenInfoService.Bep2Token> {
return Bep2TokenInfoService.service().tokens()
}

override suspend fun registerApp(userId: String, referralCode: String)
: MiniAppRegisterService.RegisterAppResponse {
return MiniAppRegisterService.service().registerApp(userId, referralCode)
}
}

object ServiceFullTransaction {
Expand Down Expand Up @@ -145,6 +150,28 @@ object ServiceChangeLogs {
}
}

object MiniAppRegisterService {
private val apiUrl = "https://be.unstoppable.money/"

fun service(): UnstoppableApi {
return APIClient.retrofit(apiUrl, 60)
.create(UnstoppableApi::class.java)
}

interface UnstoppableApi {
@GET("api/v1/tasks/registerApp")
suspend fun registerApp(
@Query("userId") userId: String,
@Query("referralCode") referralCode: String
): RegisterAppResponse
}

data class RegisterAppResponse(
val success: Boolean,
val message: String
)
}

object APIClient {

private val logger = HttpLoggingInterceptor().apply {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
package io.horizontalsystems.bankwallet.modules.addtoken

import io.horizontalsystems.bankwallet.core.customCoinUid
import io.horizontalsystems.bankwallet.modules.addtoken.AddTokenModule.IAddTokenBlockchainService
import io.horizontalsystems.marketkit.models.Blockchain
import io.horizontalsystems.marketkit.models.Coin
import io.horizontalsystems.marketkit.models.Token
import io.horizontalsystems.marketkit.models.TokenQuery
import io.horizontalsystems.marketkit.models.TokenType
import io.horizontalsystems.solanakit.core.TokenProvider
import io.horizontalsystems.solanakit.models.Address
import io.horizontalsystems.solanakit.transactions.SolanaFmService

class AddSolanaTokenBlockchainService(
private val blockchain: Blockchain,
private val tokenProvider: TokenProvider
) : IAddTokenBlockchainService {

override fun isValid(reference: String): Boolean {
return try {
Address(reference)
true
} catch (e: Throwable) {
false
}
}

override fun tokenQuery(reference: String): TokenQuery {
return TokenQuery(blockchain.type, TokenType.Spl(reference))
}

override suspend fun token(reference: String): Token {
val tokenInfo = tokenProvider.getTokenInfo(reference)
val tokenQuery = tokenQuery(reference)
return Token(
coin = Coin(tokenQuery.customCoinUid, tokenInfo.name, tokenInfo.symbol, tokenInfo.decimals),
blockchain = blockchain,
type = tokenQuery.tokenType,
decimals = tokenInfo.decimals
)
}

companion object {
fun getInstance(blockchain: Blockchain): AddSolanaTokenBlockchainService {
val tokenProvider = TokenProvider(SolanaFmService())
return AddSolanaTokenBlockchainService(blockchain, tokenProvider)
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class AddTokenService(
BlockchainType.Fantom,
BlockchainType.ArbitrumOne,
BlockchainType.Optimism,
BlockchainType.Solana
)

val blockchains = marketKit
Expand All @@ -52,6 +53,9 @@ class AddTokenService(
BlockchainType.Tron -> {
AddTronTokenBlockchainService.getInstance(blockchain)
}
BlockchainType.Solana -> {
AddSolanaTokenBlockchainService.getInstance(blockchain)
}
else -> AddEvmTokenBlockchainService.getInstance(blockchain)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import androidx.compose.foundation.layout.width
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.material.CircularProgressIndicator
import androidx.compose.material.Icon
import androidx.compose.material.ScrollableTabRow
import androidx.compose.material.Tab
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
Expand Down Expand Up @@ -64,6 +63,7 @@ import io.horizontalsystems.bankwallet.ui.compose.ComposeAppTheme
import io.horizontalsystems.bankwallet.ui.compose.components.GraphicBars
import io.horizontalsystems.bankwallet.ui.compose.components.GraphicBarsWithNegative
import io.horizontalsystems.bankwallet.ui.compose.components.HSpacer
import io.horizontalsystems.bankwallet.ui.compose.components.HsPeriodsScrollableTabRow
import io.horizontalsystems.bankwallet.ui.compose.components.RowUniversal
import io.horizontalsystems.bankwallet.ui.compose.components.TabButtonSecondaryTransparent
import io.horizontalsystems.bankwallet.ui.compose.components.TabItem
Expand Down Expand Up @@ -702,28 +702,31 @@ fun <T> ChartTab(modifier: Modifier = Modifier, tabItems: List<TabItem<T>>, onSe
val tabIndex = tabItems.indexOfFirst { it.selected }

TabPeriod(modifier = modifier) {
ScrollableTabRow(
HsPeriodsScrollableTabRow(
selectedTabIndex = tabIndex,
modifier = Modifier,
backgroundColor = Color.Transparent,
edgePadding = 0.dp,
edgePadding = 12.dp,
indicator = {},
divider = {}
) {
tabItems.forEachIndexed { index, tabItem ->
val selected = tabIndex == index

Tab(
selected = selected,
onClick = { },
Row(
modifier = Modifier.padding(horizontal = 4.dp)
) {
TabButtonSecondaryTransparent(
title = tabItem.title,
onSelect = {
onSelect.invoke(tabItem.item)
},
selected = selected
)
Tab(
selected = selected,
onClick = { },
) {
TabButtonSecondaryTransparent(
title = tabItem.title,
onSelect = {
onSelect.invoke(tabItem.item)
},
selected = selected
)
}
}
}
}
Expand Down
Loading

0 comments on commit 56b1a9b

Please sign in to comment.