mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-06-28 20:39:51 +00:00
CW-531-Bitcoin-Fees-issue (#1218)
* SegWit transaction size * [skip ci] fix electrum balances layout * fix tapping area
This commit is contained in:
parent
ef7762eaca
commit
faf151a4dc
4 changed files with 15 additions and 7 deletions
|
@ -4,7 +4,10 @@ import 'package:cw_bitcoin/bitcoin_amount_format.dart';
|
||||||
import 'package:cw_core/balance.dart';
|
import 'package:cw_core/balance.dart';
|
||||||
|
|
||||||
class ElectrumBalance extends Balance {
|
class ElectrumBalance extends Balance {
|
||||||
const ElectrumBalance({required this.confirmed, required this.unconfirmed, required this.frozen})
|
const ElectrumBalance(
|
||||||
|
{required this.confirmed,
|
||||||
|
required this.unconfirmed,
|
||||||
|
required this.frozen})
|
||||||
: super(confirmed, unconfirmed);
|
: super(confirmed, unconfirmed);
|
||||||
|
|
||||||
static ElectrumBalance? fromJSON(String? jsonSource) {
|
static ElectrumBalance? fromJSON(String? jsonSource) {
|
||||||
|
@ -25,16 +28,19 @@ class ElectrumBalance extends Balance {
|
||||||
final int frozen;
|
final int frozen;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get formattedAvailableBalance => bitcoinAmountToString(amount: confirmed - frozen);
|
String get formattedAvailableBalance =>
|
||||||
|
bitcoinAmountToString(amount: confirmed - unconfirmed.abs() - frozen);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get formattedAdditionalBalance => bitcoinAmountToString(amount: unconfirmed);
|
String get formattedAdditionalBalance =>
|
||||||
|
bitcoinAmountToString(amount: unconfirmed);
|
||||||
|
|
||||||
String get formattedFrozenBalance {
|
@override
|
||||||
|
String get formattedUnAvailableBalance {
|
||||||
final frozenFormatted = bitcoinAmountToString(amount: frozen);
|
final frozenFormatted = bitcoinAmountToString(amount: frozen);
|
||||||
return frozenFormatted == '0.0' ? '' : frozenFormatted;
|
return frozenFormatted == '0.0' ? '' : frozenFormatted;
|
||||||
}
|
}
|
||||||
|
|
||||||
String toJSON() =>
|
String toJSON() => json.encode(
|
||||||
json.encode({'confirmed': confirmed, 'unconfirmed': unconfirmed, 'frozen': frozen});
|
{'confirmed': confirmed, 'unconfirmed': unconfirmed, 'frozen': frozen});
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,7 +82,7 @@ abstract class ElectrumWalletBase
|
||||||
bitcoin.HDWallet.fromSeed(seedBytes).derivePath("m/44'/145'/0'/0");
|
bitcoin.HDWallet.fromSeed(seedBytes).derivePath("m/44'/145'/0'/0");
|
||||||
|
|
||||||
static int estimatedTransactionSize(int inputsCount, int outputsCounts) =>
|
static int estimatedTransactionSize(int inputsCount, int outputsCounts) =>
|
||||||
inputsCount * 146 + outputsCounts * 33 + 8;
|
inputsCount * 68 + outputsCounts * 34 + 10;
|
||||||
|
|
||||||
final bitcoin.HDWallet hd;
|
final bitcoin.HDWallet hd;
|
||||||
final String mnemonic;
|
final String mnemonic;
|
||||||
|
|
|
@ -135,6 +135,7 @@ class ContactListPage extends BasePage {
|
||||||
await showBar<void>(context, S.of(context).copied_to_clipboard);
|
await showBar<void>(context, S.of(context).copied_to_clipboard);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
behavior: HitTestBehavior.opaque,
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: const EdgeInsets.only(top: 16, bottom: 16, right: 24),
|
padding: const EdgeInsets.only(top: 16, bottom: 16, right: 24),
|
||||||
child: Row(
|
child: Row(
|
||||||
|
|
|
@ -18,6 +18,7 @@ class HomeScreenAccountWidget extends StatelessWidget {
|
||||||
context: context,
|
context: context,
|
||||||
builder: (_) => getIt.get<MoneroAccountListPage>());
|
builder: (_) => getIt.get<MoneroAccountListPage>());
|
||||||
},
|
},
|
||||||
|
behavior: HitTestBehavior.opaque,
|
||||||
child: Container(
|
child: Container(
|
||||||
height: 100.0,
|
height: 100.0,
|
||||||
child: Row(
|
child: Row(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue