Merge pull request #3513 from AlphaWallet/add-fiat-on-ramp-to-wallet-tab

Add fiat on ramp to Wallet tab
pull/3512/head
Hwee-Boon Yar 3 years ago committed by GitHub
commit 867e8dc1de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      AlphaWallet/Analytics/Models/AnalyticsTypes.swift
  2. 1
      AlphaWallet/Localization/en.lproj/Localizable.strings
  3. 1
      AlphaWallet/Localization/es.lproj/Localizable.strings
  4. 1
      AlphaWallet/Localization/ja.lproj/Localizable.strings
  5. 1
      AlphaWallet/Localization/ko.lproj/Localizable.strings
  6. 1
      AlphaWallet/Localization/zh-Hans.lproj/Localizable.strings
  7. 17
      AlphaWallet/Tokens/Coordinators/TokensCoordinator.swift

@ -191,5 +191,6 @@ enum Analytics {
case transactionActionSheetInsufficientFunds
case speedupTransactionInsufficientFunds
case cancelTransactionInsufficientFunds
case walletTab
}
}

@ -543,6 +543,7 @@
"a.wallet.token.xDaiBridge.button.title" = "Convert to DAI";
"a.wallet.token.arbitrumBridge.button.title" = "Convert to Arbitrum";
"a.wallet.token.buy.xDai.title" = "Buy xDai";
"buyCrypto.title" = "Buy Crypto";
"qrCode.myqrCode.title" = "My QR Code";
"qrCode.sendToAddress.title" = "Send to this Address";
"qrCode.watchWallet.title" = "Watch Wallet";

@ -543,6 +543,7 @@
"a.wallet.token.xDaiBridge.button.title" = "Convert to DAI";
"a.wallet.token.arbitrumBridge.button.title" = "Convert to Arbitrum";
"a.wallet.token.buy.xDai.title" = "Buy xDai";
"buyCrypto.title" = "Buy Crypto";
"qrCode.myqrCode.title" = "My QR Code";
"qrCode.sendToAddress.title" = "Send to this Address";
"qrCode.watchWallet.title" = "Watch Wallet";

@ -543,6 +543,7 @@
"a.wallet.token.xDaiBridge.button.title" = "Convert to DAI";
"a.wallet.token.arbitrumBridge.button.title" = "Convert to Arbitrum";
"a.wallet.token.buy.xDai.title" = "Buy xDai";
"buyCrypto.title" = "Buy Crypto";
"qrCode.myqrCode.title" = "My QR Code";
"qrCode.sendToAddress.title" = "Send to this Address";
"qrCode.watchWallet.title" = "Watch Wallet";

@ -543,6 +543,7 @@
"a.wallet.token.xDaiBridge.button.title" = "Convert to DAI";
"a.wallet.token.arbitrumBridge.button.title" = "Convert to Arbitrum";
"a.wallet.token.buy.xDai.title" = "Buy xDai";
"buyCrypto.title" = "Buy Crypto";
"qrCode.myqrCode.title" = "My QR Code";
"qrCode.sendToAddress.title" = "Send to this Address";
"qrCode.watchWallet.title" = "Watch Wallet";

@ -543,6 +543,7 @@
"a.wallet.token.xDaiBridge.button.title" = "Convert to DAI";
"a.wallet.token.arbitrumBridge.button.title" = "Convert to Arbitrum";
"a.wallet.token.buy.xDai.title" = "Buy xDai";
"buyCrypto.title" = "Buy Crypto";
"qrCode.myqrCode.title" = "My QR Code";
"qrCode.sendToAddress.title" = "Send to this Address";
"qrCode.watchWallet.title" = "Watch Wallet";

@ -131,14 +131,13 @@ class TokensCoordinator: Coordinator {
promptBackupCoordinator.prominentPromptDelegate = self
setupSingleChainTokenCoordinators()
//NOTE: https://github.com/AlphaWallet/alpha-wallet-ios/issues/3255
let myqrCodeBarButton = UIBarButtonItem.moreBarButton(self, selector: #selector(moreButtonSelected))
let moreBarButton = UIBarButtonItem.moreBarButton(self, selector: #selector(moreButtonSelected))
let qrCodeBarButton = UIBarButtonItem.qrCodeBarButton(self, selector: #selector(scanQRCodeButtonSelected))
myqrCodeBarButton.imageInsets = .init(top: 0, left: 0, bottom: 0, right: 0)
moreBarButton.imageInsets = .init(top: 0, left: 0, bottom: 0, right: 0)
qrCodeBarButton.imageInsets = .init(top: 0, left: 15, bottom: 0, right: -15)
tokensViewController.navigationItem.rightBarButtonItems = [
myqrCodeBarButton,
moreBarButton,
qrCodeBarButton
]
tokensViewController.navigationItem.leftBarButtonItem = UIBarButtonItem(customView: tokensViewController.blockieImageView)
@ -266,6 +265,16 @@ extension TokensCoordinator: TokensViewControllerDelegate {
}
alertController.addAction(showMyWalletAddressAction)
if config.enabledServers.contains(.main) {
let buyAction = UIAlertAction(title: R.string.localizable.buyCryptoTitle(), style: .default) { [weak self] _ in
guard let strongSelf = self else { return }
let server = RPCServer.main
let account = strongSelf.sessions.anyValue.account
strongSelf.delegate?.openFiatOnRamp(wallet: account, server: server, inCoordinator: strongSelf, viewController: strongSelf.tokensViewController, source: .walletTab)
}
alertController.addAction(buyAction)
}
let addHideTokensAction = UIAlertAction(title: R.string.localizable.walletsAddHideTokensTitle(), style: .default) { [weak self] _ in
guard let strongSelf = self else { return }
strongSelf.didPressAddHideTokens(viewModel: strongSelf.rootViewController.viewModel)

Loading…
Cancel
Save