mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-27 06:18:50 +01:00
* fix android CI * feat: add anypay core models, parser and routing engine * feat: add anypay resolver, anypay service and wallet switch service * refactor: route the send page payment flow through anypay service * fix: show message when there's no swap providers for a pair and reset the trade guard on dismissal * refactor: merge the swap from network and send to network decision pages together and clean up anypay widgets * feat: reapply deep links to a currently open send flow and register the solana scheme * feat: add support for zcash address detection to anypay and other minor fixes * refactor: remove trailing icon * feat: hide swap flow for sp and mweb addresses * feat: enhance zcash address detection and deeplink handling * fix: pin bitcoin_base * refactor: Move the anypay decision navigation out of the send page and address minor review comments * refactor: Move the anypay decision navigation out of the send page and address minor review comments * feat: handle exception in switch service and mvoe balance compute to call site * refactor: combine anypay entry points to one and extract selected mode widget * fix: tx priority for doge * chore: add dogecoin to isElectrumWallet util * fix: annoying mobx error --------- Co-authored-by: Czarek Nakamoto <cyjan@mrcyjanek.net>
75 lines
1.7 KiB
Dart
75 lines
1.7 KiB
Dart
import 'package:cw_core/wallet_type.dart';
|
|
|
|
bool isBIP39Wallet(WalletType walletType) {
|
|
switch (walletType) {
|
|
case WalletType.ethereum:
|
|
case WalletType.polygon:
|
|
case WalletType.base:
|
|
case WalletType.arbitrum:
|
|
case WalletType.bsc:
|
|
case WalletType.solana:
|
|
case WalletType.tron:
|
|
case WalletType.bitcoin:
|
|
case WalletType.litecoin:
|
|
case WalletType.bitcoinCash:
|
|
case WalletType.nano:
|
|
case WalletType.banano:
|
|
case WalletType.monero:
|
|
case WalletType.dogecoin:
|
|
case WalletType.zcash:
|
|
return true;
|
|
case WalletType.wownero:
|
|
case WalletType.haven:
|
|
case WalletType.zano:
|
|
case WalletType.decred:
|
|
case WalletType.none:
|
|
return false;
|
|
}
|
|
}
|
|
|
|
bool isElectrumWallet(WalletType walletType) {
|
|
switch (walletType) {
|
|
case WalletType.bitcoin:
|
|
case WalletType.litecoin:
|
|
case WalletType.bitcoinCash:
|
|
case WalletType.dogecoin:
|
|
return true;
|
|
default:
|
|
return false;
|
|
}
|
|
}
|
|
|
|
bool hasTokens(WalletType walletType) {
|
|
switch (walletType) {
|
|
case WalletType.ethereum:
|
|
case WalletType.polygon:
|
|
case WalletType.solana:
|
|
case WalletType.tron:
|
|
case WalletType.zano:
|
|
case WalletType.base:
|
|
case WalletType.arbitrum:
|
|
case WalletType.bsc:
|
|
return true;
|
|
default:
|
|
return false;
|
|
}
|
|
}
|
|
|
|
String tokenStandardFor(WalletType walletType) {
|
|
switch (walletType) {
|
|
case WalletType.ethereum:
|
|
case WalletType.polygon:
|
|
case WalletType.arbitrum:
|
|
case WalletType.base:
|
|
return 'ERC-20';
|
|
case WalletType.bsc:
|
|
return 'BEP-20';
|
|
case WalletType.solana:
|
|
return 'SPL';
|
|
case WalletType.tron:
|
|
return 'TRC-20';
|
|
default:
|
|
return walletTypeToString(walletType);
|
|
}
|
|
}
|