Merge branch 'feature/btc-native-send' into fix/multisig-first-signer-deep-link

# Conflicts:
#	feature-assets/src/main/java/io/novafoundation/nova/feature_assets/presentation/bridge/BridgeFragment.kt
#	feature-assets/src/main/java/io/novafoundation/nova/feature_assets/presentation/bridge/BridgeViewModel.kt
#	feature-assets/src/main/java/io/novafoundation/nova/feature_assets/presentation/bridge/di/BridgeModule.kt
This commit is contained in:
2026-07-14 07:36:14 -07:00
116 changed files with 5425 additions and 455 deletions
@@ -63,6 +63,31 @@ class SubstrateFee(
override val asset: Chain.Asset
) : Fee
/**
* Fee for a Bitcoin transaction, denominated in sats: `feeRate (sat/vB) * estimated vsize` - see
* `RealBitcoinTransactionService` for how both are derived. The network only ever collects what miners include
* in a block, which is exactly this amount (unlike account-model chains, a Bitcoin fee is not a cap/estimate
* that gets partially refunded - it is the literal difference between input and output values).
*/
class BitcoinFee(
override val amount: BigInteger,
override val submissionOrigin: SubmissionOrigin,
override val asset: Chain.Asset
) : Fee
/**
* Fee for a Tron transaction (native TRX or TRC-20), always denominated in TRX (sun), regardless of which asset
* is being sent - Tron has no separate "gas token" concept, network resources (bandwidth/energy) are always
* burned as TRX. [amount] is this client's own estimate of that burn (see `RealTronTransactionService`); the
* network only ever burns what it actually uses, so the real cost can be lower, but never higher than what this
* client authorized via `fee_limit` when submitting.
*/
class TronFee(
override val amount: BigInteger,
override val submissionOrigin: SubmissionOrigin,
override val asset: Chain.Asset
) : Fee
class SubstrateFeeBase(
override val amount: BigInteger,
override val asset: Chain.Asset
@@ -25,14 +25,14 @@ suspend fun SecretStoreV2.getAccountSecrets(
fun AccountSecrets.keypair(chain: Chain): Keypair {
return fold(
left = { mapMetaAccountSecretsToKeypair(it, ethereum = chain.isEthereumBased) },
left = { mapMetaAccountSecretsToKeypair(it, ethereum = chain.isEthereumBased, bitcoin = chain.isBitcoinBased) },
right = { mapChainAccountSecretsToKeypair(it) }
)
}
fun AccountSecrets.derivationPath(chain: Chain): String? {
return fold(
left = { mapMetaAccountSecretsToDerivationPath(it, ethereum = chain.isEthereumBased) },
left = { mapMetaAccountSecretsToDerivationPath(it, ethereum = chain.isEthereumBased, bitcoin = chain.isBitcoinBased) },
right = { it[ChainAccountSecrets.DerivationPath] }
)
}
@@ -52,6 +52,10 @@ interface LightMetaAccount {
*/
val tronAddress: ByteArray?
val tronPublicKey: ByteArray?
/** Bitcoin account id (HASH160 of the compressed pubkey - see [io.novafoundation.nova.common.utils.hash160]). */
val bitcoinAddress: ByteArray?
val bitcoinPublicKey: ByteArray?
val isSelected: Boolean
val name: String
val type: Type
@@ -90,6 +94,8 @@ fun LightMetaAccount(
parentMetaId: Long?,
tronAddress: ByteArray? = null,
tronPublicKey: ByteArray? = null,
bitcoinAddress: ByteArray? = null,
bitcoinPublicKey: ByteArray? = null,
) = object : LightMetaAccount {
override val id: Long = id
override val globallyUniqueId: String = globallyUniqueId
@@ -100,6 +106,8 @@ fun LightMetaAccount(
override val ethereumPublicKey: ByteArray? = ethereumPublicKey
override val tronAddress: ByteArray? = tronAddress
override val tronPublicKey: ByteArray? = tronPublicKey
override val bitcoinAddress: ByteArray? = bitcoinAddress
override val bitcoinPublicKey: ByteArray? = bitcoinPublicKey
override val isSelected: Boolean = isSelected
override val name: String = name
override val type: LightMetaAccount.Type = type