Updated on 2026-08-14

This commit is contained in:
Tangem 2026-02-25 19:06:21 +04:00
parent ff5df41d6a
commit 1626270ae9
17 changed files with 118 additions and 2 deletions

View file

@ -176,6 +176,8 @@ fun Blockchain.Companion.fromNetworkId(networkId: String): Blockchain? {
"plasma/test" -> Blockchain.PlasmaTestnet
"monad" -> Blockchain.Monad
"monad/test" -> Blockchain.MonadTestnet
"berachain" -> Blockchain.Berachain
"berachain/test" -> Blockchain.BerachainTestnet
else -> null
}
}
@ -349,6 +351,8 @@ fun Blockchain.toNetworkId(): String {
Blockchain.PlasmaTestnet -> "plasma/test"
Blockchain.Monad -> "monad"
Blockchain.MonadTestnet -> "monad/test"
Blockchain.Berachain -> "berachain"
Blockchain.BerachainTestnet -> "berachain/test"
}
}
@ -458,6 +462,7 @@ fun Blockchain.toCoinId(): String {
Blockchain.ArbitrumNova -> "arbitrum-nova-ethereum"
Blockchain.Plasma, Blockchain.PlasmaTestnet -> "plasma"
Blockchain.Monad, Blockchain.MonadTestnet -> "monad"
Blockchain.Berachain, Blockchain.BerachainTestnet -> "berachain-bera"
}
}

View file

@ -178,6 +178,7 @@ class AccountNodeRecognizer(private val blockchain: Blockchain) {
Blockchain.Quai,
Blockchain.Plasma,
Blockchain.Monad,
Blockchain.Berachain,
-> true
Blockchain.Nexa, // unsupported network
Blockchain.Chia,
@ -254,6 +255,7 @@ class AccountNodeRecognizer(private val blockchain: Blockchain) {
Blockchain.LineaTestnet,
Blockchain.PlasmaTestnet,
Blockchain.MonadTestnet,
Blockchain.BerachainTestnet,
-> false
// endregion
}

View file

@ -103,6 +103,29 @@ internal class AccountNodeRecognizerTest {
expected = null,
),
// endregion
// region Berachain blockchain (EVM-like)
TestModel(
blockchain = Blockchain.Berachain,
derivationPath = "m/44'/60'/0'/0/1",
expected = 1,
),
TestModel(
blockchain = Blockchain.Berachain,
derivationPath = "m/44'/60'/0'/0/0",
expected = 0,
),
TestModel(
blockchain = Blockchain.Berachain,
derivationPath = "m/44'/60'/0'/0",
expected = null,
),
TestModel(
blockchain = Blockchain.Berachain,
derivationPath = "m/44'/60'",
expected = null,
),
// endregion
)
private fun provideUTXOTestModels() = listOf(