Skip to content

Commit adcc15c

Browse files
authored
Merge pull request #383 from soramitsu/rc/1.9.4
Rc/1.9.4
2 parents 5e5a0f8 + 6169ce1 commit adcc15c

File tree

245 files changed

+4915
-2543
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

245 files changed

+4915
-2543
lines changed

README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,9 @@ To build Fearless Wallet Android project, you need to provide several keys eithe
2121
``` properties
2222
MOONPAY_TEST_SECRET=stub
2323
MOONPAY_PRODUCTION_SECRET=stub
24-
SUBSCAN_API_KEY=
2524
```
2625

2726
Note, that with stub keys buy via moonpay will not work correctly. However, other parts of application will not be affected.
2827

29-
If you will leave SUBSCAN_API_KEY value empty, you will have very strict limits for the subscan api requests. If you want to increase the limits, check the [Subscan website](https://docs.api.subscan.io/#introduction) and then add the api key to the 'local.properties' -> SUBSCAN_API_KEY=YOUR_API_KEY
30-
3128
## License
3229
Fearless Wallet Android is available under the Apache 2.0 license. See the LICENSE file for more info.

app/src/main/java/jp/co/soramitsu/app/root/navigation/Navigator.kt

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,13 @@ import jp.co.soramitsu.feature_staking_impl.presentation.validators.parcel.Valid
6565
import jp.co.soramitsu.feature_wallet_api.domain.model.Token
6666
import jp.co.soramitsu.feature_wallet_impl.presentation.WalletRouter
6767
import jp.co.soramitsu.feature_wallet_impl.presentation.balance.detail.BalanceDetailFragment
68-
import jp.co.soramitsu.feature_wallet_impl.presentation.model.TransactionModel
68+
import jp.co.soramitsu.feature_wallet_impl.presentation.model.OperationParcelizeModel
6969
import jp.co.soramitsu.feature_wallet_impl.presentation.send.TransferDraft
7070
import jp.co.soramitsu.feature_wallet_impl.presentation.send.amount.ChooseAmountFragment
7171
import jp.co.soramitsu.feature_wallet_impl.presentation.send.confirm.ConfirmTransferFragment
72-
import jp.co.soramitsu.feature_wallet_impl.presentation.transaction.detail.TransactionDetailFragment
72+
import jp.co.soramitsu.feature_wallet_impl.presentation.transaction.detail.extrinsic.ExtrinsicDetailFragment
73+
import jp.co.soramitsu.feature_wallet_impl.presentation.transaction.detail.reward.RewardDetailFragment
74+
import jp.co.soramitsu.feature_wallet_impl.presentation.transaction.detail.transfer.TransferDetailFragment
7375
import jp.co.soramitsu.splash.SplashRouter
7476
import kotlinx.android.parcel.Parcelize
7577
import kotlinx.coroutines.flow.Flow
@@ -345,6 +347,10 @@ class Navigator :
345347
navController?.navigate(R.id.action_open_send)
346348
}
347349

350+
override fun openFilter() {
351+
navController?.navigate(R.id.action_mainFragment_to_filterFragment)
352+
}
353+
348354
override fun openChooseAmount(recipientAddress: String) {
349355
val bundle = ChooseAmountFragment.getBundle(recipientAddress)
350356

@@ -367,10 +373,22 @@ class Navigator :
367373
navController?.navigate(R.id.openSelectAmount, bundle)
368374
}
369375

