Skip to content

Commit

Permalink
ibc improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
kjawadDeveloper2 committed Nov 7, 2022
1 parent 769e363 commit 4b89b7d
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 46 deletions.
31 changes: 30 additions & 1 deletion easel/lib/screens/creator_hub/creator_hub_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ class BuildGridView extends StatelessWidget {
key: const Key(kPriceBannerKey),
color: EaselAppTheme.kDarkGreen,
location: BannerLocation.topEnd,
message: "\$ ${nft.price}",
message: "${getCoinWithProperDenomination(nft.ibcCoins, nft.price)} ${getAbbrev(ibcCoin: nft.ibcCoins)}",
child: NftGridViewItem(
nft: nft,
),
Expand All @@ -407,6 +407,35 @@ class BuildGridView extends StatelessWidget {
},
);
}

String getCoinWithProperDenomination(String ibcCoin, String amount) {
if (ibcCoin == "weth_wei") {
return (double.parse(amount) / kEthIntBase).toStringAsFixed(2);
} else if (ibcCoin == "upylon") {
return (double.parse(amount) / kBigIntBase).toStringAsFixed(0);
} else {
return (double.parse(amount) / kEthIntBase).toStringAsFixed(2);
}
}

String getAbbrev({required String ibcCoin}) {
switch (ibcCoin) {
case "urun":
return kAgoricAbr;
case "upylon":
return kPYLNAbbrevation;
case "ustripeusd":
return kStripeUSDABR;
case "eeur":
return kEmoneyAbb;
case "uatom":
return kAtomAbr;
case "weth_wei":
return kEthereumAbr;
default:
return kPYLNAbbrevation;
}
}
}

