Skip to content

Add custom network fee#700

Merged
DRadmir merged 9 commits into
mainfrom
custom-bitcoin-fee
Jul 16, 2026
Merged

Add custom network fee#700
DRadmir merged 9 commits into
mainfrom
custom-bitcoin-fee

Conversation

@DRadmir

@DRadmir DRadmir commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

Adds a custom network fee — set your own fee rate for Bitcoin (sat/vB) and EVM chains, with a live fee preview.

Close: #649

iOS

Simulator Screenshot - iPhone Air - 2026-07-15 at 23 30 41 Simulator Screenshot - iPhone Air - 2026-07-16 at 00 22 00 Simulator Screenshot - iPhone Air - 2026-07-16 at 00 22 07

Android

Screenshot_1784146940 Screenshot_1784146949 Screenshot_1784146955

DRadmir added 3 commits July 14, 2026 18:39
- Move custom-fee calculation into core primitives; keep gemstone a thin FFI wrapper
- Android: hoist custom-fee preview into a view model, unify fee rows, shorten placeholder
- iOS: simplify custom-fee scenes/view models with a FeeSelection.custom payload
- Remove the Slow fee priority
@DRadmir DRadmir self-assigned this Jul 15, 2026
DRadmir and others added 2 commits July 16, 2026 00:25
- Add custom_fee_enabled to FeeConfig (Bitcoin only); simplify field names to decimals/max_multiplier
- Remove unused CustomFee.rateText and its dead unitSymbol plumbing
- Render the typed value in the primary color in SuffixTextField (iOS + Android)
@DRadmir
DRadmir marked this pull request as ready for review July 15, 2026 20:26
val feeRate = FeeRateUIModel(item, feeAssetInfo, feeUnitType, selectedRate, currentFee.amount, unitSymbol)
FeeRow(
emoji = feeRate.emoji,
title = when (feeRate.priority) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

title = when (feeRate.priority) {
                        FeePriority.Fast -> stringResource(R.string.fee_rates_fast)
                        FeePriority.Normal -> stringResource(R.string.fee_rates_normal)
                    },

should be moved to extension to get title for the priority

Comment thread core/gemstone/src/fee.rs Outdated
}

#[uniffi::export]
pub fn custom_gas_price(base: GemGasPriceType, gas_price: String) -> Result<GemGasPriceType, GemstoneError> {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we should use BigInt instead of String, see other examples that we have

Comment thread core/gemstone/src/fee.rs Outdated

#[derive(uniffi::Record, Clone, Debug, PartialEq, Eq)]
pub struct GemCustomFee {
pub fee_amount: String,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
pub fee_amount: String,
pub fee_value: String,

and should be big int

Comment thread core/gemstone/src/config/fee_config.rs Outdated
FeeConfig {
decimals: fee_unit_type(chain).decimals(),
max_multiplier: 10,
custom_fee_enabled: chain == Chain::Bitcoin,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

add extension for this, as we will enable more in the future

Comment thread core/gemstone/src/config/mod.rs Outdated
crate::config::chain::get_chain_config(chain)
}

fn get_fee_config(&self, chain: String) -> FeeConfig {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we have Chain type for this?

DRadmir added 3 commits July 16, 2026 13:23
The Slow fee priority no longer exists; the key was referenced by no Kotlin or Swift code.
- Pass BigInt over the FFI instead of String; uniffi handles the conversion, so the manual parsing and Result are gone
- Rename fee_amount to fee_value
- Extract custom_fee_enabled into a chain extension
- Take Chain in get_fee_config instead of String, dropping a panicking unwrap
- Move CustomFeeEstimate into Primitives and map GemCustomFee via map() throws
@DRadmir
DRadmir merged commit 6d115bc into main Jul 16, 2026
6 checks passed
@DRadmir
DRadmir deleted the custom-bitcoin-fee branch July 16, 2026 10:00
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.

Allow custom fee for Bitcoin sends

2 participants