mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-06-28 20:39:51 +00:00
CW-398-MoonPay-offramp-(Sell)-improvements (#964)
* Implement MoonPay offramp widget * Add Litecoin to strings * improve webview page * Rename route string --------- Co-authored-by: Justin Ehrenhofer <justin.ehrenhofer@gmail.com> Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
This commit is contained in:
parent
affc35f335
commit
a7ba4a84e8
32 changed files with 92 additions and 52 deletions
|
@ -49,10 +49,11 @@ class MainActions {
|
|||
case WalletType.bitcoin:
|
||||
case WalletType.litecoin:
|
||||
if (viewModel.isEnabledBuyAction) {
|
||||
final uri = getIt.get<OnRamperBuyProvider>().requestUrl();
|
||||
if (DeviceInfo.instance.isMobile) {
|
||||
Navigator.of(context).pushNamed(Routes.onramperPage);
|
||||
Navigator.of(context)
|
||||
.pushNamed(Routes.webViewPage, arguments: [S.of(context).buy, uri]);
|
||||
} else {
|
||||
final uri = getIt.get<OnRamperBuyProvider>().requestUrl();
|
||||
await launchUrl(uri);
|
||||
}
|
||||
}
|
||||
|
@ -119,14 +120,22 @@ class MainActions {
|
|||
|
||||
switch (walletType) {
|
||||
case WalletType.bitcoin:
|
||||
case WalletType.litecoin:
|
||||
if (viewModel.isEnabledSellAction) {
|
||||
final moonPaySellProvider = MoonPaySellProvider();
|
||||
final uri = await moonPaySellProvider.requestUrl(
|
||||
currency: viewModel.wallet.currency,
|
||||
refundWalletAddress: viewModel.wallet.walletAddresses.address,
|
||||
settingsStore: viewModel.settingsStore,
|
||||
);
|
||||
await launchUrl(uri);
|
||||
if (DeviceInfo.instance.isMobile) {
|
||||
Navigator.of(context).pushNamed(Routes.webViewPage,
|
||||
arguments: [S.of(context).sell, uri]);
|
||||
} else {
|
||||
await launchUrl(uri);
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
default:
|
||||
await showPopUp<void>(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue