diff --git a/blockchain/build.gradle b/blockchain/build.gradle index 6e6b6c47..38531d2c 100644 --- a/blockchain/build.gradle +++ b/blockchain/build.gradle @@ -108,8 +108,8 @@ dependencies { implementation files('libs/hedera-sdk-java-2.29.0.jar') implementation "com.tangem:blstlib:master-6@aar" - implementation "com.tangem:wallet-core:4.0.46-tangem1@aar" - implementation("com.tangem:wallet-core-proto:4.0.46-tangem1") { + implementation "com.tangem:wallet-core:4.0.46-tangem4@aar" + implementation("com.tangem:wallet-core-proto:4.0.46-tangem4") { exclude group: 'com.google.protobuf', module: 'protobuf-javalite' } diff --git a/blockchain/src/main/java/com/tangem/blockchain/blockchains/ton/TonTransactionBuilder.kt b/blockchain/src/main/java/com/tangem/blockchain/blockchains/ton/TonTransactionBuilder.kt index 5f7ca776..84af70b9 100644 --- a/blockchain/src/main/java/com/tangem/blockchain/blockchains/ton/TonTransactionBuilder.kt +++ b/blockchain/src/main/java/com/tangem/blockchain/blockchains/ton/TonTransactionBuilder.kt @@ -2,11 +2,11 @@ package com.tangem.blockchain.blockchains.ton import com.google.protobuf.ByteString import com.tangem.blockchain.common.* +import com.tangem.blockchain.extensions.Result import com.tangem.common.KeyPair import com.tangem.common.card.EllipticCurve import com.tangem.crypto.CryptoUtils import wallet.core.jni.proto.TheOpenNetwork -import com.tangem.blockchain.extensions.Result internal class TonTransactionBuilder(private val walletAddress: String) { @@ -73,7 +73,7 @@ internal class TonTransactionBuilder(private val walletAddress: String) { val jettonTransfer = TheOpenNetwork.JettonTransfer.newBuilder() .setTransfer(transfer) - .setJettonAmount(amount.longValueOrZero) + .setJettonAmount(ByteString.copyFrom(amount.byteArrayValue)) .setToOwner(destination) .setResponseAddress(walletAddress) .setForwardAmount(1) // some amount needed to send "jetton transfer notification", use minimum diff --git a/blockchain/src/main/java/com/tangem/blockchain/common/Amount.kt b/blockchain/src/main/java/com/tangem/blockchain/common/Amount.kt index 0a8f370d..0133df08 100644 --- a/blockchain/src/main/java/com/tangem/blockchain/common/Amount.kt +++ b/blockchain/src/main/java/com/tangem/blockchain/common/Amount.kt @@ -17,6 +17,8 @@ data class Amount( // Be careful! The property may overflow if the decimals are much larger than the long value. val longValueOrZero: Long by lazy { value?.movePointRight(decimals)?.toLong() ?: 0L } + val byteArrayValue: ByteArray? by lazy { value?.movePointRight(decimals)?.toBigInteger()?.toByteArray() } + constructor( value: BigDecimal?, blockchain: Blockchain,