| 1 | import 'package:cake_wallet/.secrets.g.dart' as secrets; |
| 2 | import 'package:cake_wallet/generated/i18n.dart'; |
| 3 | import 'package:cake_wallet/store/app_store.dart'; |
| 4 | import 'package:cake_wallet/view_model/settings/link_list_item.dart'; |
| 5 | import 'package:cake_wallet/view_model/settings/settings_list_item.dart'; |
| 6 | import 'package:cake_wallet/wallet_type_utils.dart'; |
| 7 | import 'package:mobx/mobx.dart'; |
| 8 | |
| 9 | part 'support_view_model.g.dart'; |
| 10 | |
| 11 | class SupportViewModel = SupportViewModelBase with _$SupportViewModel; |
| 12 | |
| 13 | abstract class SupportViewModelBase with Store { |
| 14 | final AppStore _appStore; |
| 15 | |
| 16 | SupportViewModelBase(this._appStore) |
| 17 | : items = [ |
| 18 | LinkListItem( |
| 19 | title: 'Email', |
| 20 | icon: 'assets/images/support_icon.png', |
| 21 | linkTitle: 'support@cakewallet.com', |
| 22 | link: 'mailto:support@cakewallet.com'), |
| 23 | LinkListItem( |
| 24 | title: 'Website', |
| 25 | icon: 'assets/images/global.png', |
| 26 | linkTitle: 'cakewallet.com', |
| 27 | link: 'https://cakewallet.com'), |
| 28 | LinkListItem( |
| 29 | title: 'Forum', |
| 30 | icon: 'assets/images/discourse.png', |
| 31 | linkTitle: 'forum.cakewallet.com', |
| 32 | link: 'https://forum.cakewallet.com'), |
| 33 | LinkListItem( |
| 34 | title: 'GitHub', |
| 35 | icon: 'assets/images/github.png', |
| 36 | hasIconColor: true, |
| 37 | linkTitle: S.current.apk_update, |
| 38 | link: 'https://github.com/cake-tech/cake_wallet/releases'), |
| 39 | LinkListItem( |
| 40 | title: 'Discord', |
| 41 | icon: 'assets/images/discord.png', |
| 42 | linkTitle: 'discord.gg/2vqYJdXG2H', |
| 43 | link: 'https://discord.gg/2vqYJdXG2H'), |
| 44 | LinkListItem( |
| 45 | title: 'Telegram', |
| 46 | icon: 'assets/images/Telegram.png', |
| 47 | linkTitle: 't.me/cakewalletannouncements', |
| 48 | link: 'https://t.me/cakewalletannouncements'), |
| 49 | LinkListItem( |
| 50 | title: 'Telegram Support Bot', |
| 51 | icon: 'assets/images/Telegram.png', |
| 52 | linkTitle: '@cakewallet_bot', |
| 53 | link: 'https://t.me/cakewallet_bot'), |
| 54 | LinkListItem( |
| 55 | title: 'ChangeNow', |
| 56 | icon: 'assets/images/change_now.png', |
| 57 | linkTitle: 'support@changenow.io', |
| 58 | link: 'mailto:support@changenow.io'), |
| 59 | // LinkListItem( |
| 60 | // title: 'SideShift', |
| 61 | // icon: 'assets/images/sideshift.png', |
| 62 | // linkTitle: 'help.sideshift.ai', |
| 63 | // link: 'https://help.sideshift.ai/en/'), |
| 64 | LinkListItem( |
| 65 | title: 'SimpleSwap', |
| 66 | icon: 'assets/images/simpleSwap.png', |
| 67 | linkTitle: 'support@simpleswap.io', |
| 68 | link: 'mailto:support@simpleswap.io'), |
| 69 | LinkListItem( |
| 70 | title: 'Exolix', |
| 71 | icon: 'assets/images/exolix.png', |
| 72 | linkTitle: 'support@exolix.com', |
| 73 | link: 'mailto:support@exolix.com'), |
| 74 | LinkListItem( |
| 75 | title: 'SwapTrade', |
| 76 | icon: 'assets/images/swap_trade.png', |
| 77 | linkTitle: 'help.swaptrade.io', |
| 78 | link: 'https://help.swaptrade.io/contact/'), |
| 79 | LinkListItem( |
| 80 | title: 'Trocador', |
| 81 | icon: 'assets/images/trocador.png', |
| 82 | linkTitle: 'mail@trocador.app', |
| 83 | link: 'mailto:mail@trocador.app'), |
| 84 | LinkListItem( |
| 85 | title: 'Onramper', |
| 86 | icon: 'assets/images/onramper_dark.png', |
| 87 | lightIcon: 'assets/images/onramper_light.png', |
| 88 | linkTitle: 'View exchanges', |
| 89 | link: 'https://docs.cakewallet.com/support/buy/#onramper'), |
| 90 | LinkListItem( |
| 91 | title: 'DFX', |
| 92 | icon: 'assets/images/dfx_dark.png', |
| 93 | lightIcon: 'assets/images/dfx_light.png', |
| 94 | linkTitle: 'support@dfx.swiss', |
| 95 | link: 'mailto:support@dfx.swiss'), |
| 96 | if (!isMoneroOnly) ...[ |
| 97 | LinkListItem( |
| 98 | title: 'MoonPay', |
| 99 | icon: 'assets/images/moonpay.png', |
| 100 | linkTitle: S.current.submit_request, |
| 101 | link: 'https://support.moonpay.com/hc/en-gb/requests/new'), |
| 102 | LinkListItem( |
| 103 | title: 'Robinhood Connect', |
| 104 | icon: 'assets/images/robinhood_dark.png', |
| 105 | lightIcon: 'assets/images/robinhood_light.png', |
| 106 | linkTitle: S.current.submit_request, |
| 107 | link: 'https://robinhood.com/contact') |
| 108 | ], |
| 109 | LinkListItem( |
| 110 | title: 'Kryptonim', |
| 111 | icon: 'assets/images/kryptonim_dark.png', |
| 112 | lightIcon: 'assets/images/kryptonim_light.png', |
| 113 | linkTitle: 'contact@support.kryptonim.com', |
| 114 | link: 'mailto:contact@support.kryptonim.com'), |
| 115 | ]; |
| 116 | |
| 117 | final docsUrl = 'https://docs.cakewallet.com'; |
| 118 | |
| 119 | String fetchUrl({String locale = "en", String authToken = ""}) { |
| 120 | var supportUrl = |
| 121 | "https://app.chatwoot.com/widget?website_token=${secrets.chatwootWebsiteToken}&locale=${locale}"; |
| 122 | |
| 123 | if (authToken.isNotEmpty) supportUrl += "&cw_conversation=$authToken"; |
| 124 | |
| 125 | return supportUrl; |
| 126 | } |
| 127 | |
| 128 | String get appVersion => |
| 129 | "${isMoneroOnly ? "Monero.com" : "Cake Wallet"} - ${_appStore.settingsStore.appVersion}"; |
| 130 | |
| 131 | String get fiatApiMode => _appStore.settingsStore.fiatApiMode.title; |
| 132 | |
| 133 | String get walletType => _appStore.wallet?.type.name ?? 'Unknown'; |
| 134 | |
| 135 | String get walletSyncState => _appStore.wallet?.syncStatus.toString() ?? 'Unknown'; |
| 136 | |
| 137 | String get builtInTorState => _appStore.settingsStore.currentBuiltinTor ? 'Enabled' : 'Disabled'; |
| 138 | |
| 139 | List<SettingsListItem> items; |
| 140 | } |