mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-01-07 03:19:31 +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();
|
if (wallet.isHardwareWallet) state = IsAwaitingDeviceResponseState();
|
||||||
|
|
||||||
pendingTransaction = await wallet.createTransaction(_credentials());
|
pendingTransaction = await wallet.createTransaction(_credentials(provider));
|
||||||
|
|
||||||
if (provider is ThorChainExchangeProvider) {
|
if (provider is ThorChainExchangeProvider) {
|
||||||
final outputCount = pendingTransaction?.outputCount ?? 0;
|
final outputCount = pendingTransaction?.outputCount ?? 0;
|
||||||
|
@ -522,7 +522,7 @@ abstract class SendViewModelBase extends WalletChangeListenerViewModel with Stor
|
||||||
void setTransactionPriority(TransactionPriority priority) =>
|
void setTransactionPriority(TransactionPriority priority) =>
|
||||||
_settingsStore.priority[wallet.type] = priority;
|
_settingsStore.priority[wallet.type] = priority;
|
||||||
|
|
||||||
Object _credentials() {
|
Object _credentials([ExchangeProvider? provider]) {
|
||||||
final priority = _settingsStore.priority[wallet.type];
|
final priority = _settingsStore.priority[wallet.type];
|
||||||
|
|
||||||
if (priority == null &&
|
if (priority == null &&
|
||||||
|
@ -535,7 +535,6 @@ abstract class SendViewModelBase extends WalletChangeListenerViewModel with Stor
|
||||||
|
|
||||||
switch (wallet.type) {
|
switch (wallet.type) {
|
||||||
case WalletType.bitcoin:
|
case WalletType.bitcoin:
|
||||||
case WalletType.litecoin:
|
|
||||||
case WalletType.bitcoinCash:
|
case WalletType.bitcoinCash:
|
||||||
return bitcoin!.createBitcoinTransactionCredentials(
|
return bitcoin!.createBitcoinTransactionCredentials(
|
||||||
outputs,
|
outputs,
|
||||||
|
@ -543,6 +542,14 @@ abstract class SendViewModelBase extends WalletChangeListenerViewModel with Stor
|
||||||
feeRate: customBitcoinFeeRate,
|
feeRate: customBitcoinFeeRate,
|
||||||
coinTypeToSpendFrom: coinTypeToSpendFrom,
|
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:
|
case WalletType.monero:
|
||||||
return monero!
|
return monero!
|
||||||
|
|
Loading…
Reference in a new issue