From deb06e0fe9513257ec1fc1c9f2c5f99c8ae5e9b1 Mon Sep 17 00:00:00 2001 From: Ilya Shulgin Date: Fri, 3 Nov 2023 09:50:11 +0200 Subject: [PATCH 1/6] AND-5167 Added NEAR to approximate fee list. --- .../src/main/java/com/tangem/blockchain/common/Blockchain.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/blockchain/src/main/java/com/tangem/blockchain/common/Blockchain.kt b/blockchain/src/main/java/com/tangem/blockchain/common/Blockchain.kt index a5db120a1..4d75efb69 100644 --- a/blockchain/src/main/java/com/tangem/blockchain/common/Blockchain.kt +++ b/blockchain/src/main/java/com/tangem/blockchain/common/Blockchain.kt @@ -400,6 +400,7 @@ enum class Blockchain( Stellar, StellarTestnet, Optimism, OptimismTestnet, TON, TONTestnet, + Near, NearTestnet -> true else -> false From d7414e8346ad31ed051bd80a3c1fc89ee23891f2 Mon Sep 17 00:00:00 2001 From: Ilya Shulgin Date: Fri, 3 Nov 2023 10:12:02 +0200 Subject: [PATCH 2/6] AND-5169 Changed NEAR derivation path. --- .../tangem/blockchain/common/derivation/DerivationConfigV1.kt | 2 +- .../tangem/blockchain/common/derivation/DerivationConfigV2.kt | 2 +- .../tangem/blockchain/common/derivation/DerivationConfigV3.kt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/blockchain/src/main/java/com/tangem/blockchain/common/derivation/DerivationConfigV1.kt b/blockchain/src/main/java/com/tangem/blockchain/common/derivation/DerivationConfigV1.kt index 7d2813cb3..1e357c5a4 100644 --- a/blockchain/src/main/java/com/tangem/blockchain/common/derivation/DerivationConfigV1.kt +++ b/blockchain/src/main/java/com/tangem/blockchain/common/derivation/DerivationConfigV1.kt @@ -144,7 +144,7 @@ object DerivationConfigV1 : DerivationConfig() { mapOf(AddressType.Default to DerivationPath("m/44'/977'/0'/0/0")) } Blockchain.Near -> { - mapOf(AddressType.Default to DerivationPath("m/44'/397'/0'/0/0")) + mapOf(AddressType.Default to DerivationPath("m/44'/397'/0'")) } Blockchain.Chia, Blockchain.ChiaTestnet -> mapOf(AddressType.Default to DerivationPath("")) diff --git a/blockchain/src/main/java/com/tangem/blockchain/common/derivation/DerivationConfigV2.kt b/blockchain/src/main/java/com/tangem/blockchain/common/derivation/DerivationConfigV2.kt index 2450e576f..cb17c9bb9 100644 --- a/blockchain/src/main/java/com/tangem/blockchain/common/derivation/DerivationConfigV2.kt +++ b/blockchain/src/main/java/com/tangem/blockchain/common/derivation/DerivationConfigV2.kt @@ -120,7 +120,7 @@ object DerivationConfigV2 : DerivationConfig() { mapOf(AddressType.Default to DerivationPath("m/44'/330'/0'/0/0")) } Blockchain.Near -> { - mapOf(AddressType.Default to DerivationPath("m/44'/397'/0'/0/0")) + mapOf(AddressType.Default to DerivationPath("m/44'/397'/0'")) } Blockchain.Chia, Blockchain.ChiaTestnet -> mapOf(AddressType.Default to DerivationPath("")) diff --git a/blockchain/src/main/java/com/tangem/blockchain/common/derivation/DerivationConfigV3.kt b/blockchain/src/main/java/com/tangem/blockchain/common/derivation/DerivationConfigV3.kt index e3c924536..8d2a2590b 100644 --- a/blockchain/src/main/java/com/tangem/blockchain/common/derivation/DerivationConfigV3.kt +++ b/blockchain/src/main/java/com/tangem/blockchain/common/derivation/DerivationConfigV3.kt @@ -119,7 +119,7 @@ object DerivationConfigV3 : DerivationConfig() { mapOf(AddressType.Default to DerivationPath("m/44'/330'/0'/0/0")) } Blockchain.Near -> { - mapOf(AddressType.Default to DerivationPath("m/44'/397'/0'/0/0")) + mapOf(AddressType.Default to DerivationPath("m/44'/397'/0'")) } Blockchain.Chia, Blockchain.ChiaTestnet -> mapOf(AddressType.Default to DerivationPath("")) From 1fe608327697036a86b67514e9f13f471ee9f50c Mon Sep 17 00:00:00 2001 From: Ilya Shulgin Date: Fri, 3 Nov 2023 11:25:54 +0200 Subject: [PATCH 3/6] AND-5172 Fixed display of NEAR empty amount. --- .../com/tangem/blockchain/blockchains/near/NearWalletManager.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/blockchain/src/main/java/com/tangem/blockchain/blockchains/near/NearWalletManager.kt b/blockchain/src/main/java/com/tangem/blockchain/blockchains/near/NearWalletManager.kt index b04916a1a..0a38865d8 100644 --- a/blockchain/src/main/java/com/tangem/blockchain/blockchains/near/NearWalletManager.kt +++ b/blockchain/src/main/java/com/tangem/blockchain/blockchains/near/NearWalletManager.kt @@ -55,6 +55,7 @@ class NearWalletManager( wallet.setReserveValue(NearAmount.DEPOSIT_VALUE) } else { wallet.setReserveValue(amountValue) + wallet.setAmount(Amount(BigDecimal.ZERO, wallet.blockchain)) } } From 85438a328f7880d393517fee427f3b19f814d903 Mon Sep 17 00:00:00 2001 From: Ilya Shulgin Date: Fri, 3 Nov 2023 11:50:21 +0200 Subject: [PATCH 4/6] AND-5165 Fixed NEAR decimals. --- .../main/java/com/tangem/blockchain/common/Blockchain.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/blockchain/src/main/java/com/tangem/blockchain/common/Blockchain.kt b/blockchain/src/main/java/com/tangem/blockchain/common/Blockchain.kt index 4d75efb69..d35685874 100644 --- a/blockchain/src/main/java/com/tangem/blockchain/common/Blockchain.kt +++ b/blockchain/src/main/java/com/tangem/blockchain/common/Blockchain.kt @@ -102,8 +102,7 @@ enum class Blockchain( fun decimals(): Int = when (this) { Unknown -> 0 - Near, NearTestnet, - -> 5 + Cardano, XRP, Tezos, @@ -149,6 +148,9 @@ enum class Blockchain( Telos, TelosTestnet, OctaSpace, OctaSpaceTestnet, -> 18 + + Near, NearTestnet, + -> 24 } fun makeAddresses( From 454e0fe650ba1d0887816282a6f7eaf1626244cb Mon Sep 17 00:00:00 2001 From: Ilya Shulgin Date: Fri, 3 Nov 2023 13:51:03 +0200 Subject: [PATCH 5/6] AND-5171 Temporarily excluded infura from NEAR network providers list. --- .../common/assembly/impl/NearWalletManagerAssembly.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/blockchain/src/main/java/com/tangem/blockchain/common/assembly/impl/NearWalletManagerAssembly.kt b/blockchain/src/main/java/com/tangem/blockchain/common/assembly/impl/NearWalletManagerAssembly.kt index b11c89195..e4a5c413f 100644 --- a/blockchain/src/main/java/com/tangem/blockchain/common/assembly/impl/NearWalletManagerAssembly.kt +++ b/blockchain/src/main/java/com/tangem/blockchain/common/assembly/impl/NearWalletManagerAssembly.kt @@ -21,7 +21,8 @@ internal object NearWalletManagerAssembly : WalletManagerAssembly Date: Fri, 3 Nov 2023 19:02:06 +0500 Subject: [PATCH 6/6] AND-51766 Fixed tx history for ETC --- .../impl/EthereumWalletManagerAssembly.kt | 27 ++++++++++++------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/blockchain/src/main/java/com/tangem/blockchain/common/assembly/impl/EthereumWalletManagerAssembly.kt b/blockchain/src/main/java/com/tangem/blockchain/common/assembly/impl/EthereumWalletManagerAssembly.kt index 32e0b4781..65dd3b123 100644 --- a/blockchain/src/main/java/com/tangem/blockchain/common/assembly/impl/EthereumWalletManagerAssembly.kt +++ b/blockchain/src/main/java/com/tangem/blockchain/common/assembly/impl/EthereumWalletManagerAssembly.kt @@ -5,6 +5,7 @@ import com.tangem.blockchain.blockchains.ethereum.EthereumTransactionHistoryProv import com.tangem.blockchain.blockchains.ethereum.EthereumWalletManager import com.tangem.blockchain.blockchains.ethereum.getEthereumJsonRpcProviders import com.tangem.blockchain.blockchains.ethereum.network.EthereumNetworkService +import com.tangem.blockchain.common.Blockchain import com.tangem.blockchain.common.assembly.WalletManagerAssembly import com.tangem.blockchain.common.assembly.WalletManagerAssemblyInput import com.tangem.blockchain.common.txhistory.DefaultTransactionHistoryProvider @@ -29,16 +30,22 @@ internal object EthereumWalletManagerAssembly : WalletManagerAssembly { + if (input.config.nowNodeCredentials != null && input.config.nowNodeCredentials.apiKey.isNotBlank()) { + EthereumTransactionHistoryProvider( + blockchain = blockchain, + blockBookApi = BlockBookApi( + config = BlockBookConfig.NowNodes(nowNodesCredentials = input.config.nowNodeCredentials), + blockchain = blockchain, + ) + ) + } else { + DefaultTransactionHistoryProvider + } + } + + else -> DefaultTransactionHistoryProvider } ) }