Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into version/0.38
Browse files Browse the repository at this point in the history
# Conflicts:
#	app/build.gradle
  • Loading branch information
abdrasulov committed Jan 5, 2024
2 parents 82232ad + ac88f82 commit 8ed400d
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ android {
compileSdk compile_sdk_version
minSdkVersion min_sdk_version
targetSdkVersion compile_sdk_version
versionCode 94
versionCode 95
versionName "0.38.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,11 @@ class TonAdapter(
is AccountType.Mnemonic -> {
val hdWallet = HDWallet(accountType.seed, 607, HDWallet.Purpose.BIP44, Curve.Ed25519)
val privateKey = hdWallet.privateKey(0)
tonKitFactory.create(privateKey.privKeyBytes, wallet.account.id)
var privateKeyBytes = privateKey.privKeyBytes
if (privateKeyBytes.size > 32) {
privateKeyBytes = privateKeyBytes.copyOfRange(1, privateKeyBytes.size)
}
tonKitFactory.create(privateKeyBytes, wallet.account.id)
}

is AccountType.TonAddress -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,11 @@ class AddressUriParser(private val blockchainType: BlockchainType?, private val
uriBuilder.appendQueryParameter(key, value)
}

return uriBuilder.build().toString().replace("/", "")
return uriBuilder
.build()
.toString()
.replace("/", "")
.replace("%3A", ":")
}

companion object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ fun HSAddressInput(
FormsInputAddress(
modifier = modifier,
value = viewModel.value,
hint = stringResource(id = R.string.Watch_Address_Hint),
hint = stringResource(id = R.string.Send_Hint_Address),
state = viewModel.inputState,
textPreprocessor = textPreprocessor,
navController = navController,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,8 +339,10 @@ private fun ActionButtonsRow(
.padding(horizontal = 48.dp),
horizontalArrangement = if (watchAccount) Arrangement.Center else Arrangement.SpaceBetween,
) {
val itemModifier = if(watchAccount) Modifier else Modifier.weight(1f)
if (!watchAccount) {
ReceiveActionButton(
modifier = itemModifier,
icon = R.drawable.ic_edit_24px,
buttonText = stringResource(R.string.Button_SetAmount),
onClick = {
Expand All @@ -349,6 +351,7 @@ private fun ActionButtonsRow(
)
}
ReceiveActionButton(
modifier = itemModifier,
icon = R.drawable.ic_share_24px,
buttonText = stringResource(R.string.Button_Share),
onClick = {
Expand All @@ -359,6 +362,7 @@ private fun ActionButtonsRow(
HSpacer(64.dp)
}
ReceiveActionButton(
modifier = itemModifier,
icon = R.drawable.ic_copy_24px,
buttonText = stringResource(R.string.Button_Copy),
onClick = {
Expand Down Expand Up @@ -456,13 +460,16 @@ private fun AdditionalDataSection(
}
}


@Composable
private fun ReceiveActionButton(
modifier: Modifier,
icon: Int,
buttonText: String,
onClick: () -> Unit,
) {
Column(
modifier = modifier,
horizontalAlignment = Alignment.CenterHorizontally,
) {
ButtonPrimaryCircle(
Expand All @@ -472,6 +479,7 @@ private fun ReceiveActionButton(
caption_grey(
modifier = Modifier.padding(top = 8.dp),
text = buttonText,
textAlign = TextAlign.Center,
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,9 @@ class ReceiveAddressViewModel(
addressUri.address = newUri
addressUri.parameters[AddressUri.Field.amountField(wallet.token.blockchainType)] = it.toString()
addressUri.parameters[AddressUri.Field.BlockchainUid] = wallet.token.blockchainType.uid
addressUri.parameters[AddressUri.Field.TokenUid] = wallet.token.type.id
if (wallet.token.type !is TokenType.Derived && wallet.token.type !is TokenType.AddressTyped) {
addressUri.parameters[AddressUri.Field.TokenUid] = wallet.token.type.id
}
newUri = parser.uri(addressUri)
}

Expand Down

0 comments on commit 8ed400d

Please sign in to comment.