mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-05-02 19:02:17 +00:00
commit
8bcd155967
7 changed files with 66 additions and 43 deletions
lib
models
pages
services/coins/bitcoin
widgets
test/services/coins/bitcoin
|
@ -6,22 +6,26 @@ class ContactAddressEntry {
|
||||||
final Coin coin;
|
final Coin coin;
|
||||||
final String address;
|
final String address;
|
||||||
final String label;
|
final String label;
|
||||||
|
final String? other;
|
||||||
|
|
||||||
const ContactAddressEntry({
|
const ContactAddressEntry({
|
||||||
required this.coin,
|
required this.coin,
|
||||||
required this.address,
|
required this.address,
|
||||||
required this.label,
|
required this.label,
|
||||||
|
this.other,
|
||||||
});
|
});
|
||||||
|
|
||||||
ContactAddressEntry copyWith({
|
ContactAddressEntry copyWith({
|
||||||
Coin? coin,
|
Coin? coin,
|
||||||
String? address,
|
String? address,
|
||||||
String? label,
|
String? label,
|
||||||
|
String? other,
|
||||||
}) {
|
}) {
|
||||||
return ContactAddressEntry(
|
return ContactAddressEntry(
|
||||||
coin: coin ?? this.coin,
|
coin: coin ?? this.coin,
|
||||||
address: address ?? this.address,
|
address: address ?? this.address,
|
||||||
label: label ?? this.label,
|
label: label ?? this.label,
|
||||||
|
other: other ?? this.other,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,6 +34,7 @@ class ContactAddressEntry {
|
||||||
coin: Coin.values.byName(jsonObject["coin"] as String),
|
coin: Coin.values.byName(jsonObject["coin"] as String),
|
||||||
address: jsonObject["address"] as String,
|
address: jsonObject["address"] as String,
|
||||||
label: jsonObject["label"] as String,
|
label: jsonObject["label"] as String,
|
||||||
|
other: jsonObject["other"] as String?,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,6 +43,7 @@ class ContactAddressEntry {
|
||||||
"label": label,
|
"label": label,
|
||||||
"address": address,
|
"address": address,
|
||||||
"coin": coin.name,
|
"coin": coin.name,
|
||||||
|
"other": other ?? "",
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -73,6 +73,7 @@ class _AddressBookViewState extends ConsumerState<AddressBookView> {
|
||||||
coin: manager.coin,
|
coin: manager.coin,
|
||||||
address: await manager.currentReceivingAddress,
|
address: await manager.currentReceivingAddress,
|
||||||
label: "Current Receiving",
|
label: "Current Receiving",
|
||||||
|
other: manager.walletName,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -208,6 +208,16 @@ class ContactPopUp extends ConsumerWidget {
|
||||||
crossAxisAlignment:
|
crossAxisAlignment:
|
||||||
CrossAxisAlignment.start,
|
CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
|
if (contact.id == "default")
|
||||||
|
Text(
|
||||||
|
e.other!,
|
||||||
|
style:
|
||||||
|
STextStyles.itemSubtitle12,
|
||||||
|
),
|
||||||
|
if (contact.id == "default")
|
||||||
|
const SizedBox(
|
||||||
|
height: 2,
|
||||||
|
),
|
||||||
Text(
|
Text(
|
||||||
"${e.label} (${e.coin.ticker})",
|
"${e.label} (${e.coin.ticker})",
|
||||||
style: STextStyles.itemSubtitle12,
|
style: STextStyles.itemSubtitle12,
|
||||||
|
|
|
@ -376,9 +376,13 @@ class _WalletViewState extends ConsumerState<WalletView> {
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
width: 16,
|
width: 16,
|
||||||
),
|
),
|
||||||
Text(
|
Expanded(
|
||||||
ref.watch(managerProvider.select((value) => value.walletName)),
|
child: Text(
|
||||||
style: STextStyles.navBarTitle,
|
ref.watch(
|
||||||
|
managerProvider.select((value) => value.walletName)),
|
||||||
|
style: STextStyles.navBarTitle,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
|
@ -42,7 +42,7 @@ import 'package:stackwallet/utilities/prefs.dart';
|
||||||
import 'package:tuple/tuple.dart';
|
import 'package:tuple/tuple.dart';
|
||||||
import 'package:uuid/uuid.dart';
|
import 'package:uuid/uuid.dart';
|
||||||
|
|
||||||
const int MINIMUM_CONFIRMATIONS = 2;
|
const int MINIMUM_CONFIRMATIONS = 1;
|
||||||
const int DUST_LIMIT = 294;
|
const int DUST_LIMIT = 294;
|
||||||
|
|
||||||
const String GENESIS_HASH_MAINNET =
|
const String GENESIS_HASH_MAINNET =
|
||||||
|
|
|
@ -79,44 +79,46 @@ class WalletSheetCard extends ConsumerWidget {
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
width: 12,
|
width: 12,
|
||||||
),
|
),
|
||||||
Column(
|
Expanded(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
Text(
|
children: [
|
||||||
manager.walletName,
|
Text(
|
||||||
style: STextStyles.titleBold12,
|
manager.walletName,
|
||||||
),
|
style: STextStyles.titleBold12,
|
||||||
const SizedBox(
|
),
|
||||||
height: 2,
|
const SizedBox(
|
||||||
),
|
height: 2,
|
||||||
FutureBuilder(
|
),
|
||||||
future: manager.totalBalance,
|
FutureBuilder(
|
||||||
builder: (builderContext, AsyncSnapshot<Decimal> snapshot) {
|
future: manager.totalBalance,
|
||||||
if (snapshot.connectionState == ConnectionState.done &&
|
builder: (builderContext, AsyncSnapshot<Decimal> snapshot) {
|
||||||
snapshot.hasData) {
|
if (snapshot.connectionState == ConnectionState.done &&
|
||||||
return Text(
|
snapshot.hasData) {
|
||||||
"${Format.localizedStringAsFixed(
|
return Text(
|
||||||
value: snapshot.data!,
|
"${Format.localizedStringAsFixed(
|
||||||
locale: locale,
|
value: snapshot.data!,
|
||||||
decimalPlaces: 8,
|
locale: locale,
|
||||||
)} ${coin.ticker}",
|
decimalPlaces: 8,
|
||||||
style: STextStyles.itemSubtitle,
|
)} ${coin.ticker}",
|
||||||
);
|
style: STextStyles.itemSubtitle,
|
||||||
} else {
|
);
|
||||||
return AnimatedText(
|
} else {
|
||||||
stringsToLoopThrough: const [
|
return AnimatedText(
|
||||||
"Loading balance",
|
stringsToLoopThrough: const [
|
||||||
"Loading balance.",
|
"Loading balance",
|
||||||
"Loading balance..",
|
"Loading balance.",
|
||||||
"Loading balance..."
|
"Loading balance..",
|
||||||
],
|
"Loading balance..."
|
||||||
style: STextStyles.itemSubtitle,
|
],
|
||||||
);
|
style: STextStyles.itemSubtitle,
|
||||||
}
|
);
|
||||||
},
|
}
|
||||||
),
|
},
|
||||||
],
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
|
@ -28,7 +28,7 @@ import 'bitcoin_wallet_test_parameters.dart';
|
||||||
void main() {
|
void main() {
|
||||||
group("bitcoin constants", () {
|
group("bitcoin constants", () {
|
||||||
test("bitcoin minimum confirmations", () async {
|
test("bitcoin minimum confirmations", () async {
|
||||||
expect(MINIMUM_CONFIRMATIONS, 2);
|
expect(MINIMUM_CONFIRMATIONS, 1);
|
||||||
});
|
});
|
||||||
test("bitcoin dust limit", () async {
|
test("bitcoin dust limit", () async {
|
||||||
expect(DUST_LIMIT, 294);
|
expect(DUST_LIMIT, 294);
|
||||||
|
|
Loading…
Reference in a new issue