370-
override fun openTransactionDetail(transaction: TransactionModel) {
371-
val bundle = TransactionDetailFragment.getBundle(transaction)
376+
override fun openTransferDetail(transaction: OperationParcelizeModel.Transfer) {
377+
val bundle = TransferDetailFragment.getBundle(transaction)
378+
379+
navController?.navigate(R.id.open_transfer_detail, bundle)
380+
}
381+
382+
override fun openRewardDetail(reward: OperationParcelizeModel.Reward) {
383+
val bundle = RewardDetailFragment.getBundle(reward)
384+
385+
navController?.navigate(R.id.open_reward_detail, bundle)
386+
}
387+
388+
override fun openExtrinsicDetail(extrinsic: OperationParcelizeModel.Extrinsic) {
389+
val bundle = ExtrinsicDetailFragment.getBundle(extrinsic)
372390

373-
navController?.navigate(R.id.open_transaction_detail, bundle)
391+
navController?.navigate(R.id.open_extrinsic_detail, bundle)
374392
}
375393

376394
override fun openAccounts(accountChosenNavDirection: AccountChosenNavDirection) {

app/src/main/res/navigation/main_nav_graph.xml

Lines changed: 47 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,24 @@
2222
app:popExitAnim="@anim/fragment_close_exit" />
2323

2424
<action
25-
android:id="@+id/open_transaction_detail"
26-
app:destination="@id/transactionDetailFragment"
25+
android:id="@+id/open_transfer_detail"
26+
app:destination="@id/transferDetailFragment"
27+
app:enterAnim="@anim/fragment_open_enter"
28+
app:exitAnim="@anim/fragment_open_exit"
29+
app:popEnterAnim="@anim/fragment_close_enter"
30+
app:popExitAnim="@anim/fragment_close_exit" />
31+
32+
<action
33+
android:id="@+id/open_reward_detail"
34+
app:destination="@id/rewardDetailFragment"
35+
app:enterAnim="@anim/fragment_open_enter"
36+
app:exitAnim="@anim/fragment_open_exit"
37+
app:popEnterAnim="@anim/fragment_close_enter"
38+
app:popExitAnim="@anim/fragment_close_exit" />
39+
40+
<action
41+
android:id="@+id/open_extrinsic_detail"
42+
app:destination="@id/extrinsicDetailFragment"
2743
app:enterAnim="@anim/fragment_open_enter"
2844
app:exitAnim="@anim/fragment_open_exit"
2945
app:popEnterAnim="@anim/fragment_close_enter"
@@ -283,10 +299,22 @@
283299

284300

285301
<fragment
286-
android:id="@+id/transactionDetailFragment"
287-
android:name="jp.co.soramitsu.feature_wallet_impl.presentation.transaction.detail.TransactionDetailFragment"
288-
android:label="TransactionDetailFragment"
289-
tools:layout="@layout/fragment_transaction_details" />
302+
android:id="@+id/transferDetailFragment"
303+
android:name="jp.co.soramitsu.feature_wallet_impl.presentation.transaction.detail.transfer.TransferDetailFragment"
304+
android:label="TransferDetailFragment"
305+
tools:layout="@layout/fragment_transfer_details" />
306+
307+
<fragment
308+
android:id="@+id/extrinsicDetailFragment"
309+
android:name="jp.co.soramitsu.feature_wallet_impl.presentation.transaction.detail.extrinsic.ExtrinsicDetailFragment"
310+
android:label="ExtrinsicDetailFragment"
311+
tools:layout="@layout/fragment_extrinsic_details" />
312+
313+
<fragment
314+
android:id="@+id/rewardDetailFragment"
315+
android:name="jp.co.soramitsu.feature_wallet_impl.presentation.transaction.detail.reward.RewardDetailFragment"
316+
android:label="RewardDetailFragment"
317+
tools:layout="@layout/fragment_reward_slash_details" />
290318

291319
<action
292320
android:id="@+id/openSelectAmount"
@@ -332,6 +360,19 @@
332360
app:popExitAnim="@anim/fragment_close_exit" />
333361
</fragment>
334362

363+
<action
364+
android:id="@+id/action_mainFragment_to_filterFragment"
365+
app:destination="@id/transactionHistoryFilterFragment"
366+
app:enterAnim="@anim/fragment_open_enter"
367+
app:exitAnim="@anim/fragment_open_exit"
368+
app:popEnterAnim="@anim/fragment_close_enter"
369+
app:popExitAnim="@anim/fragment_close_exit" />
370+
371+
<fragment
372+
android:id="@+id/transactionHistoryFilterFragment"
373+
android:name="jp.co.soramitsu.feature_wallet_impl.presentation.transaction.filter.TransactionHistoryFilterFragment"
374+
android:label="TransactionHistoryFilterFragment"/>
375+
335376
<fragment
336377
android:id="@+id/confirmTransferFragment"
337378
android:name="jp.co.soramitsu.feature_wallet_impl.presentation.send.confirm.ConfirmTransferFragment"

build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
buildscript {
22
ext {
33
// App version
4-
versionName = '1.9.0'
5-
versionCode = 20
4+
versionName = '1.9.4'
5+
versionCode = 24
66

77
// SDK and tools
88
compileSdkVersion = 29
@@ -42,7 +42,7 @@ buildscript {
4242

4343
bouncyCastleVersion = '1.60'
4444

45-
fearlessLibVersion = '1.0.75'
45+
fearlessLibVersion = '1.0.77'
4646

4747
gifVersion = '1.2.19'
4848

common/build.gradle

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,13 @@ android {
2121

2222
buildConfigField "String", "TWITTER_ACCOUNT_TEMPLATE", "\"https://twitter.com/%s\""
2323

24-
buildConfigField "String", "ROADMAP_URL", "\"https://soramitsucoltd.aha.io/shared/97bc3006ee3c1baa0598863615cf8d14\""
25-
buildConfigField "String", "DEV_STATUS_URL", "\"https://soramitsucoltd.aha.io/shared/343e5db57d53398e3f26d0048158c4a2\""
26-
2724
buildConfigField "String", "SUBSCAN_TRANSACTION_TEMPLATE", "\"https://%1\$s.subscan.io/extrinsic/%2\$s\""
2825
buildConfigField "String", "SUBSCAN_ACCOUNT_TEMPLATE", "\"https://%1\$s.subscan.io/account/%2\$s\""
2926

3027
buildConfigField "String", "POLKSASCAN_TRANSACTION_TEMPLATE", "\"https://polkascan.io/%1\$s/extrinsic/%2\$s\""
3128
buildConfigField "String", "POLKSASCAN_ACCOUNT_TEMPLATE", "\"https://polkascan.io/%1\$s/account/%2\$s\""
29+
buildConfigField "String", "POLKSASCAN_EVENT_TEMPLATE", "\"https://polkascan.io/%1\$s/event/%2\$s\""
3230

33-
buildConfigField "String", "NOMINATOR_LEARN_MORE", "\"https://wiki.polkadot.network/docs/en/learn-nominator\""
3431
buildConfigField "String", "PAYOUTS_LEARN_MORE", "\"https://wiki.polkadot.network/docs/en/learn-simple-payouts\""
3532

3633
buildConfigField "String", "SET_CONTROLLER_LEARN_MORE", "\"https://wiki.polkadot.network/docs/en/maintain-guides-how-to-nominate-polkadot#setting-up-stash-and-controller-keys\""

common/src/main/java/jp/co/soramitsu/common/address/AddressIconGenerator.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ class AddressIconGenerator(
1515
companion object {
1616
const val SIZE_SMALL = 18
1717
const val SIZE_MEDIUM = 24
18+
const val SIZE_BIG = 32
1819
}
1920

2021
@Throws(AddressFormatException::class)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
package jp.co.soramitsu.common.data.model
2+
3+
data class CursorPage<T>(
4+
val nextCursor: String?,
5+
val items: List<T>
6+
) : List<T> by items

common/src/main/java/jp/co/soramitsu/common/data/network/AppLinksProvider.kt

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,44 +9,46 @@ class AppLinksProvider(
99

1010
private val externalAnalyzerTemplates: Map<ExternalAnalyzer, ExternalAnalyzerLinks>,
1111

12-
val roadMapUrl: String,
13-
val devStatusUrl: String,
14-
15-
val nominatorLearnMore: String,
1612
val payoutsLearnMore: String,
1713
val twitterAccountTemplate: String,
1814
val setControllerLearnMore: String
1915
) {
2016

17+
fun getExternalEventUrl(
18+
analyzer: ExternalAnalyzer,
19+
eventId: String,
20+
networkType: Node.NetworkType
21+
) = getExternalUrl(analyzer, eventId, networkType, ExternalAnalyzerLinks::event)
22+
2123
fun getExternalTransactionUrl(
2224
analyzer: ExternalAnalyzer,
2325
hash: String,
2426
networkType: Node.NetworkType
25-
) = getExternalUrl(analyzer, hashWithPrefix(hash), networkType, ExternalAnalyzerLinks::transaction)
27+
) = getExternalUrl(analyzer, hashWithPrefix(hash), networkType, ExternalAnalyzerLinks::transaction)!!
2628

2729
fun getExternalAddressUrl(
2830
analyzer: ExternalAnalyzer,
2931
address: String,
3032
networkType: Node.NetworkType
31-
) = getExternalUrl(analyzer, address, networkType, ExternalAnalyzerLinks::account)
33+
) = getExternalUrl(analyzer, address, networkType, ExternalAnalyzerLinks::account)!!
3234

3335
private fun getExternalUrl(
3436
analyzer: ExternalAnalyzer,
3537
value: String,
3638
networkType: Node.NetworkType,
37-
extractor: (ExternalAnalyzerLinks) -> String
38-
): String {
39+
extractor: (ExternalAnalyzerLinks) -> String?
40+
): String? {
3941
val template = externalAnalyzerTemplates[analyzer] ?: error("No template for $analyzer")
4042

41-
return extractor(template).format(networkPathSegment(networkType), value)
43+
return extractor(template)?.format(networkPathSegment(networkType), value)
4244
}
4345

4446
fun getTwitterAccountUrl(
4547
accountName: String
4648
): String = twitterAccountTemplate.format(accountName)
4749
}
4850

49-
class ExternalAnalyzerLinks(val transaction: String, val account: String)
51+
class ExternalAnalyzerLinks(val transaction: String, val account: String, val event: String?)
5052

5153
enum class ExternalAnalyzer(val supportedNetworks: List<Node.NetworkType>) {
5254
SUBSCAN(
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package jp.co.soramitsu.common.data.network.coingecko
2+
3+
import com.google.gson.annotations.SerializedName
4+
import java.math.BigDecimal
5+
6+
class PriceInfo(
7+
@SerializedName("usd")
8+
val price: BigDecimal,
9+
@SerializedName("usd_24h_change")
10+
val rateChange: BigDecimal
11+
)

common/src/main/java/jp/co/soramitsu/common/data/network/runtime/binding/Constants.kt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,14 @@ import java.math.BigInteger
99
fun bindNumberConstant(
1010
constant: Constant,
1111
runtime: RuntimeSnapshot
12-
): BigInteger {
12+
): BigInteger = bindNullableNumberConstant(constant, runtime) ?: incompatible()
13+
14+
@HelperBinding
15+
fun bindNullableNumberConstant(
16+
constant: Constant,
17+
runtime: RuntimeSnapshot
18+
): BigInteger? {
1319
val decoded = constant.type?.fromByteArrayOrNull(runtime, constant.value) ?: incompatible()
1420

15-
return decoded as? BigInteger ?: incompatible()
21+
return decoded as BigInteger?
1622
}

0 commit comments

Comments
 (0)