diff --git a/wallet/lib/components/no_internet.dart b/wallet/lib/components/no_internet.dart index 13c7f5cf0c..bb4b5dd177 100644 --- a/wallet/lib/components/no_internet.dart +++ b/wallet/lib/components/no_internet.dart @@ -25,7 +25,11 @@ class NoInternetDialog { _isShowing = value; } - Future showNoInternet() { + Future showNoInternet() async { + if (navigatorKey.currentState == null || navigatorKey.currentState!.overlay == null) { + return; + } + return showDialog( context: navigatorKey.currentState!.overlay!.context, barrierDismissible: true, @@ -60,10 +64,7 @@ class NoInternetDialog { SizedBox(height: 30.h), Text( NETWORK_ERROR, - style: TextStyle( - color: Colors.white, - fontSize: 18.sp, - fontWeight: FontWeight.w800), + style: TextStyle(color: Colors.white, fontSize: 18.sp, fontWeight: FontWeight.w800), ), SizedBox(height: 20.h), Padding( @@ -74,20 +75,14 @@ class NoInternetDialog { children: [ TextSpan( text: "no_internet_connection".tr(), - style: Theme.of(navigatorKey.currentState!.context) - .textTheme - .bodyText2! - .copyWith( + style: Theme.of(navigatorKey.currentState!.context).textTheme.bodyText2!.copyWith( color: Colors.white, fontSize: 12.sp, ), ), TextSpan( text: email, - style: Theme.of(navigatorKey.currentState!.context) - .textTheme - .bodyText2! - .copyWith( + style: Theme.of(navigatorKey.currentState!.context).textTheme.bodyText2!.copyWith( color: Colors.white, fontSize: 12.sp, ), @@ -109,13 +104,7 @@ class NoInternetDialog { child: Center( child: Text( kCancelText, - style: Theme.of(navigatorKey.currentState!.context) - .textTheme - .bodyText1! - .copyWith( - fontSize: 16.sp, - color: kWhite, - fontWeight: FontWeight.w300), + style: Theme.of(navigatorKey.currentState!.context).textTheme.bodyText1!.copyWith(fontSize: 16.sp, color: kWhite, fontWeight: FontWeight.w300), ), ), ), @@ -133,10 +122,7 @@ class NoInternetDialog { ); } - Widget buildBackupButton( - {required String title, - required Color bgColor, - required VoidCallback onPressed}) { + Widget buildBackupButton({required String title, required Color bgColor, required VoidCallback onPressed}) { return InkWell( onTap: () { onPressed.call(); @@ -152,10 +138,7 @@ class NoInternetDialog { child: Center( child: Text( title, - style: TextStyle( - color: bgColor == kButtonColor ? kBlue : kWhite, - fontSize: 16.sp, - fontWeight: FontWeight.w600), + style: TextStyle(color: bgColor == kButtonColor ? kBlue : kWhite, fontSize: 16.sp, fontWeight: FontWeight.w600), textAlign: TextAlign.center, )), ), diff --git a/wallet/lib/pages/home/wallet_screen/add_pylon_screen.dart b/wallet/lib/pages/home/wallet_screen/add_pylon_screen.dart index cb301e885a..6d20246e9b 100644 --- a/wallet/lib/pages/home/wallet_screen/add_pylon_screen.dart +++ b/wallet/lib/pages/home/wallet_screen/add_pylon_screen.dart @@ -8,24 +8,12 @@ import 'package:get_it/get_it.dart'; import 'package:pylons_wallet/components/buttons/custom_paint_button.dart'; import 'package:pylons_wallet/components/loading.dart'; import 'package:pylons_wallet/services/repository/repository.dart'; +import 'package:pylons_wallet/utils/base_env.dart'; import 'package:pylons_wallet/utils/constants.dart'; -import 'package:pylons_wallet/utils/svg_util.dart'; -TextStyle kPylonLabelText = TextStyle( - fontSize: 18.sp, - fontFamily: kUniversalFontFamily, - color: kTextBlackColor, - fontWeight: FontWeight.w800); -TextStyle kTitleText = TextStyle( - fontSize: 15.sp, - fontFamily: kUniversalFontFamily, - color: kBlack, - fontWeight: FontWeight.w700); -TextStyle kSubTitleText = TextStyle( - fontSize: 13.sp, - fontFamily: kUniversalFontFamily, - color: kPriceTagColor, - fontWeight: FontWeight.w700); +TextStyle kPylonLabelText = TextStyle(fontSize: 18.sp, fontFamily: kUniversalFontFamily, color: kTextBlackColor, fontWeight: FontWeight.w800); +TextStyle kTitleText = TextStyle(fontSize: 15.sp, fontFamily: kUniversalFontFamily, color: kBlack, fontWeight: FontWeight.w700); +TextStyle kSubTitleText = TextStyle(fontSize: 13.sp, fontFamily: kUniversalFontFamily, color: kPriceTagColor, fontWeight: FontWeight.w700); class AddPylonScreen extends StatefulWidget { const AddPylonScreen({Key? key}) : super(key: key); @@ -36,6 +24,7 @@ class AddPylonScreen extends StatefulWidget { class _AddPylonScreenState extends State { Repository get repository => GetIt.I.get(); + BaseEnv get baseEnv => GetIt.I.get(); @override Widget build(BuildContext context) { @@ -72,39 +61,21 @@ class _AddPylonScreenState extends State { SizedBox( height: 80.h, ), - buildBuyRow( - svgAsset: SVGUtil.PYLON_ONE_CURRENCY, - pylonText: kBuyPylonOne, - bonusText: "", - subtitle: kOneUSD, - onPressed: () async { - buyProduct(itemId: kPylons1); - }, - ), - SizedBox( - height: 30.h, - ), - buildBuyRow( - svgAsset: SVGUtil.PYLON_THREE_CURRENCY, - pylonText: kBuyPylonThree, - bonusText: "bonus_five".tr(), - subtitle: kThreeUSD, - onPressed: () async { - buyProduct(itemId: kPylons3); - }, - ), - SizedBox( - height: 40.h, - ), - buildBuyRow( - svgAsset: SVGUtil.PYLON_FIVE_CURRENCY, - pylonText: kBuyPylonFive, - bonusText: "bonus_ten".tr(), - subtitle: kFiveUSD, - onPressed: () { - buyProduct(itemId: kPylons5); - }, - ), + Expanded( + child: ListView.separated( + itemBuilder: (context, index) => buildBuyRow( + svgAsset: baseEnv.skus[index].getSvgAsset(), + pylonText: baseEnv.skus[index].pylons, + bonusText: baseEnv.skus[index].bonus, + subtitle: baseEnv.skus[index].subtitle, + onPressed: () async { + buyProduct(itemId: baseEnv.skus[index].id); + }, + ), + separatorBuilder: (_, __) => SizedBox( + height: 30.h, + ), + itemCount: baseEnv.skus.length)), ], ), ], @@ -113,12 +84,7 @@ class _AddPylonScreenState extends State { ); } - Widget buildBuyRow( - {required String svgAsset, - required String pylonText, - required String bonusText, - required String subtitle, - required VoidCallback onPressed}) { + Widget buildBuyRow({required String svgAsset, required String pylonText, required String bonusText, required String subtitle, required VoidCallback onPressed}) { return Row(children: [ SizedBox( height: 40.h, @@ -181,16 +147,14 @@ class _AddPylonScreenState extends State { inAppPurchaseResponse.swap().toOption().toNullable()!.message.show(); return; } - final productsListResponse = - await repository.getProductsForSale(itemId: itemId); + final productsListResponse = await repository.getProductsForSale(itemId: itemId); loading.dismiss(); if (productsListResponse.isLeft()) { productsListResponse.swap().toOption().toNullable()!.message.show(); return; } - final buyProductResponse = await repository - .buyProduct(productsListResponse.toOption().toNullable()!); + final buyProductResponse = await repository.buyProduct(productsListResponse.toOption().toNullable()!); if (buyProductResponse.isLeft()) { buyProductResponse.swap().toOption().toNullable()!.message.show(); return; diff --git a/wallet/lib/pages/routing_page/routing_page.dart b/wallet/lib/pages/routing_page/routing_page.dart index 4a48d77992..f888afb615 100644 --- a/wallet/lib/pages/routing_page/routing_page.dart +++ b/wallet/lib/pages/routing_page/routing_page.dart @@ -10,7 +10,7 @@ import 'package:pylons_wallet/pages/settings/utils/user_info_provider.dart'; import 'package:pylons_wallet/pylons_app.dart'; import 'package:pylons_wallet/services/data_stores/local_data_store.dart'; import 'package:pylons_wallet/services/repository/repository.dart'; -import 'package:pylons_wallet/services/third_party_services/remote_config_service.dart'; +import 'package:pylons_wallet/services/third_party_services/remote_config_service/remote_config_service.dart'; import 'package:pylons_wallet/stores/wallet_store.dart'; import 'package:pylons_wallet/utils/dependency_injection/dependency_injection.dart'; import 'package:pylons_wallet/utils/route_util.dart'; diff --git a/wallet/lib/pages/routing_page/update_app.dart b/wallet/lib/pages/routing_page/update_app.dart index 118fb934be..ee98970844 100644 --- a/wallet/lib/pages/routing_page/update_app.dart +++ b/wallet/lib/pages/routing_page/update_app.dart @@ -8,7 +8,7 @@ import 'package:flutter_svg/flutter_svg.dart'; import 'package:get_it/get_it.dart'; import 'package:pylons_wallet/pylons_app.dart'; import 'package:pylons_wallet/services/data_stores/local_data_store.dart'; -import 'package:pylons_wallet/services/third_party_services/remote_config_service.dart'; +import 'package:pylons_wallet/services/third_party_services/remote_config_service/remote_config_service.dart'; import 'package:pylons_wallet/stores/wallet_store.dart'; import 'package:pylons_wallet/utils/constants.dart'; import 'package:pylons_wallet/utils/dependency_injection/dependency_injection.dart'; diff --git a/wallet/lib/services/third_party_services/remote_config_service/models/sku_model.dart b/wallet/lib/services/third_party_services/remote_config_service/models/sku_model.dart new file mode 100644 index 0000000000..5d8bfdd7ae --- /dev/null +++ b/wallet/lib/services/third_party_services/remote_config_service/models/sku_model.dart @@ -0,0 +1,34 @@ +// "id": "pylons_10", +// "bonus": "", +// "subtitle": "$1.00", +// "pylons" : "10 PYLN" +// + +import 'package:pylons_wallet/utils/svg_util.dart'; + +class SKUModel { + String id; + String bonus; + String subtitle; + String pylons; + + SKUModel({required this.id, required this.bonus, required this.subtitle, required this.pylons}); + factory SKUModel.fromJson(Map json) { + return SKUModel( + pylons: json['pylons'].toString(), + subtitle: json['subtitle'].toString(), + id: json['id'].toString(), + bonus: json['bonus'].toString(), + ); + } + + String getSvgAsset() { + if(id == "pylons_10"){ + return SVGUtil.PYLON_ONE_CURRENCY; + } else if (id == "pylons_35"){ + return SVGUtil.PYLON_THREE_CURRENCY; + } else { + return SVGUtil.PYLON_FIVE_CURRENCY; + } + } +} diff --git a/wallet/lib/services/third_party_services/remote_config_service.dart b/wallet/lib/services/third_party_services/remote_config_service/remote_config_service.dart similarity index 95% rename from wallet/lib/services/third_party_services/remote_config_service.dart rename to wallet/lib/services/third_party_services/remote_config_service/remote_config_service.dart index 265163793d..413d87bc83 100644 --- a/wallet/lib/services/third_party_services/remote_config_service.dart +++ b/wallet/lib/services/third_party_services/remote_config_service/remote_config_service.dart @@ -1,3 +1,4 @@ +import 'package:firebase_app_check/firebase_app_check.dart'; import 'package:firebase_remote_config/firebase_remote_config.dart'; import 'package:flutter_dotenv/flutter_dotenv.dart'; import 'package:pylons_wallet/services/data_stores/local_data_store.dart'; @@ -44,6 +45,7 @@ class RemoteConfigServiceImpl implements RemoteConfigService { static String chainId = "CHAIN_ID"; static String ibcTrace = "IBC_TRACE_URL"; static String mongoUrl = "MONGO_URL"; + static String skus = "skus"; RemoteConfigServiceImpl( {required this.firebaseRemoteConfig, @@ -69,6 +71,7 @@ class RemoteConfigServiceImpl implements RemoteConfigService { firebaseRemoteConfig.getString(stripeCallbackRefreshUrl), chainId: firebaseRemoteConfig.getString(chainId), ibcTraceUrl: firebaseRemoteConfig.getString(ibcTrace), + skus: firebaseRemoteConfig.getString(skus), ); // if (localDataSource.getNetworkEnvironmentPreference() == kDevNet) { @@ -137,6 +140,10 @@ class RemoteConfigServiceImpl implements RemoteConfigService { iosVERSION: IOS_VERSION, androidVersion: ANDROID_VERSION, chainId: dotenv.env['CHAIN_ID'], + skus: defaultPylonsSKUs, + mongoUrl: dotenv.env[mongoUrl] ?? "", + + }); firebaseRemoteConfig.setConfigSettings(RemoteConfigSettings( @@ -149,6 +156,8 @@ class RemoteConfigServiceImpl implements RemoteConfigService { } on FormatException catch (_) { /// Happens when there is no internet on first launch. crashlyticsHelper.recordFatalError(error: _.message); + } on FirebaseException catch(_){ + crashlyticsHelper.recordFatalError(error: _.message ?? ""); } } diff --git a/wallet/lib/utils/base_env.dart b/wallet/lib/utils/base_env.dart index 17268e5701..acd2c5cbb8 100644 --- a/wallet/lib/utils/base_env.dart +++ b/wallet/lib/utils/base_env.dart @@ -1,6 +1,9 @@ +import 'dart:convert'; + import 'package:alan/alan.dart'; import 'package:flutter_dotenv/flutter_dotenv.dart'; import 'package:grpc/grpc.dart'; +import 'package:pylons_wallet/services/third_party_services/remote_config_service/models/sku_model.dart'; import 'package:pylons_wallet/utils/constants.dart'; class BaseEnv { @@ -17,6 +20,7 @@ class BaseEnv { late String _ibcTraceUrl; late String _faucetUrl; late String _baseMongoUrl; + late List _skus; void setEnv( {required String lcdUrl, @@ -28,6 +32,7 @@ class BaseEnv { required String faucetUrl, required String ibcTraceUrl, required String mongoUrl, + required String skus, String? stripeUrl, String? stripePubKey, bool? stripeTestEnv, @@ -57,6 +62,11 @@ class BaseEnv { _chainId = chainId; _ibcTraceUrl = ibcTraceUrl; _faucetUrl = faucetUrl; + + + final List jsonSkuList = jsonDecode(skus) as List; + _skus = jsonSkuList.map(( e) => SKUModel.fromJson(e as Map )).toList(); + } NetworkInfo get networkInfo => _networkInfo; @@ -83,8 +93,13 @@ class BaseEnv { String get faucetUrl => _faucetUrl; + + List get skus => _skus; + @override String toString() { return 'BaseEnv{_networkInfo: $_networkInfo, _baseApiUrl: $_baseApiUrl, _baseEthUrl: $_baseEthUrl, _stripeUrl: $_stripeUrl, _stripePubKey: $_stripePubKey, _stripeTestEnv: $_stripeTestEnv, _stripeCallbackUrl: $_stripeCallbackUrl, _stripeCallbackRefreshUrl: $_stripeCallbackRefreshUrl, _chainId: $_chainId, _ibcTraceUrl: $_ibcTraceUrl, _faucetUrl: $_faucetUrl}'; } + + } diff --git a/wallet/lib/utils/constants.dart b/wallet/lib/utils/constants.dart index 8e29c8e53f..b6d4aad1ee 100644 --- a/wallet/lib/utils/constants.dart +++ b/wallet/lib/utils/constants.dart @@ -1,15 +1,11 @@ +import 'dart:convert'; + import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; -TextStyle kCurrencyStyle = TextStyle( - color: Colors.white, fontWeight: FontWeight.bold, fontSize: 16.sp); -TextStyle kDropdownText = - TextStyle(color: kBlack, fontSize: 13.sp, fontWeight: FontWeight.w600); -TextStyle kTransactionTitle = TextStyle( - color: kBlack, - fontSize: 20.sp, - fontWeight: FontWeight.w700, - fontFamily: 'UniversalSans'); +TextStyle kCurrencyStyle = TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 16.sp); +TextStyle kDropdownText = TextStyle(color: kBlack, fontSize: 13.sp, fontWeight: FontWeight.w600); +TextStyle kTransactionTitle = TextStyle(color: kBlack, fontSize: 20.sp, fontWeight: FontWeight.w700, fontFamily: 'UniversalSans'); const Color kMainBG = Color(0xFFF2EFEA); const Color kSelectedIcon = Color(0xFF616161); @@ -93,13 +89,7 @@ const int kDenomInitial = 1; const int kDenomFinal = 4; const Map kCoinDenom = { - 'upylon': { - "name": "Pylon", - "denom": "upylon", - "short": "pylon", - "icon": "assets/images/icons/pylons_logo_24x24.png", - "faucet": true - }, + 'upylon': {"name": "Pylon", "denom": "upylon", "short": "pylon", "icon": "assets/images/icons/pylons_logo_24x24.png", "faucet": true}, 'BTC': { "name": "Bitcoin", "denom": "BTC", @@ -107,24 +97,9 @@ const Map kCoinDenom = { //"icon": "assets/images/icons/bitcoin.png", // todo - get bitcoin icon "faucet": false }, - 'ustripeusd': { - 'name': "USD", - "denom": "ustripeusd", - "short": "usd", - "icon": "assets/images/icons/ico_usd.png" - }, - 'UST': { - 'name': "USTerra", - "denom": "uusd", - "short": "ust", - "icon": "assets/images/icons/ico_usd.png" - }, - 'Juno': { - 'name': "Juno", - "denom": "ujunox", - "short": "juno", - "icon": "assets/images/icons/ico_usd.png" - } + 'ustripeusd': {'name': "USD", "denom": "ustripeusd", "short": "usd", "icon": "assets/images/icons/ico_usd.png"}, + 'UST': {'name': "USTerra", "denom": "uusd", "short": "ust", "icon": "assets/images/icons/ico_usd.png"}, + 'Juno': {'name': "Juno", "denom": "ujunox", "short": "juno", "icon": "assets/images/icons/ico_usd.png"} }; const String kAndroidEaselInstallLink = "market://details?id=tech.pylons.easel"; @@ -141,8 +116,7 @@ const String kStripeMerchantCountry = "US"; const String kStripeMerchantDisplayName = 'Pylons'; const String kStripeLoginLinkPrefix = "https://connect.stripe.com/express/"; -const String kStripeAccountLinkPrefix = - "https://connect.stripe.com/express/onboarding/"; +const String kStripeAccountLinkPrefix = "https://connect.stripe.com/express/onboarding/"; const String kStripeEditSuffix = "/edit"; const String kStripeAccountSuffix = "#/account"; const String kStripeSignoutJS = @@ -151,21 +125,15 @@ const String kStripeSignoutJS = const String SOMETHING_WENT_WRONG = 'Something went wrong'; //STRIPE ERROR STRING -const String CREATE_PAYMENTINTENT_FAILED = - 'Stripe PaymentIntent Creation Failed'; -const String GEN_PAYMENTRECEIPT_FAILED = - 'Stripe Payment Receipt Generation Failed'; +const String CREATE_PAYMENTINTENT_FAILED = 'Stripe PaymentIntent Creation Failed'; +const String GEN_PAYMENTRECEIPT_FAILED = 'Stripe Payment Receipt Generation Failed'; const String GEN_PAYOUTTOKEN_FAILED = 'Stripe Payout Token Generation Failed'; -const String GEN_REGISTRATIONTOKEN_FAILED = - 'Stripe Registration Token Generation Failed'; +const String GEN_REGISTRATIONTOKEN_FAILED = 'Stripe Registration Token Generation Failed'; const String GEN_UPDATETOKEN_FAILED = 'Stripe Update Token Generation Failed'; -const String GET_ACCOUNTLINK_FAILED = - 'Stripe Get Connected Account Link Failed'; -const String GET_LOGINLINK_FAILED = - 'Stripe Get Connected Account LOGIN Link Failed'; +const String GET_ACCOUNTLINK_FAILED = 'Stripe Get Connected Account Link Failed'; +const String GET_LOGINLINK_FAILED = 'Stripe Get Connected Account LOGIN Link Failed'; const String PAYOUT_FAILED = 'Stripe Payout Request Failed'; -const String REGISTERACCOUNT_FAILED = - 'Stripe Register Connected Account Failed'; +const String REGISTERACCOUNT_FAILED = 'Stripe Register Connected Account Failed'; const String UPDATEACCOUNT_FAILED = 'Stripe Update Account Failed'; const String IBC_HASH_UPDATE_FAILED = 'IBC hash info getting Failed'; const String PLATFORM_FAILED = 'Platform exception occured'; @@ -173,8 +141,7 @@ const String CACHE_FAILED = 'No data saved'; const String NETWORK_ERROR = 'Network Error'; /// Repository -const String SOMETHING_WRONG_FETCHING_WALLETS = - "Something went wrong while fetching wallets"; +const String SOMETHING_WRONG_FETCHING_WALLETS = "Something went wrong while fetching wallets"; const String kIOSWalletId = 'xyz.pylons.wallet'; const String kAndroidId = 'tech.pylons.wallet'; @@ -202,13 +169,7 @@ const IOS_VERSION = '1.0.8+1'; const kCurrencyDecimalLength = 2; -const List colorList = [ - kYellow, - kBlue, - kDarkPurple, - kDarkRed, - kDarkGreen -]; +const List colorList = [kYellow, kBlue, kDarkPurple, kDarkRed, kDarkGreen]; const List colorListForPracticeTest = [ kYellow, kDarkPurple, @@ -244,8 +205,7 @@ const String kRecoveryMigration = 'Migrate Account'; /// Settings screen const String kSettingsEmailAddress = "Email Address (optional)"; const String kCopy = "Copy"; -const String kAlertDialogText = - "Are you sure you want to delete your Pylons wallet from this device?"; +const String kAlertDialogText = "Are you sure you want to delete your Pylons wallet from this device?"; const String kYes = "Yes"; const String kNo = "No"; @@ -253,8 +213,7 @@ const String kNo = "No"; const String kSaveText = "Save"; const String kWalletAddressText = "Wallet Address"; const String kBioText = "Bio"; -const String kBioHintText = - "Media Artist (3D, Motiongraphics) \nCreating & Collecting NFTs"; +const String kBioHintText = "Media Artist (3D, Motiongraphics) \nCreating & Collecting NFTs"; const String kStakeDigitalClaim = "Stake your digital claim"; const String kCreateWallet = "Create Wallet"; const String kRestoreWallet = "Restore Wallet"; @@ -278,10 +237,8 @@ const String kSpanishText = "spanish"; const String kVietnameseText = "vietnamese"; /// Update screen -const String kAndroidAppLink = - 'https://play.google.com/store/apps/details?id=tech.pylons.wallet'; -const String kIOSAppLink = - 'https://apps.apple.com/gb/app/cashero/id1598732789?ign-mpt=uo%3D2'; +const String kAndroidAppLink = 'https://play.google.com/store/apps/details?id=tech.pylons.wallet'; +const String kIOSAppLink = 'https://apps.apple.com/gb/app/cashero/id1598732789?ign-mpt=uo%3D2'; const String kRecipeId = 'Recipe ID'; const String kRecipes = 'recipes'; @@ -295,10 +252,8 @@ const String kSoldOut = 'Sold Out'; /// Repository const String NO_PROFILE_FOUND = 'No profile found in wallet'; -const String SOMETHING_WRONG_SIGNING_TRANSACTION = - 'Something went wrong while signing transaction'; -const String VIDEO_PLAYER_NETWORK_ERROR = - 'Unable to play the video right now. Please check your internet connection and try again.'; +const String SOMETHING_WRONG_SIGNING_TRANSACTION = 'Something went wrong while signing transaction'; +const String VIDEO_PLAYER_NETWORK_ERROR = 'Unable to play the video right now. Please check your internet connection and try again.'; /// Trade Receipt Screen const String kCloseText = "Close"; @@ -306,73 +261,23 @@ const String kCancelText = "Cancel"; /// Trade Receipt Screen const String kTransactionCompleteText = "View Receipt"; -const String kBigDipperTransactionViewingUrl = - "https://wallet.pylons.tech/transactions/"; +const String kBigDipperTransactionViewingUrl = "https://wallet.pylons.tech/transactions/"; /// languages supported List> languagesSupported = [ - { - "name": "english", - "flag": "🇬🇧", - 'selected': false, - "abbreviation": "(U.S.)", - 'languageCode': 'en' - }, - { - "name": "russian", - "flag": "🇷🇺", - 'selected': false, - "abbreviation": "(RU)", - 'languageCode': 'ru' - }, - { - "name": "indonesian", - "flag": "🇮🇩", - 'selected': false, - "abbreviation": "(IN)", - 'languageCode': 'id' - }, - { - "name": "german", - "flag": "🇩🇪", - 'selected': false, - "abbreviation": "(DU)", - 'languageCode': 'de' - }, - { - "name": "korean", - "flag": "🇰🇷", - 'selected': false, - "abbreviation": "(KO)", - 'languageCode': 'ko' - }, - { - "name": "japanese", - "flag": "🇯🇵", - 'selected': false, - "abbreviation": "(JA)", - 'languageCode': 'ja' - }, - { - "name": "spanish", - "flag": "🇪🇸", - 'selected': false, - "abbreviation": "(ES)", - 'languageCode': 'es' - }, - { - "name": "vietnamese", - "flag": "🇻🇳", - 'selected': false, - "abbreviation": "(VIE)", - 'languageCode': 'vie' - }, + {"name": "english", "flag": "🇬🇧", 'selected': false, "abbreviation": "(U.S.)", 'languageCode': 'en'}, + {"name": "russian", "flag": "🇷🇺", 'selected': false, "abbreviation": "(RU)", 'languageCode': 'ru'}, + {"name": "indonesian", "flag": "🇮🇩", 'selected': false, "abbreviation": "(IN)", 'languageCode': 'id'}, + {"name": "german", "flag": "🇩🇪", 'selected': false, "abbreviation": "(DU)", 'languageCode': 'de'}, + {"name": "korean", "flag": "🇰🇷", 'selected': false, "abbreviation": "(KO)", 'languageCode': 'ko'}, + {"name": "japanese", "flag": "🇯🇵", 'selected': false, "abbreviation": "(JA)", 'languageCode': 'ja'}, + {"name": "spanish", "flag": "🇪🇸", 'selected': false, "abbreviation": "(ES)", 'languageCode': 'es'}, + {"name": "vietnamese", "flag": "🇻🇳", 'selected': false, "abbreviation": "(VIE)", 'languageCode': 'vie'}, ]; ///review your nft -const String kPylonsFeeMsg = - "The Pylons fee is the network fee assessed on all transactions equal to 10% of the listed price."; +const String kPylonsFeeMsg = "The Pylons fee is the network fee assessed on all transactions which is equal to 10% of the listed price."; const String kStripeAccountNotCreatedIdentifier = "onboarding"; const String kNftFormat = "NFT_Format"; const String kDuration = "Duration"; @@ -394,19 +299,8 @@ const int kDateConverterConstant = 1000; const kHashtags = "Hashtags"; -const kBuyPylonOne = "10 PYLN"; -const kBuyPylonThree = "30 PYLN"; -const kBuyPylonFive = "50 PYLN"; -const kOneUSD = "\$1.00"; -const kThreeUSD = "\$3.00"; -const kFiveUSD = "\$5.00"; - const kLOW_LOW_BALANCE_CONSTANT = "Tx error:5"; -const kPylons1 = "pylons_10"; -const kPylons3 = "pylons_35"; -const kPylons5 = "pylons_60"; - //NFT STRINGS KEYS const kResidual = "Residual"; const kQuantity = "Quantity"; @@ -473,8 +367,7 @@ const String kNftViewKey = "nft_view"; const String kItemIdKey = "item_id"; const String kTradeIdKey = "trade_id"; const String kLinkKey = "link"; -const String kIpcEncodeMessage = - "Wallet Busy: A transaction is already in progress"; +const String kIpcEncodeMessage = "Wallet Busy: A transaction is already in progress"; //stripe payment receipt keys const String kProductID = "productID"; @@ -510,3 +403,9 @@ const String kZeroInt = "0"; const ipfsDomain = 'https://ipfs.io/ipfs'; const proxyIpfsDomain = 'https://proxy.pylons.tech/ipfs'; + +final defaultPylonsSKUs = jsonEncode([ + {"id": "pylons_10", "bonus": "", "subtitle": "\$1.00", "pylons": "10 PYLN"}, + {"id": "pylons_35", "bonus": "(+5 Bonus)", "subtitle": "\$3.00", "pylons": "35 PYLN"}, + {"id": "pylons_60", "bonus": "(+10 Bonus)", "subtitle": "\$5.00", "pylons": "50 PYLN"} +]); diff --git a/wallet/lib/utils/dependency_injection/dependency_injection.dart b/wallet/lib/utils/dependency_injection/dependency_injection.dart index f6dbe52e49..377ea9ed17 100644 --- a/wallet/lib/utils/dependency_injection/dependency_injection.dart +++ b/wallet/lib/utils/dependency_injection/dependency_injection.dart @@ -28,7 +28,7 @@ import 'package:pylons_wallet/services/repository/repository.dart'; import 'package:pylons_wallet/services/third_party_services/audio_player_helper.dart'; import 'package:pylons_wallet/services/third_party_services/crashlytics_helper.dart'; import 'package:pylons_wallet/services/third_party_services/network_info.dart'; -import 'package:pylons_wallet/services/third_party_services/remote_config_service.dart'; +import 'package:pylons_wallet/services/third_party_services/remote_config_service/remote_config_service.dart'; import 'package:pylons_wallet/services/third_party_services/remote_notifications_service.dart'; import 'package:pylons_wallet/services/third_party_services/share_helper.dart'; import 'package:pylons_wallet/services/third_party_services/store_payment_service.dart'; diff --git a/wallet/test/mocks/mock_constants.dart b/wallet/test/mocks/mock_constants.dart index afa05895f6..6c5cb7f659 100644 --- a/wallet/test/mocks/mock_constants.dart +++ b/wallet/test/mocks/mock_constants.dart @@ -8,8 +8,7 @@ import 'package:pylons_wallet/pages/home/currency_screen/model/ibc_trace_model.d import 'package:pylons_wallet/utils/base_env.dart'; import 'package:transaction_signing_gateway/model/transaction_hash.dart'; -TransactionHash MOCK_TRANSACTION = const TransactionHash( - hash: '64CFE19786363B8C6AB10D865A5C570C3999AB0B95E5723BE584F574FC58F99E'); +TransactionHash MOCK_TRANSACTION = const TransactionHash(hash: '64CFE19786363B8C6AB10D865A5C570C3999AB0B95E5723BE584F574FC58F99E'); String MOCK_USERNAME = "Jawad"; String SENDER_APP = 'Sending app'; @@ -193,8 +192,7 @@ const String MOCK_EXECUTION_ID = 'executionId'; const String MOCK_ERROR = 'SOMETHING_WENT_WRONG'; const String MOCK_RECIPE_VERSION = 'recipe version'; const String MOCK_NODE_VERSION = 'node version'; -const String MOCK_MNEMONIC = - "laundry number match ring spatial surround gadget rally teach second cover crucial"; +const String MOCK_MNEMONIC = "laundry number match ring spatial surround gadget rally teach second cover crucial"; const String MOCK_TOKEN = 'tokenXYZ'; const String SIGNATURE = 'signature'; @@ -203,11 +201,8 @@ const String MOCK_ACCOUNT_LINK = 'mock_account_link'; const String MOCK_ACCOUNT = 'mock_account'; const bool MOCK_STRIPE_ACCOUNT_EXISTS = true; -StripeUpdateAccountRequest MOCK_STRIPE_UPDATE_ACCOUNT_REQUEST = - StripeUpdateAccountRequest( - Address: MOCK_ADDRESS, Token: MOCK_TOKEN, Signature: SIGNATURE); -StripeGetLoginBasedOnAddressRequest MOCK_STRIPE_LOGIN_BASED_ADDRESS_REQUEST = - StripeGetLoginBasedOnAddressRequest(MOCK_ADDRESS); +StripeUpdateAccountRequest MOCK_STRIPE_UPDATE_ACCOUNT_REQUEST = StripeUpdateAccountRequest(Address: MOCK_ADDRESS, Token: MOCK_TOKEN, Signature: SIGNATURE); +StripeGetLoginBasedOnAddressRequest MOCK_STRIPE_LOGIN_BASED_ADDRESS_REQUEST = StripeGetLoginBasedOnAddressRequest(MOCK_ADDRESS); Item MOCK_ITEM = Item( owner: '', @@ -242,9 +237,7 @@ BaseEnv MOCK_BASE_ENV = BaseEnv() stripeCallbackRefreshUrl: "", chainId: 'pylons-testnet-2', ibcTraceUrl: "", - mongoUrl: ''); + mongoUrl: '', + skus: '[]'); -IBCTraceModel MOCK_IBC_TRACE_MODEL = IBCTraceModel( - denomTrace: DenomTrace(baseDenom: IBCCoins.ujunox, path: ''), - ibcHash: - '64CFE19786363B8C6AB10D865A5C570C3999AB0B95E5723BE584F574FC58F99E'); +IBCTraceModel MOCK_IBC_TRACE_MODEL = IBCTraceModel(denomTrace: DenomTrace(baseDenom: IBCCoins.ujunox, path: ''), ibcHash: '64CFE19786363B8C6AB10D865A5C570C3999AB0B95E5723BE584F574FC58F99E');