Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/vip codes #681

Merged
merged 78 commits into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
0629921
batch transaction
Nov 20, 2023
54bac6c
batch transaction
Dec 22, 2023
581e1ac
fix quad ads filtering
Dec 22, 2023
3e2c6a0
btc batch
Dec 27, 2023
354deec
btc batch
Dec 27, 2023
3482c5a
btc batch
Jan 3, 2024
42dc560
add vip screen layout
Feb 12, 2024
1865723
update vip codes tab ui
Feb 13, 2024
5c6c002
change api version to v2
Feb 21, 2024
ea6e17f
try to fix github build problem
Feb 21, 2024
c50157b
try to fix github build problem
Feb 21, 2024
6511ee0
Update InvestmentAccount.kt
kurtnebiev-elvis4 Feb 21, 2024
17b1ace
try to fix github build problem
Feb 21, 2024
9a1bac2
try to fix github build problem
Feb 21, 2024
0ddf8a1
try to fix github build problem
Feb 21, 2024
4dab0a2
try to fix github build problem
Feb 21, 2024
cd9708a
fix ci building
Feb 21, 2024
a5a6501
fix ci building (#2171)
AlexanderPavlenko Feb 22, 2024
f2111a9
Merge branch 'master' into feature/batch
kurtnebiev-elvis4 Feb 22, 2024
ff351cf
Merge branch 'master' into feature/changelly-update
kurtnebiev-elvis4 Feb 22, 2024
64276e9
Merge branch 'master' into bug/quads-ads
kurtnebiev-elvis4 Feb 22, 2024
7afdbfb
add vip codes mock logic
Feb 26, 2024
a8fcec8
add api signing
Feb 29, 2024
36efe7a
changelly expected amount calculation
Feb 29, 2024
fd69b8b
Merge remote-tracking branch 'origin/feature/changelly-update' into f…
Feb 29, 2024
d875e7a
fix text on help page
Mar 2, 2024
177baac
add activate and check vip status
Mar 1, 2024
f88d0d7
cleanup code + migrate changelly interceptor to kotlin
Mar 4, 2024
035bd50
migrate to changelly2
Mar 5, 2024
1dd23b4
#rm5834 open url in app context
Mar 9, 2024
68d2ed8
add vip screen ui improvements
Mar 7, 2024
b5436f8
fix quad ads filtering (#2168)
AlexanderPavlenko Mar 11, 2024
24735ba
#rm5832 Feature/batch (#2169)
AlexanderPavlenko Mar 11, 2024
3d2144d
#rm5833 change changelly api version to v2 (#2170)
AlexanderPavlenko Mar 11, 2024
1be2314
#rm5834 open url in app context (#2173)
AlexanderPavlenko Mar 11, 2024
fa928a3
#rm5835 fix text on help page (#2172)
AlexanderPavlenko Mar 11, 2024
79f6542
add mycelium host
Mar 14, 2024
c533443
remove unneccessary files
Mar 14, 2024
d515f28
replace master seed with account seed
Mar 18, 2024
40b3bd5
update gala contract to v2
Mar 18, 2024
99454dd
update gala contract to v2 (#2175)
AlexanderPavlenko Mar 18, 2024
46c001e
add cake erc20 token
Mar 18, 2024
d96b39a
Merge branch 'master' into feature/GALA-v2
kurtnebiev-elvis4 Mar 18, 2024
39a0eb5
redesign vip codes
Mar 28, 2024
58a4d74
fix vip fragment text clip
Mar 29, 2024
9d98845
fix text
Mar 29, 2024
32070f0
Merge remote-tracking branch 'origin/master' into feature/vip_codes2
Mar 29, 2024
1e28351
fix merge
Mar 29, 2024
4fb1f3b
add cake erc20 token (#2176)
AlexanderPavlenko Mar 29, 2024
383860b
remove text on the vip page
Mar 29, 2024
78dc2f9
up size icon
Mar 29, 2024
9284eb4
Feature/vip codes2 (#2178)
AlexanderPavlenko Mar 29, 2024
d0791e8
v3.17.0
AlexanderPavlenko Mar 29, 2024
9ca11b0
v3.17.0 (#2179)
AlexanderPavlenko Mar 29, 2024
20307a7
fix text in ru localization
Mar 31, 2024
74c2a42
fix cursor bg
Mar 31, 2024
ef2994b
fix amountTo in dialog
Apr 1, 2024
6f158d6
fix cursor bg (#2181)
AlexanderPavlenko Apr 2, 2024
672e617
Merge branch 'master' into bugfix/changelly
kurtnebiev-elvis4 Apr 2, 2024
b561425
fix text in ru localization (#2180)
AlexanderPavlenko Apr 2, 2024
9f2f767
fix amountTo in dialog (#2182)
AlexanderPavlenko Apr 2, 2024
a05d215
fixed gettransaction api
Apr 2, 2024
9f4c4e1
fixed gettransaction api
Apr 2, 2024
3eb0e23
fixed gettransaction api (#2184)
AlexanderPavlenko Apr 3, 2024
1c6cd33
fix landscape vip codes screen
Apr 3, 2024
4cd8daa
Merge remote-tracking branch 'changelly-vip/feature/vip_codes' into f…
Apr 3, 2024
1c1de31
Feature/vip codes2 (#2185)
AlexanderPavlenko Apr 9, 2024
906e107
fixed fiat save for batch tx
Apr 10, 2024
95e4e92
fixed in call api in main thread
Apr 10, 2024
0f0e9ce
fix user repository injection + infinity loading
Apr 18, 2024
2e83082
add vip caching
Apr 19, 2024
c03b4c1
fix broken exchange logic + add network fee to calculation
Apr 22, 2024
6c94cb3
separate changelly and viper + add local status storing
May 14, 2024
c4dedcf
separate viper calls
May 17, 2024
5e6d2a4
fix viper rates issue
May 17, 2024
1d16817
add vip dependency to getFixRateFrorAmount + remove double request fr…
May 31, 2024
7f15585
fix viper exchange history
Jun 19, 2024
4447b2b
remove unnecessary networkFee subtraction
Jun 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ jobs:
runs-on: ubuntu-latest
steps:

- uses: maxim-lobanov/setup-android-tools@v1
with:
packages: cmdline-tools;latest

- name: Install deps
run: sudo apt-get install -y unzip diffutils

Expand All @@ -29,6 +25,12 @@ jobs:
with:
submodules: recursive

- name: Setup Android SDK
uses: android-actions/setup-android@v3
with:
#need for java 11, latest version work only with jav 17
cmdline-tools-version: 8512546

- run: ./gradlew clean test mbw::assembleProdnetDebug mbw::assembleBtctestnetDebug mbw::assembleBtctestnetRelease

- uses: actions/upload-artifact@v3
Expand Down
20 changes: 20 additions & 0 deletions gradle/verification-metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,11 @@
<sha256 value="270c7b7d99942d5ec1dd88594e4648feb33d8e31d8c3c2ab2321d49d9abdfc1f" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="androidx.browser" name="browser" version="1.5.0">
<artifact name="browser-1.5.0.aar">
<sha256 value="94f24e272b3a269ff9a5ba21da5e652615dc59ac3fa2ba2d7a5ae30d1c4df748" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="androidx.cardview" name="cardview" version="1.0.0">
<artifact name="cardview-1.0.0.aar">
<sha256 value="1193c04c22a3d6b5946dae9f4e8c59d6adde6a71b6bd5d87fb99d82dda1afec7" origin="Generated by Gradle"/>
Expand Down Expand Up @@ -177,6 +182,11 @@
<sha256 value="721e76e74ee4158d3fe9759074b7eceed4ff7d84ed34a3faca5843fb874ac946" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="androidx.concurrent" name="concurrent-futures" version="1.0.0">
<artifact name="concurrent-futures-1.0.0.jar">
<sha256 value="5595a40e278a7b39fa78a09490e3d7f3faa95c7b01447148bd38b5ade0605c35" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="androidx.constraintlayout" name="constraintlayout" version="2.1.0">
<artifact name="constraintlayout-2.1.0.aar">
<sha256 value="a458a7562363bd59c209a7dea847326a0e2b26b37a883dc3e29065a79a1c788b" origin="Generated by Gradle"/>
Expand Down Expand Up @@ -1028,6 +1038,11 @@
<sha256 value="9f022d1649feb766a9ea1a2dd4597be0303ae45d8dff93e9770614b13dde7452" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="com.airbnb.android" name="lottie" version="3.4.0">
<artifact name="lottie-3.4.0.aar">
<sha256 value="873c0da54bfb6a84dd6d57344a26e0ddeb9cdb210da8ceeced3a5561125c9d10" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="com.alecstrong" name="sqlite-psi-core" version="0.1.9">
<artifact name="sqlite-psi-core-0.1.9.jar">
<sha256 value="ba9837d206fa93f2a6c7be8319169252f386f306b3415e15eaa0de47aab1ef17" origin="Generated by Gradle"/>
Expand Down Expand Up @@ -2357,6 +2372,11 @@
<sha256 value="ec0484ff1903640e3845c2b10abb99eff2d32308ffe3459e5f92309a451b9c7e" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="com.squareup.okio" name="okio" version="1.17.4">
<artifact name="okio-1.17.4.jar">
<sha256 value="d78fac588458fc099e6c82e91fe5f0375c67434626451a3a77772c65d9eee85b" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="com.squareup.okio" name="okio" version="1.6.0">
<artifact name="okio-1.6.0.jar">
<sha256 value="114bdc1f47338a68bcbc95abf2f5cdc72beeec91812f2fcd7b521c1937876266" origin="Generated by Gradle"/>
Expand Down
7 changes: 4 additions & 3 deletions mbw/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ dependencies {
implementation "com.google.code.findbugs:annotations:$findBugsVersion"
implementation "com.squareup:otto:$ottoVersion"

implementation 'androidx.browser:browser:1.5.0'
implementation "androidx.biometric:biometric:1.1.0"
implementation "androidx.core:core-ktx:1.6.0"
implementation "androidx.fragment:fragment-ktx:1.3.6"
Expand Down Expand Up @@ -148,7 +149,7 @@ dependencies {
}
kapt "com.github.bumptech.glide:compiler:4.7.1"
implementation "info.guardianproject.netcipher:netcipher:2.1.0"

implementation "com.airbnb.android:lottie:3.4.0"

androidTestImplementation 'androidx.test:core:1.2.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
Expand Down Expand Up @@ -220,8 +221,8 @@ android {
buildToolsVersion androidSdkBuildVersion

defaultConfig {
versionCode 3160200
versionName '3.16.2.0'
versionCode 3170000
versionName '3.17.0'

multiDexEnabled true

Expand Down
22 changes: 22 additions & 0 deletions mbw/src/androidTest/java/com/mycelium/wallet/TokensTest.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.mycelium.wallet

import android.util.Log
import androidx.test.ext.junit.runners.AndroidJUnit4
import com.mycelium.wallet.external.changelly.ChangellyAPIService.Companion.retrofit
import kotlinx.coroutines.runBlocking
import org.junit.Assert
import org.junit.Test
import org.junit.runner.RunWith
import java.math.BigDecimal

@RunWith(AndroidJUnit4::class)
class TokensTest {

@Test
fun testTokenList() {
// Log.e("!!!", WalletConfiguration.TOKENS.joinToString { it.symbol + " " + it.name })

Log.e("!!!", "size = " + WalletConfiguration.TOKENS.size)
Log.e("!!!", WalletConfiguration.TOKENS.joinToString { it.symbol + " = " + it.prodAddress })
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import com.mrd.bitlib.crypto.InMemoryPrivateKey
import com.mrd.bitlib.model.NetworkParameters
import com.mycelium.wallet.MbwManager
import com.mycelium.wallet.R
import com.mycelium.wallet.activity.GetAmountActivity.ACCOUNT
import com.mycelium.wallet.activity.send.SendCoinsActivity
import com.mycelium.wallet.activity.send.view.SelectableRecyclerView
import org.junit.After
Expand All @@ -39,7 +38,7 @@ class SendMainActivityTest {
@Before
fun setUp() {
// manually launch SendMainActivity to pass Intent with accountId
sut = sendMainActivityRule.launchActivity(Intent().putExtra(ACCOUNT, accountId))
sut = sendMainActivityRule.launchActivity(Intent().putExtra("account", accountId))
receiversAddressesList = sut!!.findViewById<SelectableRecyclerView>(R.id.receiversAddressList)
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package com.mycelium.wallet.external.changelly

import androidx.test.ext.junit.runners.AndroidJUnit4
import com.mycelium.wallet.external.changelly.ChangellyAPIService.Companion.retrofit
import kotlinx.coroutines.runBlocking
import org.junit.Assert
import org.junit.Test
import org.junit.runner.RunWith
import java.math.BigDecimal

@RunWith(AndroidJUnit4::class)
class ChangellyHeaderInterceptorTest {

@Test
fun testChandllyDefaultMethod() = runBlocking {
val api = retrofit.create(ChangellyAPIService::class.java)
val response = api.getFixRate("eth", "btc")
Assert.assertEquals(response.code(), 200)
}

@Test
fun testChandllyExchangeAmountFix() = runBlocking {
val api = retrofit.create(ChangellyAPIService::class.java)
val response = api.exchangeAmountFix("eth", "btc", BigDecimal.ONE)
Assert.assertEquals(response.code(), 200)
}
}
7 changes: 1 addition & 6 deletions mbw/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@
<activity
android:name=".activity.modern.ModernMain"
android:exported="true"
android:windowSoftInputMode="adjustNothing"
android:theme="@style/MyceliumActionBar">
<intent-filter android:label="Exchange">
<action android:name="action.CHANGELLY" />
Expand Down Expand Up @@ -212,9 +213,6 @@
android:name=".activity.receive.ReceiveCoinsActivity"
android:theme="@style/MyceliumFIOMapping" />
<activity android:name=".simplex.SimplexMainActivity" />
<activity
android:name=".external.changelly.ChangellyActivity"
android:screenOrientation="portrait" />
<activity android:name=".external.changelly.ChangellyOfferActivity" />
<activity
android:name=".lt.activity.LtMainActivity"
Expand Down Expand Up @@ -284,9 +282,6 @@
<activity android:name=".external.BuySellSelectCountryActivity"/>
<activity android:name=".external.BuySellBankCardActivity"/>
<activity android:name=".activity.MessageVerifyActivity" />
<activity
android:name=".external.changelly.bch.ExchangeActivity"
android:theme="@style/MyceliumExchange" />
<activity
android:name=".activity.settings.SetSegwitChangeActivity"
android:theme="@style/MyceliumSettings" />
Expand Down
Binary file added mbw/src/main/assets/token-logos/cake_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 9 additions & 1 deletion mbw/src/main/java/com/mycelium/bequant/InvestmentAccount.kt
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ class InvestmentAccount : WalletAccount<BtcAddress> {
TODO("Not yet implemented")
}

override fun createTx(
outputs: List<Pair<Address, Value>>,
fee: Fee,
data: TransactionData?
): Transaction {
TODO("Not yet implemented")
}

override fun canSign(): Boolean {
TODO("Not yet implemented")
}
Expand Down Expand Up @@ -203,4 +211,4 @@ class InvestmentAccount : WalletAccount<BtcAddress> {
}

override fun interruptSync() {}
}
}
16 changes: 16 additions & 0 deletions mbw/src/main/java/com/mycelium/bequant/remote/model/UserStatus.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.mycelium.bequant.remote.model

enum class UserStatus {
VIP,
REGULAR;

fun isVIP() = this == VIP

companion object {
fun fromName(name: String?) = when (name) {
VIP.name -> VIP
REGULAR.name -> REGULAR
else -> null
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.mycelium.bequant.remote.repositories


object Api {
val accountRepository by lazy { AccountApiRepository() }
val publicRepository by lazy { PublicApiRepository() }
Expand Down
78 changes: 78 additions & 0 deletions mbw/src/main/java/com/mycelium/wallet/UserKeysManager.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
/*
* Copyright 2013, 2014 Megion Research and Development GmbH
*
* Licensed under the Microsoft Reference Source License (MS-RSL)
*
* This license governs use of the accompanying software. If you use the software, you accept this license.
* If you do not accept the license, do not use the software.
*
* 1. Definitions
* The terms "reproduce," "reproduction," and "distribution" have the same meaning here as under U.S. copyright law.
* "You" means the licensee of the software.
* "Your company" means the company you worked for when you downloaded the software.
* "Reference use" means use of the software within your company as a reference, in read only form, for the sole purposes
* of debugging your products, maintaining your products, or enhancing the interoperability of your products with the
* software, and specifically excludes the right to distribute the software outside of your company.
* "Licensed patents" means any Licensor patent claims which read directly on the software as distributed by the Licensor
* under this license.
*
* 2. Grant of Rights
* (A) Copyright Grant- Subject to the terms of this license, the Licensor grants you a non-transferable, non-exclusive,
* worldwide, royalty-free copyright license to reproduce the software for reference use.
* (B) Patent Grant- Subject to the terms of this license, the Licensor grants you a non-transferable, non-exclusive,
* worldwide, royalty-free patent license under licensed patents for reference use.
*
* 3. Limitations
* (A) No Trademark License- This license does not grant you any rights to use the Licensor’s name, logo, or trademarks.
* (B) If you begin patent litigation against the Licensor over patents that you think may apply to the software
* (including a cross-claim or counterclaim in a lawsuit), your license to the software ends automatically.
* (C) The software is licensed "as-is." You bear the risk of using it. The Licensor gives no express warranties,
* guarantees or conditions. You may have additional consumer rights under your local laws which this license cannot
* change. To the extent permitted under your local laws, the Licensor excludes the implied warranties of merchantability,
* fitness for a particular purpose and non-infringement.
*/
package com.mycelium.wallet

import com.mycelium.wapi.wallet.AesKeyCipher
import org.bouncycastle.crypto.AsymmetricCipherKeyPair
import org.bouncycastle.crypto.digests.SHA256Digest
import org.bouncycastle.crypto.generators.ECKeyPairGenerator
import org.bouncycastle.crypto.generators.HKDFBytesGenerator
import org.bouncycastle.crypto.params.ECDomainParameters
import org.bouncycastle.crypto.params.ECKeyGenerationParameters
import org.bouncycastle.crypto.params.HKDFParameters
import org.bouncycastle.crypto.prng.FixedSecureRandom
import org.bouncycastle.jce.ECNamedCurveTable
import org.bouncycastle.jce.provider.BouncyCastleProvider
import java.security.Security


object UserKeysManager {
private val mbwManger = MbwManager.getInstance(WalletApplication.getInstance())
val userSignKeys = getDeterministicECKeyPair()
private fun getDeterministicECKeyPair(): AsymmetricCipherKeyPair {
val keyCipher = AesKeyCipher.defaultKeyCipher()
val accountManager = mbwManger.masterSeedManager.getIdentityAccountKeyManager(keyCipher)
val accountPublicKey = accountManager.getPrivateKeyForWebsite(WEBSITE, keyCipher).publicKey
val seed = accountPublicKey.publicKeyBytes
if (Security.getProvider(BouncyCastleProvider.PROVIDER_NAME) == null) {
Security.addProvider(BouncyCastleProvider())
}
// generate determine asymmetric keys using account seed as random seed
val hkdfGenerator = HKDFBytesGenerator(SHA256Digest())
hkdfGenerator.init(HKDFParameters(seed, null, ByteArray(0)))
val privateKeyBytes = ByteArray(32)
hkdfGenerator.generateBytes(privateKeyBytes, 0, privateKeyBytes.size)

val ecSpec = ECNamedCurveTable.getParameterSpec("secp256k1")
val domainParameters = ECDomainParameters(ecSpec.curve, ecSpec.g, ecSpec.n, ecSpec.h)
val random = FixedSecureRandom(privateKeyBytes)

val keyGenParams = ECKeyGenerationParameters(domainParameters, random)
val keyPairGenerator = ECKeyPairGenerator()
keyPairGenerator.init(keyGenParams)
return keyPairGenerator.generateKeyPair()
}

private const val WEBSITE = "changelly-viper.mycelium.com"
}
4 changes: 3 additions & 1 deletion mbw/src/main/java/com/mycelium/wallet/WalletConfiguration.kt
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ class WalletConfiguration(private val prefs: SharedPreferences,
TokenData("yearn.finance", "YFI", 18, "0x0bc529c00C6401aEF6D220BE8C6Ea1667F6Ad93e"),
TokenData("The Graph", "GRT", 18, "0xc944E90C64B2c07662A292be6244BDf05Cda44a7"),
TokenData("Civic", "CVC", 8, "0x41e5560054824eA6B0732E656E3Ad64E20e94E45"),
TokenData("Gala", "GALA", 8, "0x15D4c048F83bd7e37d49eA4C83a07267Ec4203dA"),
TokenData("Gala", "GALA", 8, "0xd1d2eb1b1e90b638588728b4130137d262c87cae"),
TokenData("Illuvium", "ILV", 18, "0x767FE9EDC9E0dF98E07454847909b5E959D7ca0E"),
TokenData("SushiToken", "SUSHI", 18, "0x6B3595068778DD592e39A122f4f5a5cF09C90fE2"),
TokenData("1INCH Token", "1INCH", 18, "0x111111111117dC0aa78b770fA6A738034120C302"),
Expand All @@ -611,7 +611,9 @@ class WalletConfiguration(private val prefs: SharedPreferences,
TokenData("Request", "REQ", 18, "0x8f8221afbb33998d8584a2b05749ba73c37a938a"),
TokenData("UMA", "UMA", 18, "0x04Fa0d235C4abf4BcF4787aF4CF447DE572eF828"),
TokenData("Viberate", "vib", 18, "0x2C974B2d0BA1716E644c1FC59982a89DDD2fF724"),
TokenData("PancakeSwap Token", "CAKE", 18, "0x152649eA73beAb28c5b49B26eb48f7EAD6d4c898"),
TokenData("district0x", "dnt", 18, "0x0abdace70d3790235af448c88547603b945604ea")

)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,12 @@ class BuySellFragment : Fragment(), ButtonClickListener {
binding?.quadList?.adapter = quadAdapter
binding?.quadList?.addOnScrollListener(ItemCentralizer())
recreateActions()
quadAdapter.submitList(getBalanceContent()?.quads?.sortedBy { it.index })
quadAdapter.submitList(getBalanceContent()
?.quads
?.filter {
it.isActive() && isContentEnabled(it.parentId ?: "")
&& it.filter.check(mbwManager.selectedAccount)
}?.sortedBy { it.index })
quadAdapter.clickListener = { startContentLink(it.link) }
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,11 @@
import java.util.Set;

import static android.content.Context.MODE_PRIVATE;
import static com.mycelium.wallet.external.changelly.bch.ExchangeFragment.BCH_EXCHANGE;
import static com.mycelium.wallet.external.changelly.bch.ExchangeFragment.BCH_EXCHANGE_TRANSACTIONS;
import static com.mycelium.wallet.activity.send.SendCoinsActivity.BATCH_HASH_PREFIX;

public class TransactionArrayAdapter extends ArrayAdapter<TransactionSummary> {
public static final String BCH_EXCHANGE = "bch_exchange";
public static final String BCH_EXCHANGE_TRANSACTIONS = "bch_exchange_transactions";
private final MetadataStorage _storage;
protected Context _context;
private DateFormat _dateFormat;
Expand Down Expand Up @@ -134,6 +135,9 @@ public View getView(final int position, View convertView, ViewGroup parent) {

TextView tvFiatTimed = rowView.findViewById(R.id.tvFiatAmountTimed);
String value = transactionFiatValuePref.getString(record.getIdHex(), null);
if (value == null && !record.isIncoming()) {
value = transactionFiatValuePref.getString(BATCH_HASH_PREFIX + record.getIdHex(), null);
}
boolean showFiatTimed = value != null && !TransactionSummaryKt.isMinerFeeTx(record, _mbwManager.getSelectedAccount());
tvFiatTimed.setVisibility(showFiatTimed ? View.VISIBLE : View.GONE);
if (value != null) {
Expand Down
Loading