mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-01-05 10:29:23 +00:00
Disable mweb coins for exchanges
This commit is contained in:
parent
c880dbd83c
commit
1ddf946130
1 changed files with 10 additions and 3 deletions
|
@ -394,7 +394,7 @@ abstract class SendViewModelBase extends WalletChangeListenerViewModel with Stor
|
|||
|
||||
if (wallet.isHardwareWallet) state = IsAwaitingDeviceResponseState();
|
||||
|
||||
pendingTransaction = await wallet.createTransaction(_credentials());
|
||||
pendingTransaction = await wallet.createTransaction(_credentials(provider));
|
||||
|
||||
if (provider is ThorChainExchangeProvider) {
|
||||
final outputCount = pendingTransaction?.outputCount ?? 0;
|
||||
|
@ -522,7 +522,7 @@ abstract class SendViewModelBase extends WalletChangeListenerViewModel with Stor
|
|||
void setTransactionPriority(TransactionPriority priority) =>
|
||||
_settingsStore.priority[wallet.type] = priority;
|
||||
|
||||
Object _credentials() {
|
||||
Object _credentials([ExchangeProvider? provider]) {
|
||||
final priority = _settingsStore.priority[wallet.type];
|
||||
|
||||
if (priority == null &&
|
||||
|
@ -535,7 +535,6 @@ abstract class SendViewModelBase extends WalletChangeListenerViewModel with Stor
|
|||
|
||||
switch (wallet.type) {
|
||||
case WalletType.bitcoin:
|
||||
case WalletType.litecoin:
|
||||
case WalletType.bitcoinCash:
|
||||
return bitcoin!.createBitcoinTransactionCredentials(
|
||||
outputs,
|
||||
|
@ -543,6 +542,14 @@ abstract class SendViewModelBase extends WalletChangeListenerViewModel with Stor
|
|||
feeRate: customBitcoinFeeRate,
|
||||
coinTypeToSpendFrom: coinTypeToSpendFrom,
|
||||
);
|
||||
case WalletType.litecoin:
|
||||
return bitcoin!.createBitcoinTransactionCredentials(
|
||||
outputs,
|
||||
priority: priority!,
|
||||
feeRate: customBitcoinFeeRate,
|
||||
// if it's an exchange flow then disable sending from mweb coins
|
||||
coinTypeToSpendFrom: provider != null ? UnspentCoinType.nonMweb : coinTypeToSpendFrom,
|
||||
);
|
||||
|
||||
case WalletType.monero:
|
||||
return monero!
|
||||
|
|
Loading…
Reference in a new issue