-
Notifications
You must be signed in to change notification settings - Fork 111
Feature/btc #6057
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Feature/btc #6057
Conversation
# Conflicts: # app/src/main/java/one/mixin/android/crypto/CryptoWalletHelper.kt
# Conflicts: # app/src/sharedTest/java/one.mixin.android.mock/AccountMock.kt
There was a problem hiding this 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
outputsdatabase 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(), ) |
Copilot
AI
Jan 5, 2026
There was a problem hiding this comment.
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.
| return TipGas(assetId, response.gasLimit!!.toBigInteger(), response.maxFeePerGas!!.toBigInteger(), response.maxPriorityFeePerGas!!.toBigInteger(), ) | |
| return TipGas(assetId, response.gasLimit!!.toBigInteger(), response.maxFeePerGas!!.toBigInteger(), response.maxPriorityFeePerGas!!.toBigInteger()) |
| @@ -0,0 +1,15 @@ | |||
| <vector xmlns:android="http://schemas.android.com/apk/res/android" | |||
Copilot
AI
Jan 5, 2026
There was a problem hiding this comment.
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".
| <ImageView | ||
| android:layout_width="wrap_content" | ||
| android:layout_height="wrap_content" | ||
| android:src="@drawable/ic_wallet_saemless" /> |
Copilot
AI
Jan 5, 2026
There was a problem hiding this comment.
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".
| @@ -0,0 +1,24 @@ | |||
| <vector xmlns:android="http://schemas.android.com/apk/res/android" | |||
Copilot
AI
Jan 5, 2026
There was a problem hiding this comment.
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".
| <ImageView | ||
| android:layout_width="wrap_content" | ||
| android:layout_height="wrap_content" | ||
| android:src="@drawable/ic_wallet_compatibillity" /> |
Copilot
AI
Jan 5, 2026
There was a problem hiding this comment.
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".
| val rawTxHex: String = tx.serialize().toHex() | ||
| return JsSignMessage(0, JsSignMessage.TYPE_BTC_TRANSACTION, data = rawTxHex, fee = gas) | ||
|
|
||
| }else{ |
Copilot
AI
Jan 5, 2026
There was a problem hiding this comment.
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.
| }else{ | |
| } else { |
| 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))) |
Copilot
AI
Jan 5, 2026
There was a problem hiding this comment.
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.
| } | ||
|
|
||
| v = BigDecimal(v).multiply(percentageOfBalance).max(BigDecimal.ZERO).stripTrailingZeros().toPlainString() | ||
| v = BigDecimal(v).multiply(percentageOfBalance).max(BigDecimal.ZERO).setScale(8, RoundingMode.DOWN).toPlainString() |
Copilot
AI
Jan 5, 2026
There was a problem hiding this comment.
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.
9529b53 to
8274537
Compare
4b48de6 to
b80741f
Compare
6217887 to
5de585f
Compare
197ad8f to
6ca9e09
Compare
6ca9e09 to
1be6499
Compare
30d1cdf to
61f9581
Compare
No description provided.