mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-11-17 09:47:37 +00:00
Merge remote-tracking branch 'origin_SW/staging' into add-xlm
This commit is contained in:
commit
a194594b4d
2 changed files with 37 additions and 25 deletions
|
@ -121,7 +121,8 @@ class WalletBalanceToggleSheet extends ConsumerWidget {
|
||||||
height: 24,
|
height: 24,
|
||||||
),
|
),
|
||||||
BalanceSelector(
|
BalanceSelector(
|
||||||
title: "Available balance",
|
title:
|
||||||
|
"Available${balanceSecondary != null ? " public" : ""} balance",
|
||||||
coin: coin,
|
coin: coin,
|
||||||
balance: balance.spendable,
|
balance: balance.spendable,
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
|
@ -141,6 +142,31 @@ class WalletBalanceToggleSheet extends ConsumerWidget {
|
||||||
value: _BalanceType.available,
|
value: _BalanceType.available,
|
||||||
groupValue: _bal,
|
groupValue: _bal,
|
||||||
),
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 12,
|
||||||
|
),
|
||||||
|
BalanceSelector(
|
||||||
|
title:
|
||||||
|
"Full${balanceSecondary != null ? " public" : ""} balance",
|
||||||
|
coin: coin,
|
||||||
|
balance: balance.total,
|
||||||
|
onPressed: () {
|
||||||
|
ref.read(walletBalanceToggleStateProvider.state).state =
|
||||||
|
WalletBalanceToggleState.full;
|
||||||
|
ref.read(publicPrivateBalanceStateProvider.state).state =
|
||||||
|
"Public";
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
},
|
||||||
|
onChanged: (_) {
|
||||||
|
ref.read(walletBalanceToggleStateProvider.state).state =
|
||||||
|
WalletBalanceToggleState.full;
|
||||||
|
ref.read(publicPrivateBalanceStateProvider.state).state =
|
||||||
|
"Public";
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
},
|
||||||
|
value: _BalanceType.full,
|
||||||
|
groupValue: _bal,
|
||||||
|
),
|
||||||
if (balanceSecondary != null)
|
if (balanceSecondary != null)
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
height: 12,
|
height: 12,
|
||||||
|
@ -167,30 +193,6 @@ class WalletBalanceToggleSheet extends ConsumerWidget {
|
||||||
value: _BalanceType.privateAvailable,
|
value: _BalanceType.privateAvailable,
|
||||||
groupValue: _bal,
|
groupValue: _bal,
|
||||||
),
|
),
|
||||||
const SizedBox(
|
|
||||||
height: 12,
|
|
||||||
),
|
|
||||||
BalanceSelector(
|
|
||||||
title: "Full balance",
|
|
||||||
coin: coin,
|
|
||||||
balance: balance.total,
|
|
||||||
onPressed: () {
|
|
||||||
ref.read(walletBalanceToggleStateProvider.state).state =
|
|
||||||
WalletBalanceToggleState.full;
|
|
||||||
ref.read(publicPrivateBalanceStateProvider.state).state =
|
|
||||||
"Public";
|
|
||||||
Navigator.of(context).pop();
|
|
||||||
},
|
|
||||||
onChanged: (_) {
|
|
||||||
ref.read(walletBalanceToggleStateProvider.state).state =
|
|
||||||
WalletBalanceToggleState.full;
|
|
||||||
ref.read(publicPrivateBalanceStateProvider.state).state =
|
|
||||||
"Public";
|
|
||||||
Navigator.of(context).pop();
|
|
||||||
},
|
|
||||||
value: _BalanceType.full,
|
|
||||||
groupValue: _bal,
|
|
||||||
),
|
|
||||||
if (balanceSecondary != null)
|
if (balanceSecondary != null)
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
height: 12,
|
height: 12,
|
||||||
|
|
|
@ -1169,6 +1169,11 @@ class FiroWallet extends CoinServiceAPI
|
||||||
required Amount amount,
|
required Amount amount,
|
||||||
Map<String, dynamic>? args,
|
Map<String, dynamic>? args,
|
||||||
}) async {
|
}) async {
|
||||||
|
if (amount.raw > BigInt.from(MINT_LIMIT)) {
|
||||||
|
throw Exception(
|
||||||
|
"Lelantus sends of more than 5001 are currently disabled");
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// check for send all
|
// check for send all
|
||||||
bool isSendAll = false;
|
bool isSendAll = false;
|
||||||
|
@ -2510,6 +2515,11 @@ class FiroWallet extends CoinServiceAPI
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<List<Map<String, dynamic>>> createMintsFromAmount(int total) async {
|
Future<List<Map<String, dynamic>>> createMintsFromAmount(int total) async {
|
||||||
|
if (total > MINT_LIMIT) {
|
||||||
|
throw Exception(
|
||||||
|
"Lelantus mints of more than 5001 are currently disabled");
|
||||||
|
}
|
||||||
|
|
||||||
int tmpTotal = total;
|
int tmpTotal = total;
|
||||||
int counter = 0;
|
int counter = 0;
|
||||||
final lastUsedIndex = await db.getHighestUsedMintIndex(walletId: walletId);
|
final lastUsedIndex = await db.getHighestUsedMintIndex(walletId: walletId);
|
||||||
|
|
Loading…
Reference in a new issue