class BuildListView extends StatelessWidget {
Expand Down
41 changes: 14 additions & 27 deletions easel/lib/widgets/clipped_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,51 +35,38 @@ class ClippedButton extends StatelessWidget {
},
child: isShadow!
? CustomPaint(
painter: clipperType == ClipperType.bottomLeftTopRight
? BoxShadowPainterBottomLeftTopRight(
cuttingHeight: cuttingHeight)
: BoxShadowPainterTopLeftBottomRight(
cuttingHeight: cuttingHeight),
painter:
clipperType == ClipperType.bottomLeftTopRight ? BoxShadowPainterBottomLeftTopRight(cuttingHeight: cuttingHeight) : BoxShadowPainterTopLeftBottomRight(cuttingHeight: cuttingHeight),
child: ClipPath(
clipper: clipperType == ClipperType.bottomLeftTopRight
? ButtonClipperBottomLeftTopRight(
cuttingHeight: cuttingHeight)
: ButtonClipperTopLeftBottomRight(
cuttingHeight: cuttingHeight),
clipper: clipperType == ClipperType.bottomLeftTopRight ? ButtonClipperBottomLeftTopRight(cuttingHeight: cuttingHeight) : ButtonClipperTopLeftBottomRight(cuttingHeight: cuttingHeight),
child: Container(
color: bgColor,
height: 40.h,
child: Center(
child: Text(
title,
style: TextStyle(
color: textColor,
fontSize: 16.sp,
fontWeight: fontWeight),
style: TextStyle(color: textColor, fontSize: 16.sp, fontWeight: fontWeight),
textAlign: TextAlign.center,
)),
),
),
)
: ClipPath(
clipper: clipperType == ClipperType.bottomLeftTopRight
? ButtonClipperBottomLeftTopRight(
cuttingHeight: cuttingHeight)
: ButtonClipperTopLeftBottomRight(
cuttingHeight: cuttingHeight),
clipper: clipperType == ClipperType.bottomLeftTopRight ? ButtonClipperBottomLeftTopRight(cuttingHeight: cuttingHeight) : ButtonClipperTopLeftBottomRight(cuttingHeight: cuttingHeight),
child: Container(
color: bgColor,
height: 40.h,
child: Center(
child: Text(
title,
style: TextStyle(
color: textColor,
fontSize: 16.sp,
fontWeight: fontWeight,
child: Text(
title,
style: TextStyle(
color: textColor,
fontSize: 16.sp,
fontWeight: fontWeight,
),
textAlign: TextAlign.center,
),
textAlign: TextAlign.center,
)),
),
),
),
);
Expand Down
1 change: 0 additions & 1 deletion wallet/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -102,5 +102,4 @@ dependencies {
implementation 'com.google.firebase:firebase-appcheck-debug:16.1.0'
constraints { implementation('com.stripe:stripe-android') { version { strictly '20.11.0' } } }
constraints { implementation('com.stripe:financial-connections') { version { strictly '20.11.0' } } }

}
28 changes: 14 additions & 14 deletions wallet/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 11;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = QV67PMQ8H3;
ENABLE_BITCODE = NO;
GOOGLE_SERVICE_PATH = "";
Expand All @@ -419,7 +419,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.1.3;
MARKETING_VERSION = 1.1.4;
PRODUCT_BUNDLE_IDENTIFIER = xyz.pylons.wallet;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -547,7 +547,7 @@
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 11;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = QV67PMQ8H3;
ENABLE_BITCODE = NO;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = i386;
Expand All @@ -558,7 +558,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.1.3;
MARKETING_VERSION = 1.1.4;
PRODUCT_BUNDLE_IDENTIFIER = xyz.pylons.wallet;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand All @@ -580,7 +580,7 @@
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 11;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = QV67PMQ8H3;
ENABLE_BITCODE = NO;
GOOGLE_SERVICE_PATH = "";
Expand All @@ -590,7 +590,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.1.3;
MARKETING_VERSION = 1.1.4;
PRODUCT_BUNDLE_IDENTIFIER = xyz.pylons.wallet;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -666,7 +666,7 @@
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 11;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = QV67PMQ8H3;
ENABLE_BITCODE = NO;
GOOGLE_SERVICE_PATH = "${SRCROOT}/Runner/Firebase/prod/GoogleService-Info.plist";
Expand All @@ -676,7 +676,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.1.3;
MARKETING_VERSION = 1.1.4;
PRODUCT_BUNDLE_IDENTIFIER = xyz.pylons.wallet;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -750,7 +750,7 @@
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 11;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = QV67PMQ8H3;
ENABLE_BITCODE = NO;
GOOGLE_SERVICE_PATH = "${SRCROOT}/Runner/Firebase/prod/GoogleService-Info.plist";
Expand All @@ -760,7 +760,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.1.3;
MARKETING_VERSION = 1.1.4;
PRODUCT_BUNDLE_IDENTIFIER = xyz.pylons.wallet;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -836,7 +836,7 @@
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 11;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = QV67PMQ8H3;
ENABLE_BITCODE = NO;
GOOGLE_SERVICE_PATH = "${SRCROOT}/Runner/Firebase/development/GoogleService-Info.plist";
Expand All @@ -846,7 +846,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.1.3;
MARKETING_VERSION = 1.1.4;
PRODUCT_BUNDLE_IDENTIFIER = xyz.pylons.wallet.development;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -920,7 +920,7 @@
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 11;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = QV67PMQ8H3;
ENABLE_BITCODE = NO;
GOOGLE_SERVICE_PATH = "${SRCROOT}/Runner/Firebase/development/GoogleService-Info.plist";
Expand All @@ -930,7 +930,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.1.3;
MARKETING_VERSION = 1.1.4;
PRODUCT_BUNDLE_IDENTIFIER = xyz.pylons.wallet.development;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,8 @@ Future<void> init() async {

/// ViewModels
sl.registerLazySingleton<WalletsStore>(() => WalletsStoreImp(repository: sl(), crashlyticsHelper: sl(), accountProvider: sl(), remoteNotificationProvider: sl()));
sl.registerFactory(() => PurchaseItemViewModel(sl(), audioPlayerHelper: sl(), videoPlayerHelper: sl(), repository: sl(), shareHelper: sl(), accountPublicInfo: sl()));
sl.registerFactory(
() => PurchaseItemViewModel(sl(), audioPlayerHelper: sl(), videoPlayerHelper: sl(), repository: sl(), shareHelper: sl(), accountPublicInfo: sl<AccountProvider>().accountPublicInfo!));
sl.registerLazySingleton(() => CollectionViewModel(walletsStore: sl(), thumbnailHelper: sl(), accountPublicInfoInfo: sl<AccountProvider>().accountPublicInfo!));
sl.registerLazySingleton(() => StripeHandler(walletsStore: sl(), localDataSource: sl(), repository: sl(), accountProvider: sl()));
sl.registerLazySingleton(() => HomeProvider(repository: sl(), accountPublicInfo: sl<AccountProvider>().accountPublicInfo!));
Expand Down
5 changes: 3 additions & 2 deletions wallet/lib/utils/extension.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ extension ConvertToUSD on String {
}
return '';
}

String convertPylonsToUSD(String amount) {
return (double.parse(convertFromUCoin(amount)) * pyLonToUsdConstant).toString().truncateAfterDecimal(2);
}
Expand All @@ -51,6 +52,7 @@ extension ConvertFromU on String {
}
return '';
}

String convertFromUCoin(String amount) {
return (double.parse(amount) / kBigIntBase).toString();
}
Expand Down Expand Up @@ -93,7 +95,7 @@ extension StringExtension on String {
}

if (length - indexOf(".") > maxLength) {
return substring(0, indexOf(".") + maxLength);
return substring(0, indexOf(".") + maxLength + 1);
}

return this;
Expand Down Expand Up @@ -225,7 +227,6 @@ extension ChangeDomain on String {
}
}


extension VerifyErrorCode on String {
bool ifDuplicateReceipt() {
return contains(kDuplicateIapReceiptCode);
Expand Down

0 comments on commit 4b89b7d

Please sign in to comment.