Skip to content

Conversation

@SeniorZhai
Copy link
Member

No description provided.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds Bitcoin (BTC) support to the wallet feature, enabling users to manage Bitcoin in their classic wallets.

Key Changes

  • Added Bitcoin SegWit address generation and transaction signing support
  • Introduced UTXO management with a new outputs database table
  • Created UI for prompting users to add Bitcoin addresses to existing classic wallets

Reviewed changes

Copilot reviewed 47 out of 47 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
app/src/main/res/values/strings.xml Added English strings for Bitcoin wallet introduction feature
app/src/main/res/values-zh-rTW/strings.xml Added Traditional Chinese translations for Bitcoin feature
app/src/main/res/values-zh-rCN/strings.xml Added Simplified Chinese translations for Bitcoin feature
app/src/main/res/layout/fragment_classic_wallet_missing_btc_address_intro.xml New layout for Bitcoin address introduction screen
app/src/main/res/layout/fragment_classic_wallet_missing_btc_address_bottom_sheet.xml New bottom sheet layout for Bitcoin address setup
app/src/main/res/drawable/*.xml Added vector drawables for Bitcoin wallet features (with naming issues)
app/src/main/java/one/mixin/android/ui/wallet/ClassicWalletMissingBtcAddressFragment.kt New fragment handling Bitcoin address addition to classic wallets
app/src/main/java/one/mixin/android/ui/home/MainActivity.kt Integrated Bitcoin address check before wallet navigation
app/src/main/java/one/mixin/android/web3/js/Web3Signer.kt Added Bitcoin transaction signing logic
app/src/main/java/one/mixin/android/tip/TipSign.kt Added Bitcoin key derivation using BIP84 (SegWit)
app/src/main/java/one/mixin/android/crypto/CryptoWalletHelper.kt Added Bitcoin address generation methods for SegWit and Taproot
app/src/main/java/one/mixin/android/db/WalletDatabase.kt Added database migration to version 7 with outputs table
app/src/main/java/one/mixin/android/db/web3/WalletOutputDao.kt New DAO for managing Bitcoin UTXOs
app/src/main/java/one/mixin/android/api/response/web3/WalletOutput.kt New data model for Bitcoin outputs (UTXOs)
app/src/main/java/one/mixin/android/job/RefreshWeb3BitCoinJob.kt New job for refreshing Bitcoin UTXO data
app/build.gradle Updated BouncyCastle dependency version management

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


fun buildTipGas(assetId: String, response: EstimateFeeResponse): TipGas {
return TipGas(assetId, response.gasLimit!!.toBigInteger(), response.maxFeePerGas!!.toBigInteger(), response.maxPriorityFeePerGas!!.toBigInteger())
return TipGas(assetId, response.gasLimit!!.toBigInteger(), response.maxFeePerGas!!.toBigInteger(), response.maxPriorityFeePerGas!!.toBigInteger(), )
Copy link

Copilot AI Jan 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trailing comma after parameter should be removed or all parameters should consistently have trailing commas according to Kotlin style guidelines.

Suggested change
return TipGas(assetId, response.gasLimit!!.toBigInteger(), response.maxFeePerGas!!.toBigInteger(), response.maxPriorityFeePerGas!!.toBigInteger(), )
return TipGas(assetId, response.gasLimit!!.toBigInteger(), response.maxFeePerGas!!.toBigInteger(), response.maxPriorityFeePerGas!!.toBigInteger())

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,15 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
Copy link

Copilot AI Jan 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The drawable filename contains a typo. "saemless" should be "seamless".

Copilot uses AI. Check for mistakes.
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_wallet_saemless" />
Copy link

Copilot AI Jan 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The drawable reference contains a typo. "ic_wallet_saemless" should be "ic_wallet_seamless".

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,24 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
Copy link

Copilot AI Jan 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The drawable filename contains a typo. "compatibillity" should be "compatibility".

Copilot uses AI. Check for mistakes.
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_wallet_compatibillity" />
Copy link

Copilot AI Jan 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The drawable reference contains a typo. "ic_wallet_compatibillity" should be "ic_wallet_compatibility".

Copilot uses AI. Check for mistakes.
val rawTxHex: String = tx.serialize().toHex()
return JsSignMessage(0, JsSignMessage.TYPE_BTC_TRANSACTION, data = rawTxHex, fee = gas)

}else{
Copy link

Copilot AI Jan 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing space after "if" keyword. The code should follow Kotlin style guidelines with proper spacing.

Suggested change
}else{
} else {

Copilot uses AI. Check for mistakes.
Comment on lines +843 to +844
web3Token != null && (chainToken == null || gas == null || (chainToken?.balance?.toBigDecimalOrNull() ?: BigDecimal.ZERO) < gas ||
(web3Token?.assetId == chainToken?.assetId && (gas ?: BigDecimal.ZERO).add(BigDecimal(v)) > (web3Token?.balance?.toBigDecimalOrNull() ?: BigDecimal.ZERO)))
Copy link

Copilot AI Jan 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The conditional logic appears to have incorrect balance comparison. The chain token balance check should have proper parentheses grouping to ensure the comparison operators work correctly.

Copilot uses AI. Check for mistakes.
}

v = BigDecimal(v).multiply(percentageOfBalance).max(BigDecimal.ZERO).stripTrailingZeros().toPlainString()
v = BigDecimal(v).multiply(percentageOfBalance).max(BigDecimal.ZERO).setScale(8, RoundingMode.DOWN).toPlainString()
Copy link

Copilot AI Jan 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing space before opening brace after "else". The code should follow Kotlin style guidelines with proper spacing.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants